[fpc-devel] gdb crashes with trunk

Martin Schreiber fpmse at bluewin.ch
Thu Apr 3 15:02:46 CEST 2008


On Thursday 03 April 2008 14.04:44 Jonas Maebe wrote:
> On 03 Apr 2008, at 13:54, Martin Schreiber wrote:
> > I am currently debugging the "cleanroom code" which is a frustrating
> > matter
> > because gdb crashes at allmost every breakpoint.
> > Any hints how to let gdb work more stable with trunk on i386-linux?
>
> Can you give a reproducible case? 

Checkout https://mseide-msegui.svn.sourceforge.net/svnroot/mseide-msegui/trunk
Compile apps/ide/mseide.pas  and FPC RTL with FPC trunk and -O- -gl.
"
mse at linux-mse:~/packs/standard/svn/mse/trunk/apps/ide> gdb ./mseidefp
GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) break main.pas:1422
Breakpoint 1 at 0x80a6884: file main.pas, line 1422.
(gdb) set args -np
(gdb) run
Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/mseidefp -np
[Thread debugging using libthread_db enabled]
[New Thread 0xb7c298d0 (LWP 25514)]
[Switching to Thread 0xb7c298d0 (LWP 25514)]

Breakpoint 1, TMAINFO__MAINONLOADED (SENDER=0xb7645870, this=0xb7645870) at 
main.pas:1422
1422      mainstatfile.readstat;
(gdb) bt
#0  TMAINFO__MAINONLOADED (SENDER=0xb7645870, this=0xb7645870) at 
main.pas:1422
#1  0x08188a97 in TCUSTOMMSEFORM__DOEVENTLOOPSTART (this=0xb7645870) at 
mseforms.pas:848
#2  0x08188ae3 in TCUSTOMMSEFORM__RECEIVEEVENT (EVENT=0xb7c20bc0, 
this=0xb7645870) at mseforms.pas:857
Segmentation fault
mse at linux-mse:~/packs/standard/svn/mse/trunk/apps/ide>                    
"

> It's possible we can work around it 
> by structuring the debug info differently. Also, did you compile the
> trunk units with a trunk compiler or with a 2.2.1 compiler?
>
make clean all in trunk, compiled the RTL with the new trunk compiler 
and -O- -gl.

> One thing you can try is using -gw to use dwarf instead of stabs.
>
That helps, thanks a lot!

