Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #865 (closed defect: fixed)

Opened 11 years ago

Last modified 10 years ago

Process unittest segfaults on X86-64 GDC

Reported by: larsivi Assigned to: sean
Priority: major Milestone: 0.99.8
Component: Core Functionality Version:
Keywords: gdc, unittest, x86_64 Cc:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2acd043296f0 (LWP 5328)]
_d_isbaseof2 (oc=@0x0, c=@0x82ad20, offset=@0x7fffa7596958) at cast.d:109
109             if (oc.base is c)
Current language:  auto; currently minimal
(gdb) bt
#0  _d_isbaseof2 (oc=@0x0, c=@0x82ad20, offset=@0x7fffa7596958) at cast.d:109
#1  0x00000000005b3c32 in _d_isbaseof2 (oc=@0x82ae60, c=@0x82ad20, offset=@0x7fffa7596958) at cast.d:126
#2  0x00000000005b3c32 in _d_isbaseof2 (oc=@0x82c9e0, c=@0x82ad20, offset=@0x7fffa7596958) at cast.d:126
#3  0x00000000005b3cbf in _d_dynamic_cast (o=@0x2acd043af400, c=@0x82ad20) at cast.d:90
#4  0x00000000004e0512 in _D5tango2io6Buffer6Buffer5shareFC5tango2io5model8IConduit11InputStreamkZC5tango2io5model7IBuffer7IBuffer ()
#5  0x0000000000511de4 in _D5tango4text6stream14StreamIterator22__T14StreamIteratorTaZ14StreamIterator3setMFC5tango2io5model8IConduit11InputStreamZC5tango4text6stream14StreamIterator22__T14StreamIteratorTaZ14StreamIterator ()
#6  0x0000000000511da1 in _D5tango4text6stream14StreamIterator22__T14StreamIteratorTaZ14StreamIterator5_ctorMFC5tango2io5model8IConduit11InputStreamZC5tango4text6stream14StreamIterator22__T14StreamIteratorTaZ14StreamIterator ()
#7  0x0000000000511c02 in _D5tango4text6stream12LineIterator20__T12LineIteratorTaZ12LineIterator5_ctorMFC5tango2io5model8IConduit11InputStreamZC5tango4text6stream12LineIterator20__T12LineIteratorTaZ12LineIterator ()
#8  0x000000000051f8d5 in _D5tango3sys7Process11__unittest0FZv ()
#9  0x00000000005be1f2 in _D5tango4core7Runtime18runModuleUnitTestsUZb14__foreachbody1MFKC10ModuleInfoZi ()
#10 0x00000000005b50ac in _D6object10ModuleInfo7opApplyFDFKC10ModuleInfoZiZi (dg=
      {object = 0x7fffa7596c60, func = 0x5be1e0 <_D5tango4core7Runtime18runModuleUnitTestsUZb14__foreachbody1MFKC10ModuleInfoZi>})
    at genobj.d:963
#11 0x00000000005be236 in runModuleUnitTests ()
#12 0x00000000005b4457 in runAll () at dgccmain2.d:279
#13 0x00000000005b3fbd in tryExec (dg={object = 0x7fffa7596d90, func = 0x5b4440 <runAll>}) at dgccmain2.d:228
#14 0x00000000005b438a in _d_run_main (argc=2, argv=0x7fffa7596ed8, main_func=<value optimized out>) at dgccmain2.d:287
---Type <return> to continue, or q <return> to quit---
#15 0x00002acd04000164 in __libc_start_main () from /lib/
#16 0x00000000004a1779 in _start ()


testapp.d (2.0 kB) - added by sean on 01/24/08 23:40:56.

Change History

01/24/08 23:40:56 changed by sean

  • attachment testapp.d added.

01/24/08 23:53:24 changed by sean

  • status changed from new to assigned.

I've attached a test app that will hopefully help diagnose this problem. From the stack trace, the problem originates at line 1487 of tango.sys.Process. What appears to be happening is that the operation in Buffer to cast a PipeConduit? to a Buffered is crashing. The issue there seems to be that ClassInfo?.interfaces[x].classinfo is null for some ancestor of PipeConduit? and some value of x. The program I've attached should dump all the supported interface entries and then attempt the cast operation, printing some log output. With any luck, the manual cast will fail and we'll have a case to report.

01/25/08 10:28:51 changed by larsivi

On X86_64, I get this result:

Supported interfaces:

Attempted cast:

_d_dynamic_cast(o = 0x2b51f8340e40, c = '')
oc: tango.sys.Pipe.PipeConduit
Segmentation fault

with the following stacktrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2ab45e491b00 (LWP 15875)]
0x000000000041bc03 in _D7testapp11d_isbaseof2FC9ClassInfoC9ClassInfoKmZi ()
(gdb) bt
#0  0x000000000041bc03 in _D7testapp11d_isbaseof2FC9ClassInfoC9ClassInfoKmZi ()
#1  0x000000000041be15 in _D7testapp11d_isbaseof2FC9ClassInfoC9ClassInfoKmZi ()
#2  0x000000000041be15 in _D7testapp11d_isbaseof2FC9ClassInfoC9ClassInfoKmZi ()
#3  0x000000000041bb82 in _D7testapp14d_dynamic_castFC6ObjectC9ClassInfoZC6Object ()
#4  0x000000000041bb0a in _Dmain ()
#5  0x00000000004286ce in runMain () at dgccmain2.d:272
#6  0x000000000042875d in tryExec (dg={object = 0x7fff4d015820, func = 0x4286b0 <runMain>})
    at dgccmain2.d:228
#7  0x0000000000428c40 in runAll () at dgccmain2.d:280
#8  0x000000000042875d in tryExec (dg={object = 0x7fff4d015820, func = 0x428be0 <runAll>})
    at dgccmain2.d:228
#9  0x0000000000428b2a in _d_run_main (argc=2, argv=0x7fff4d015968,
    main_func=<value optimized out>) at dgccmain2.d:287
#10 0x00002ab45e168164 in __libc_start_main () from /lib/
#11 0x000000000041b869 in _start ()

On X86 I get this (which I suppose means it is working:)

Supported interfaces:

Attempted cast:

_d_dynamic_cast(o = 0xb7d38f20, c = '')
oc: tango.sys.Pipe.PipeConduit
oc: object.Object
        result = (nil)

02/14/08 08:37:42 changed by svanleent

  • version deleted.
  • milestone changed from 0.99.5 to External Bugs.

I have posted an example of the problem on the GDC SF bugtracker. I am not sure how many times the bugtracker is visited, there appear to be a few other problems unfixed of at least a few months old. Anyway, it boils down to the interfaces section of the ClassType? object, which isn't properly filled.

This is the link of the bug:

02/14/08 08:49:48 changed by larsivi

Thanks! Although the bugzilla is more commonly used (just specify GDC). May be worth posting there too, since it then get posted to the D.gnu newsgroup.

02/17/08 20:05:19 changed by larsivi

02/20/08 21:00:00 changed by svanleent

Added test file of sean to bugzilla

02/27/08 10:17:22 changed by e-t172

I posted a patch in the Bugzilla which seems to fix the bug:

04/19/08 11:20:39 changed by larsivi

This is now fixed in GDC svn - just awaiting a release ...

12/11/08 12:54:38 changed by larsivi

  • status changed from assigned to closed.
  • resolution set to fixed.
  • milestone changed from External Bugs to 0.99.8.

Since we only support GDC > 0.24 (even if unreleased), this will be closed.