Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-02

Lazarus compiled with FPC2.4.4, -O2 optimized, crashes

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

Interesting bug:
Lazarus crashes when it is compiled with FPC2.4.4 and -O2, on Linux. Maybe it has happened for long, I have not built an optimized binary for a long time.
Happens with both GTK2 and QT bindings.

Juha

---

TMainIDE.DoLoadLFM Creating designer for hidden component of /home/juha/SW/lazarus_gitsvn/ide/editorfilemanager.pas TMainIDE.DoOpenProjectFile select form in designer: EditorFileManagerForm:TEditorFileManagerForm TDesigner TApplication.HandleException Access violation
Stack trace:
$0000000000E2B414 line 443 of lazsynedittext.pas
$00000000007E5934 line 7658 of include/wincontrol.inc $00000000007F6AE7 line 5345 of include/control.inc $00000000007F6AD9 line 5343 of include/control.inc $00000000007F6AD9 line 5343 of include/control.inc $00000000007F6AD9 line 5343 of include/control.inc $00000000007F3460 line 4191 of include/control.inc $0000000000B629CA line 4989 of sourceeditor.pp
$0000000000B66464 line 5656 of sourceeditor.pp
$00000000006585E1 line 11183 of main.pp
$000000000062FEAA line 2231 of main.pp
$000000000062C12F line 1510 of main.pp
$00000000005BAD75 line 112 of lazarus.pp
***** TSourceEditor.Destroy: FInEditorChangedUpdating was true LAZARUS END - cleaning up ...

Reply by email

zeljko
to Juha Manninen
Juha Manninen wrote 31 lines
Interesting bug: Lazarus crashes when it is compiled with FPC2.4.4 and -O2, on Linux. Maybe it has happened for long, I have not built an optimized binary for a long time. Happens with both GTK2 and QT bindings. Juha --- TMainIDE.DoLoadLFM Creating designer for hidden component of /home/juha/SW/lazarus_gitsvn/ide/editorfilemanager.pas TMainIDE.DoOpenProjectFile select form in designer: EditorFileManagerForm:TEditorFileManagerForm TDesigner TApplication.HandleException Access violation Stack trace: $0000000000E2B414 line 443 of lazsynedittext.pas $00000000007E5934 line 7658 of include/wincontrol.inc $00000000007F6AE7 line 5345 of include/control.inc $00000000007F6AD9 line 5343 of include/control.inc $00000000007F6AD9 line 5343 of include/control.inc $00000000007F6AD9 line 5343 of include/control.inc $00000000007F3460 line 4191 of include/control.inc $0000000000B629CA line 4989 of sourceeditor.pp $0000000000B66464 line 5656 of sourceeditor.pp $00000000006585E1 line 11183 of main.pp $000000000062FEAA line 2231 of main.pp $000000000062C12F line 1510 of main.pp $00000000005BAD75 line 112 of lazarus.pp ***** TSourceEditor.Destroy: FInEditorChangedUpdating was true LAZARUS END - cleaning up ...

I don't see any widgetset related error here...lazsynedittext is last in chain, maybe Martin knows more about it.

zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120219/df5adba7/attachment.html>

Reply by email

Martin
to zeljko

line 443 is a begin statement?