#0  080DA2E7 writer.inc:869 WRITEPROPERTY(INSTANCE=0xb74ff0c0, 
PROPINFO=0x84d0da9, this=0xb7555cf0)
#1  080D9896 writer.inc:678 WRITEPROPERTIES(INSTANCE=0xb74ff0c0, 
this=0xb7555cf0)
#2  080D9606 writer.inc:603 WRITECOMPONENTDATA(INSTANCE=0xb74ff0c0, 
this=0xb7555cf0)
#3  080CD5E7 compon.inc:386 WRITESTATE(WRITER=0xb7555cf0, this=0xb74ff0c0)
#4  080FD422 mseclasses.pas:2915 WRITESTATE(WRITER=0xb7555cf0, 
this=0xb74ff0c0)
#5  080D939F writer.inc:545 WRITECOMPONENT(COMPONENT=0xb74ff0c0, 
this=0xb7555cf0)
#6  080D966E writer.inc:617 WRITEDESCENDENT(AROOT=0xb74ff0c0, AANCESTOR=0x0, 
this=0xb7555cf0)
#7  080DAA6C writer.inc:962 WRITEROOTCOMPONENT(AROOT=0xb74ff0c0, 
this=0xb7555cf0)
#8  080F98EA mseclasses.pas:979 COPYCOMPONENT(COPYCOMPONENT=0xb75031e0, 
SOURCE=0xb74ff0c0, AOWNER=0x0, ONFINDANCESTOR=@0xbf8e72d8: {Proc = {procedure 
(^pointer, ^TWRITER = class , ^TCOMPONENT = class , ^Char, ^TCOMPONENT = 
class , ^TCOMPONENT = class )} 0xbf8e72d8, Self = 0xb77f7020}, 
ONFINDCOMPONENTCLASS=@0xbf8e72f0: {Proc = {procedure (^pointer, ^TREADER = 
class , ^Char, ^__vtbl_ptr_type = record )} 0xbf8e72f0, Self = 0xb77f7020}, 
ONCREATECOMPONENT=@0xbf8e72e8: {Proc = {procedure (^pointer, ^TREADER = 
class , ^__vtbl_ptr_type = record , ^TCOMPONENT = class )} 0xbf8e72e8, Self = 
0xb77f7020}, ONANCESTORNOTFOUND=@0xbf8e72e0: {Proc = {procedure (^pointer, 
^TREADER = class , ^Char, ^__vtbl_ptr_type = record , ^TCOMPONENT = class )} 
0xbf8e72e0, Self = 0xb77f7020})
#9  0816BC2F msedesigner.pas:2838 COPYCOMPONENT(COPYCOMPONENT=0xbf8e7314, 
SOURCE=0xb74ff0c0, ROOT=0xb74ff0c0, this=0xb77f7020)
#10  0816AE8E msedesigner.pas:2410 CREATECOMPONENT(READER=0xb756b740, 
COMPONENTCLASS=0x84cea98, COMPONENT=@0xbf8e7490: 0x0, this=0xb77f7020)
#11  080D5CF1 reader.inc:812 READCOMPONENT(READCOMPONENT=0x0, COMPONENT=0x0, 
this=0xb756b740)
#12  080D62F5 reader.inc:920 READDATA(INSTANCE=0xb7504ff0, this=0xb756b740)
#13  080CD267 compon.inc:272 READSTATE(READER=0xb756b740, this=0xb7504ff0)
#14  080FD0F5 mseclasses.pas:2824 READSTATE(READER=0xb756b740, 
this=0xb7504ff0)
#15  0818A183 mseforms.pas:1206 READSTATE(READER=0xb756b740, this=0xb7504ff0)
#16  080D75BB reader.inc:1289 READROOTCOMPONENT(READROOTCOMPONENT=0xb7504ff0, 
AROOT=0xb7504ff0, this=0xb756b740)
#17  0816D62D msedesigner.pas:3474 LOADFORMFILE(LOADFORMFILE=0xb76daff0, 
FILENAME=0xb75559d8, this=0xb77f7020)
#18  080A6703 main.pas:1230 OPENFORMFILE(OPENFORMFILE=0x0, 
FILENAME=0xb7555708, ASHOW=true, AACTIVATE=false, SHOWSOURCE=false, 
CREATEMENU=true, this=0xb75e1870)
#19  080903A6 sourceform.pas:479 UPDATESTAT(STATFILER=0xb75cf460, 
this=0xb770c2e0)
#20  08177811 projectoptionsform.pas:1187 
UPDATEPROJECTOPTIONS(STATFILER=0xb75cf460, AFILENAME=0xb7bb29d8)
#21  0817A176 projectoptionsform.pas:1559 
READPROJECTOPTIONS(READPROJECTOPTIONS=false, FILENAME=0xb7bb29d8)
#22  080A92A4 main.pas:1892 OPENPROJECT(OPENPROJECT=false, ANAME=0xb7bb29d8, 
ASCOPY=false, this=0xb75e1870)
#23  080A9E7B main.pas:2072 OPENPROJECTONEXECUTE(SENDER=0xb780ebe0, 
this=0xb75e1870)
#24  0815918D mseact.pas:300 DOACTIONEXECUTE(DOACTIONEXECUTE=true, 
SENDER=0xb780ebe0, INFO=@0xb780ec14: {ACTION = 0x0, CAPTIONTEXT = 0xb7571248, 
CAPTION1 = {TEXT = 0xb7571208, FORMAT = {{INDEX = 0, NEWINFOS = 1048832, 
STYLE = {FONTCOLOR = 0x8, COLORBACKGROUND = 0x0, FONTSTYLE = 0}}}}, STATE = 
1048832, OPTIONS = 8, SHORTCUT = 0, SHORTCUT1 = 0, GROUP = 0, IMAGENR = -1, 
IMAGENRDISABLED = -2, COLORGLYPH = 2415919117, COLOR = 2147483649, 
IMAGECHECKEDOFFSET = 0, IMAGELIST = 0x0, HINT = 0x0, TAG = 0, ONEXECUTE = 
{Proc = {procedure (^pointer, ^TOBJECT = class )} 0xb780ec54, Self = 
0xb75e1870}}, NOCHECKBOX=true)
#25  08150043 msemenus.pas:481 CHECKEXEC(CHECKEXEC=true, this=0xb7a2c860)
#26  0815D328 msemenuwidgets.pas:1242 ACTIVATEMENU(KEYMODE=false, 
ACLICKED=true, this=0xb76024c0)
#27  0815CBF1 msemenuwidgets.pas:1088 MOUSEEVENT(INFO=@0xbf8e7e24: {EVENTKIND 
= EK_MOUSEMOVE, SHIFTSTATE = 8, POS = {X = 212, Y = 19}, EVENTSTATE = 0, 
TIMESTAMP = 2530890616, BUTTON = MB_NONE}, this=0xb75f12c0)
#28  0815E5FA msemenuwidgets.pas:1738 MOUSEEVENT(INFO=@0xbf8e7e24: {EVENTKIND 
= EK_MOUSEMOVE, SHIFTSTATE = 8, POS = {X = 212, Y = 19}, EVENTSTATE = 0, 
TIMESTAMP = 2530890616, BUTTON = MB_NONE}, this=0xb75f12c0)
#29  0807F1B1 msegui.pas:10630 DISPATCHMOUSEEVENT(INFO=@0xbf8e7e24: {EVENTKIND 
= EK_MOUSEMOVE, SHIFTSTATE = 8, POS = {X = 212, Y = 19}, EVENTSTATE = 0, 
TIMESTAMP = 2530890616, BUTTON = MB_NONE}, CAPTURE=0xb75f12c0, 
this=0xb76d82e0)
#30  080819DA msegui.pas:11714 PROCESSMOUSEEVENT(EVENT=0xb75ceaa0, 
this=0xb7a1c020)
#31  0808303F msegui.pas:12305 EVENTLOOP(EVENTLOOP=false, AMODALWINDOW=0x0, 
ONCE=false, this=0xb7a1c020)
#32  08083DCC msegui.pas:12715 DOEVENTLOOP(ONCE=false, this=0xb7a1c020)
#33  080F6F08 mseapplication.pas:1064 RUN(this=0xb7a1c020)
#34  0804C759 mseide.pas:57 main()

Martin



More information about the fpc-devel mailing list