[Lazarus] Challenge of converting a Delphi project

Juha Manninen juha.manninen at phnet.fi
Mon May 3 23:44:52 CEST 2010


Mattias Gärtner wrote:
> Do you mean the IDE becomes unstable because of a RunError in a  
> debugged program?

Yes, sometimes, not always.
The console output (below) came when closing Lazarus. The application had 
closed shortly before. I also saw Lazarus crashing without closing it, so it 
really was unstable.

Now when I tested with GTK2 version of Lazarus I didn't see it happening. So, 
this can be because QT bindings are under heavy development. (Zeljko, if you 
need a good crash test, try my EssModel port :-))


> RunError are critical. There is something very wrong in the code (e.g.  
> dangling poniter, unintialized variable, etc). Please compile with all  
> checks.

All checks are on:
 I/O
 Range
 Overflow
 Stack
 Verify method calls

The unit and include paths are long but they should be OK.
Other unit files:
 Components/;CodeProvider/;Integrator/;Integrator/Code/;Integrator/Code/Delphi/;Integrator/CodeIO/;Integrator/CodeIO/JavaClass/;Integrator/Doc/;Integrator/Export/;Integrator/View/;Integrator/View/RtfdDiagram/;Model/;System/
Include files:
 Components/;CodeProvider/;Integrator/;Integrator/Code/;Integrator/Code/Delphi/;Integrator/CodeIO/;Integrator/CodeIO/JavaClass/;Integrator/Doc/;Integrator/Export/;Integrator/View/;Integrator/View/RtfdDiagram/;Model/;System/

There is a RunError, then some exceptions including wrong typecast exception, 
and then access violation when the program flow reaches this:
    crkObj := TCrackControl(C);

C's type is TControl and crkObj's type is TCrackControl.
It passes this test :
  if C is TControl then
    crkObj := TCrackControl(C);

There should be no situation that code raises a wrong typecast exception, or 
the other errors, after passing the test.

I debugged the code a lot and saw this problem only with TCrackControl(...) 
typecast. Earlier I complained about loosing my mouse and key controls but 
that was because I hit the breakpoint inside a MouseDown handler and it 
disabled the mouse commands somehow (and I could not use keys because the 
editor window didn't have focus).


Juha

-----------------------

TApplication.HandleException Access violation
  Stack trace:
  $080719DC
  $08139524 line 144 of include/lclintf.inc
  $081B50A6 line 123 of widgetset/wsimglist.pp
  $081B5420 line 210 of widgetset/wsimglist.pp
  $08152F17 line 470 of include/imglist.inc
  $08152E7E line 461 of include/imglist.inc
  $08225DE3 line 350 of include/toolbutton.inc
  $081D4C84 line 64 of include/graphiccontrol.inc
  $0806C69A
  $081CC818 line 1078 of include/control.inc
  $081C3BAD line 4860 of include/wincontrol.inc
  $081C3975 line 4797 of include/wincontrol.inc
  $081C6E79 line 6700 of include/wincontrol.inc
  $081D50E2 line 113 of include/customcontrol.inc
  $0806C69A
  $081C4979 line 5284 of include/wincontrol.inc
  $0824D8E9 line 2932 of qtwidgets.pas
TApplication.HandleException Access violation
  Stack trace:
  $080719DC
  $0820D293 line 789 of include/promptdialog.inc
  $0820DC57 line 939 of include/promptdialog.inc
  $0820DCFC line 952 of include/promptdialog.inc
  $080BF777 line 11968 of main.pp
  $080CB4A8 line 15827 of main.pp
  $08088788 line 633 of include/application.inc
  $08087F6F line 353 of include/application.inc
  $0826090C line 12098 of qtwidgets.pas
  $081FB3A5 line 272 of qtlclintf.inc
  $08139BEA line 337 of include/lclintf.inc
  $0820B019 line 177 of include/messagedialogs.inc
  $0845F62D line 2697 of project.pp
  $080B00A1 line 7223 of main.pp
  $080B79A4 line 9636 of main.pp
  $080BBC5B line 10904 of main.pp
  $080B9BF9 line 10318 of main.pp
QPainter::end: Painter ended with 2 saved states
TApplication.HandleException: there was another exception during showing the 
first exception
  Stack trace:
  $080719DC
  $081B507E line 120 of widgetset/wsimglist.pp
  $081B5420 line 210 of widgetset/wsimglist.pp
  $08152F17 line 470 of include/imglist.inc
  $08152E7E line 461 of include/imglist.inc
  $08225DE3 line 350 of include/toolbutton.inc
  $081D4C84 line 64 of include/graphiccontrol.inc
  $0806C69A
  $081CC818 line 1078 of include/control.inc
  $081C3BAD line 4860 of include/wincontrol.inc
  $081C3975 line 4797 of include/wincontrol.inc
  $081C6E79 line 6700 of include/wincontrol.inc
  $081D50E2 line 113 of include/customcontrol.inc
  $0806C69A
  $081C4979 line 5284 of include/wincontrol.inc
  $0824D8E9 line 2932 of qtwidgets.pas
  $0824BBA2 line 1993 of qtwidgets.pas
[TMainIDE.Destroy] A 
TApplication.HandleException: there was another exception during showing the 
first exception
  Stack trace:
  $080719DC
  $086E9354 line 350 of ../debugger/cmdlinedebugger.pp
  $086E9139 line 275 of ../debugger/cmdlinedebugger.pp
  $086FEF6B line 3635 of ../debugger/gdbmidebugger.pp
  $086F70A9 line 1356 of ../debugger/gdbmidebugger.pp
  $086F6C81 line 1274 of ../debugger/gdbmidebugger.pp
  $086F6BB2 line 1253 of ../debugger/gdbmidebugger.pp
  $084BF791 line 2558 of debugmanager.pas
  $0809BDEE line 1395 of main.pp
  $0806C212
  $0807C34D line 1686 of forms.pp
  $08070299
  $0824D990 line 2940 of qtwidgets.pas
  $0824BBA2 line 1993 of qtwidgets.pas
  $0825C72A line 10306 of qtwidgets.pas
  $0825D0B0 line 10623 of qtwidgets.pas
  $B7771B9E line 40 of src/qlclabstractscrollarea.h
lazarus.pp - unhandled exception
[TMainIDE.Destroy] A 
[FORMS.PP] ExceptionOccurred




More information about the Lazarus mailing list