zeljko wrote 79 lines
On Sunday 19 of February 2012 19:47:24 Juha Manninen wrote: > Interesting bug: > Lazarus crashes when it is compiled with FPC2.4.4 and -O2, on Linux. > Maybe it has happened for long, I have not built an optimized binary > for a long time. > Happens with both GTK2 and QT bindings. > > Juha > > --- > > TMainIDE.DoLoadLFM Creating designer for hidden component of > /home/juha/SW/lazarus_gitsvn/ide/editorfilemanager.pas > TMainIDE.DoOpenProjectFile select form in designer: > EditorFileManagerForm:TEditorFileManagerForm TDesigner > TApplication.HandleException Access violation > Stack trace: > $0000000000E2B414 line 443 of lazsynedittext.pas > $00000000007E5934 line 7658 of include/wincontrol.inc > $00000000007F6AE7 line 5345 of include/control.inc > $00000000007F6AD9 line 5343 of include/control.inc > $00000000007F6AD9 line 5343 of include/control.inc > $00000000007F6AD9 line 5343 of include/control.inc > $00000000007F3460 line 4191 of include/control.inc > $0000000000B629CA line 4989 of sourceeditor.pp > $0000000000B66464 line 5656 of sourceeditor.pp > $00000000006585E1 line 11183 of main.pp > $000000000062FEAA line 2231 of main.pp > $000000000062C12F line 1510 of main.pp > $00000000005BAD75 line 112 of lazarus.pp > ***** TSourceEditor.Destroy: FInEditorChangedUpdating was true > LAZARUS END - cleaning up ... I don't see any widgetset related error here...lazsynedittext is last in chain, maybe Martin knows more about it. zeljko -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120219/d32c042b/attachment-0001.html>

Reply by email

Juha Manninen
to Martin

Ok, I made a proper backtrace. The line numbers are more correct, too. This is not a serious issue. It happens only with -O2 and FPC 2.4.4. 2.6.x is better in many ways.

---

(gdb) bt
#0 TEXTTOVIEWINDEX (this=0x0, AINDEX=412) at lazsynedittext.pas:444 #1 0x0000000000d01c74 in TEXTTOVIEWINDEX (this=0x7fffe2088ae0, AINDEX=412) at syneditfoldedview.pp:786
#2 0x0000000000d3d664 in INVALIDATELINES (this=0x7fffe2088ae0, FIRSTTEXTLINE=412, LASTTEXTLINE=420) at syngutter.pp:145 #3 0x0000000000db4f41 in INVALIDATEGUTTERLINES (this=0x7fffe2088ae0, FIRSTTEXTLINE=412, LASTTEXTLINE=0) at lazsyntextarea.pp:229 #4 0x0000000000ce9822 in INVALIDATEGUTTERLINES (this=0x7fffe2088ae0, FIRSTLINE=413, LASTLINE=421) at synedit.pp:2550
#5 0x0000000000d0a143 in CALCULATEMAPS (this=0x19c) at syneditfoldedview.pp:3465
#6 0x0000000000d09dae in SETLINESINWINDOW (this=0x0, AVALUE=420) at syneditfoldedview.pp:3393
#7 0x0000000000cf919a in RECALCCHARSANDLINESINWIN (this=0x7fffe2088ae0, CHECKCARET=true (156)) at synedit.pp:7326 #8 0x0000000000cf8f98 in SIZEORFONTCHANGED (this=0x7fffe2088ae0, BFONT=true (164)) at synedit.pp:7278
#9 0x0000000000cf9f21 in CREATEWND (this=0x0) at synedit.pp:7588 #10 0x00000000007bfb43 in CREATEHANDLE (this=0x7fffe2088ae0) at include/wincontrol.inc:7220
#11 0x0000000000cee582 in CREATEHANDLE (this=0x7fffe7abfb90) at synedit.pp:4024 #12 0x00000000007c2a14 in HANDLENEEDED (this=0x7fffe2088ae0) at include/wincontrol.inc:7658
#13 0x00000000007b782b in CHECKHANDLEALLOCATED (AWINCONTROL=0x0, parentfp=0x7fffffffdb60) at include/wincontrol.inc:3424 #14 0x00000000007b7885 in CHECKHANDLEALLOCATED (AWINCONTROL=0x0, parentfp=0x7fffffffdb60) at include/wincontrol.inc:3431 #15 0x00000000007b7885 in CHECKHANDLEALLOCATED (AWINCONTROL=0x0, parentfp=0x7fffffffdb60) at include/wincontrol.inc:3431 #16 0x00000000007b7885 in CHECKHANDLEALLOCATED (AWINCONTROL=0x0, parentfp=0x7fffffffdb60) at include/wincontrol.inc:3431 #17 0x00000000007b7423 in DOALLAUTOSIZE (this=0x7fffe71ad270) at include/wincontrol.inc:3475
#18 0x00000000007d3bc7 in ENABLEAUTOSIZING (this=0x7fffe2088ae0) at include/control.inc:5345
#19 0x00000000007d3bb9 in ENABLEAUTOSIZING (this=0x7fffe2088ae0) at include/control.inc:5343
#20 0x00000000007d3bb9 in ENABLEAUTOSIZING (this=0x7fffe2088ae0) at include/control.inc:5343
#21 0x00000000007d3bb9 in ENABLEAUTOSIZING (this=0x7fffe2088ae0) at include/control.inc:5343
#22 0x00000000007d0540 in SETVISIBLE (this=0x7fffe7abfb90, VALUE=true) at include/control.inc:4191
#23 0x0000000000aea55a in SETVISIBLE (this=0x7fffe2088ae0, VALUE=true (164)) at sourceeditor.pp:4989
#24 0x0000000000af2da0 in NOTEBOOKPAGECHANGED (this=0x7fffe2088ae0, SENDER=0x19c) at sourceeditor.pp:7127
#25 0x00000000007f95f5 in DOCHANGE (this=0x19c) at include/customnotebook.inc:285
#26 0x00000000007f9f46 in SETPAGEINDEX (this=0x7fffe2088ae0, AVALUE=420) at include/customnotebook.inc:558
#27 0x0000000000aedfd6 in SETPAGEINDEX (this=0x7fffe2088ae0, AVALUE=412) at sourceeditor.pp:5654
#28 0x0000000000aef965 in DECUPDATELOCKINTERNAL (this=0x7fffe2088ae0) at sourceeditor.pp:6066
#29 0x0000000000af6ae3 in DECUPDATELOCK (this=0x7ffff7ec3a70) at sourceeditor.pp:8312
#30 0x000000000065a5f1 in DOOPENPROJECTFILE (this=0x7ffff7fa29e0, AFILENAME=0x7fffe22d9b50
'/home/juha/SW/lazarus_gitsvn/ide/lazarus.lpi', FLAGS=0) at main.pp:11183
#31 0x0000000000631eba in SETUPSTARTPROJECT (this=0x7ffff7fa29e0) at main.pp:2231
#32 0x000000000062e13f in STARTIDE (this=0x7fffe2088ae0) at main.pp:1510 #33 0x00000000005bcd85 in main () at lazarus.pp:112

