Bug 4795 – druntime demangler unittests fail

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-09-03T02:54:00Z
Last change time
2010-09-05T19:17:11Z
Assigned to
sean
Creator
braddr

Comments

Comment #0 by braddr — 2010-09-03T02:54:09Z
One of the tests in the dmd test suite is having an issue with the new demangle code in druntime. To reproduce, from the dmd test directory: make test_results/runnable/eh.d.out The stack trace via gdb: #0 rt.dmain2._d_setunhandled (o=0x806b898) at src/rt/arrayshort.d:64 #1 0x0805d14b in rt.deh2._d_throw (h=0x806b898) at src/rt/deh2.d:103 #2 0x0806611e in core.demangle.demangle.error (msg=578358990409302030) at src/core/cpuid.d:569 #3 0x08068c01 in core.demangle.demangle.parseSymbolName (this=0xbffff038) at src/core/demangle.d:1188 #4 0x08068c3e in core.demangle.demangle.parseQualifiedName (this=0x806311a) at src/core/demangle.d:1208 #5 0x0806600b in core.demangle.demangle (dst=0, buf=578671844417077272) at src/core/demangle.d:1226 #6 0x080638a5 in core.runtime.defaultTraceHandler.DefaultTraceInfo.opApply (this=0x2e0fc0, dg=578088651209044196) at src/core/cpuid.d:428 #7 0x0805c851 in object.Throwable.toString (this=0x2e1fc0) at src/object_.d:1170 #8 0x0805a8ec in eh.test4 () at runnable/eh.d:164 #9 0x0805ae63 in D main () at runnable/eh.d:351 #10 0x0805d5b6 in rt.dmain2.main.runMain (this=0xbffff258) at src/rt/arrayint.d:198 #11 0x0805d510 in rt.dmain2.main.tryExec (this=0xbffff258, dg=578102996399813208) at src/rt/arrayfloat.d:240 #12 0x0805d5fa in rt.dmain2.main.runAll (this=0x0) at src/core/thread.d:411 #13 0x0805d510 in rt.dmain2.main.tryExec (this=0xbffff258, dg=578103185378374232) at src/rt/arrayfloat.d:240 #14 0x0805d4b6 in rt.dmain2.main (argc=1, argv=0x1f6770) at src/rt/arrayint.d:111 (gdb) up The string in question, if gdb isn't lying to me: "_Dmain+0x27) [0x805ae63]"
Comment #1 by braddr — 2010-09-04T15:35:15Z
Rather than debugging via the dmd test suite.. the demangler fails the druntime unittests too. I just checked out a clean druntime trunk (I forgot mine has changes to call the demangler during stack trace dumping right now, so the original report might not be reproducable there. druntime$ make -f posix.mak unittest druntime$ ./unittest ./unittest(_D4core7runtime18runModuleUnitTestsUZb19unittestSegvHandlerUiPS4core3sys5posix6signal9siginfo_tPvZv+0x2c)[0x807cc08] [0xad7410] ./unittest(_d_throw+0x1b)[0x809803f] ./unittest(_D4core8demangle8demangleFAyaAaZAa5errorFAyaZv+0xe)[0x807a4da] ./unittest(_D4core8demangle8demangleFAyaAaZAa4testMFaZv+0x21)[0x807a925] ./unittest(_D4core8demangle8demangleFAyaAaZAa5matchMFaZv+0x11)[0x807a96d] ./unittest(_D4core8demangle8demangleFAyaAaZAa16parseMangledNameMFZv+0x19)[0x807c419] ./unittest(_D4core8demangle8demangleFAyaAaZAa+0x18)[0x807a404] ./unittest(_D4core8demangle11__unittest9FZv+0x50)[0x807c49c] ./unittest(_D4core8demangle9__modtestFZv+0x8)[0x807c4b8] ./unittest(_D4core7runtime18runModuleUnitTestsUZb16__foreachbody149MFKPS6object10ModuleInfoZi+0x24)[0x807cc68] ./unittest(_D6object10ModuleInfo7opApplyFMDFKPS6object10ModuleInfoZiZi+0x41)[0x807789d] ./unittest(runModuleUnitTests+0x87)[0x807cb83] ./unittest(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x20)[0x80986b4] ./unittest(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x24)[0x80985dc] ./unittest(main+0x96)[0x8098582] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0x126bd6] ./unittest[0x8074e01] Segmentation fault
Comment #2 by braddr — 2010-09-05T19:17:11Z
Fixed by Sean in druntime commits r384 and r385