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

Martin lazarus at mfriebe.de
Mon Feb 20 00:18:22 CET 2012


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





On 19/02/2012 19:38, Juha Manninen wrote:
> 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"


> #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
>





More information about the Lazarus mailing list