2012/2/19, Martin :

Show quoted text 84 lines
line 443 is a begin statement? On 19/02/2012 18:58, zeljko wrote: > > On Sunday 19 of February 2012 19:47:24 Juha Manninen wrote: > > > Interesting bug: > > > Lazarus crashes when it is compiled with FPC2.4.4 and -O2, on Linux. > > > Maybe it has happened for long, I have not built an optimized binary > > > for a long time. > > > Happens with both GTK2 and QT bindings. > > > > > > Juha > > > > > > --- > > > > > > TMainIDE.DoLoadLFM Creating designer for hidden component of > > > /home/juha/SW/lazarus_gitsvn/ide/editorfilemanager.pas > > > TMainIDE.DoOpenProjectFile select form in designer: > > > EditorFileManagerForm:TEditorFileManagerForm TDesigner > > > TApplication.HandleException Access violation > > > Stack trace: > > > $0000000000E2B414 line 443 of lazsynedittext.pas > > > $00000000007E5934 line 7658 of include/wincontrol.inc > > > $00000000007F6AE7 line 5345 of include/control.inc > > > $00000000007F6AD9 line 5343 of include/control.inc > > > $00000000007F6AD9 line 5343 of include/control.inc > > > $00000000007F6AD9 line 5343 of include/control.inc > > > $00000000007F3460 line 4191 of include/control.inc > > > $0000000000B629CA line 4989 of sourceeditor.pp > > > $0000000000B66464 line 5656 of sourceeditor.pp > > > $00000000006585E1 line 11183 of main.pp > > > $000000000062FEAA line 2231 of main.pp > > > $000000000062C12F line 1510 of main.pp > > > $00000000005BAD75 line 112 of lazarus.pp > > > ***** TSourceEditor.Destroy: FInEditorChangedUpdating was true > > > LAZARUS END - cleaning up ... > > > I don't see any widgetset related error here...lazsynedittext is last > in chain, maybe Martin knows more about it. > > > zeljko > > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Martin
to Juha Manninen

