hardcore gdc problems

Downs default_357-line at yahoo.de
Mon Apr 2 20:40:19 PDT 2007


I've been running into problems with gdc for a while now (.21-.23, mingw32, 3.4.5 and 4.1.2), specifically crashes in odd places (language constructs).
It only seems to happen when I run many threads in parallel; are there any known issues with that?
Here's a log of a debugging session I made recently, after rebuilding Phobos without -O2 (Line space added):

D:\code\d\yawr>gdb bin\dbg\yawr.exe
GNU gdb 5.2.1
Copyright 2002 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 "i686-pc-mingw32"...


(gdb) r
Starting program: D:\code\d\yawr/bin\dbg\yawr.exe

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 2448.0xb18]
0x022cfea9 in ?? ()


(gdb) bt
#0  0x022cfea9 in ?? ()
#1  0x00421525 in _d_throw (obj=@0x1e17770)
     at ../../../gcc-4.1.2/libphobos/gcc/deh.d:99
#2  0x0042df41 in _D3std6socket15InternetAddress5_ctorMFAatZC3std6socket15Intern
etAddress (this=@0x1ea51a0, addr=
       {length = 18, ptr = 0x1bf4a67 "talismenseries.com/"}, port=80)
     at ../../../gcc-4.1.2/libphobos/std/socket.d:676
#3  0x0040337b in _D4main11do_DownloadFAaZAa (param=
       {length = 26, ptr = 0x1bf4a60 "http://talismenseries.com/"}) at main.d:67
#4  0x0040aed7 in _D4main8downloadFAaDFfZvZAa13__dgliteral26MFAaZAa (c=
       {length = 26, ptr = 0x1bf4a60 "http://talismenseries.com/"})
     at main.d:830
#5  0x00410692 in _D5tools6buffer17__T6bufferTAaTAaZ6buffer3getMFAaZAa13__dglite
ral73MFZb () at tools/buffer.d:37
#6  0x00547cc2 in _D5tools6buffer17__T6bufferTAaTAaZ6buffer3getMFAaZAa (
     this=@0x1e73c80, idx=
       {length = 26, ptr = 0x1bf4a60 "http://talismenseries.com/"})
     at tools/buffer.d:28
#7  0x0040ae84 in _D4main8downloadFAaDFfZvZAa (url=
       {length = 26, ptr = 0x1bf4a60 "http://talismenseries.com/"}, progress=
       {object = 0x52cfe8c, func = 0x411387 <_D4main17__T6fhtagnVb0Vb0Z6fhtagn6up
dateMFDFZvZv13__dgliteral87MFfZv>}) at main.d:834
#8  0x0053dec1 in _D4main17__T6fhtagnVb0Vb0Z6fhtagn6updateMFDFZvZv (
---Type <return> to continue, or q <return> to quit---
     this=@0x1da1880, redraw=
       {object = 0x1df2a80, func = 0x40b912 <_D4main14user_interface7refreshMFZv>
}) at main.d:535
#9  0x00538579 in _D3std4bind101__T9BoundFuncTDFDFZvZvS41_D3std4bind9NullAliasS3
std4bind9EmptySlotTS3std4bind15__T5TupleTDFZvZ5TupleZ9BoundFunc16__T10MBoundFunc
Z4funcMFZv (this=@0x1c48d00)
     at c:/mingw/bin/../lib/gcc/mingw32/4.1.2/../../../../include/d/4.1.2/std/bin
d.d:527
#10 0x0041001d in _D4main10poolthread3runMFZi (this=@0x1de7080) at main.d:1256
#11 0x0043a75f in _D3std6thread6Thread11threadstartWPvZk at 4 (p=0x1de7080)
     at ../../../gcc-4.1.2/libphobos/std/thread.d:412
#12 0x77c3a3b0 in _libws2_32_a_iname ()
#13 0x7c80b683 in _libws2_32_a_iname ()


(gdb) f 1
#1  0x00421525 in _d_throw (obj=@0x1e17770)
     at ../../../gcc-4.1.2/libphobos/gcc/deh.d:99
99              _Unwind_SjLj_RaiseException (&exc.unwindHeader);


(gdb) i loc
exc = (OurUnwindException *) 0x1e16800


(gdb) p *exc
$1 = {handlerSwitchValue = 0, actionRecord = 0x0, languageSpecificData = 0x0,
   catchTemp = 0, landingPad = 0, obj = @0x1e17770, unwindHeader = {
     exception_class = 26844869579591239,
     exception_cleanup = 0x421495 <_gdc_cleanupException>, private_1 = 0,
     private_2 = 0}}
(gdb)

Any idea how to proceed from here? This error has me totally stumped. (if anybody wants to read the source, it's in yawr.svn.sourceforge.net/viewvc/yawr/ )
Could this be related to stack corruption/buffer overflows? The backtrace looks intact but I used to have issues with stack corruption
in connection with SDL .. I believed I had fixed these, but it is possible that errors remain. Ideas?
  -- slightly despairing, downs


More information about the D.gnu mailing list