I can't reproduce it.

Ok I do not have Linux and 2.4.4.

I tried
- Fedora (gtk) 2.5.1 -O2
- Win 2.4.4 -O2

But that looks like an FPC issue...

See below:
- If the constructor has an exception, then that woul run destroy automatically; but things would crash much earlier...

anyway. re-run in gdb, with "-break-insert FPC_RAISEEXCEPTION" (requires "gdb -i mi" / or use none gdbmi "break insert...)

-------------------
If it happens, with only ONE synedit being open

set breakpoints:
- on the line it is created
look at the asm, to see thu address / offset in the object
- set a watchpoint on the address containing the internal pointer to the object
- on the line in RecalcCharsAndLinesInWin (frame 7) where it is nil check the value and check if it comes from the same memory

Juha Manninen wrote 20 lines
Ok, I made a proper backtrace. The line numbers are more correct, too. This is not a serious issue. It happens only with -O2 and FPC 2.4.4. 2.6.x is better in many ways. --- (gdb) bt #0 TEXTTOVIEWINDEX (this=0x0, AINDEX=412) at lazsynedittext.pas:444 #1 0x0000000000d01c74 in TEXTTOVIEWINDEX (this=0x7fffe2088ae0, AINDEX=412) at syneditfoldedview.pp:786 #2 0x0000000000d3d664 in INVALIDATELINES (this=0x7fffe2088ae0, FIRSTTEXTLINE=412, LASTTEXTLINE=420) at syngutter.pp:145 #3 0x0000000000db4f41 in INVALIDATEGUTTERLINES (this=0x7fffe2088ae0, FIRSTTEXTLINE=412, LASTTEXTLINE=0) at lazsyntextarea.pp:229 #4 0x0000000000ce9822 in INVALIDATEGUTTERLINES (this=0x7fffe2088ae0, FIRSTLINE=413, LASTLINE=421) at synedit.pp:2550 #5 0x0000000000d0a143 in CALCULATEMAPS (this=0x19c) at syneditfoldedview.pp:3465 #6 0x0000000000d09dae in SETLINESINWINDOW (this=0x0, AVALUE=420) at syneditfoldedview.pp:3393

FFoldedLinesView is unconditionally created in SynEdits Constructor (Which is the only place I found it being written)

    FFoldedLinesView := TSynEditFoldedView.Create(FTheLinesView, fCaret);

Only destroyed in Destroy

and frame 7 (below) calls frame 6 (above) like this

   FFoldedLinesView.LinesInWindow := LinesInWindow;

yet in Frame 6 "this = 0x0"

Show quoted text 8 lines
#7 0x0000000000cf919a in RECALCCHARSANDLINESINWIN (this=0x7fffe2088ae0, CHECKCARET=true (156)) at synedit.pp:7326 #8 0x0000000000cf8f98 in SIZEORFONTCHANGED (this=0x7fffe2088ae0, BFONT=true (164)) at synedit.pp:7278 #9 0x0000000000cf9f21 in CREATEWND (this=0x0) at synedit.pp:7588 #10 0x00000000007bfb43 in CREATEHANDLE (this=0x7fffe2088ae0) at include/wincontrol.inc:7220

Reply by email