Ubuntu 12.04 and DMD 2.060

Alex Rønne Petersen alex at lycus.org
Tue Aug 7 08:53:01 PDT 2012


On 07-08-2012 03:39, Alex Rønne Petersen wrote:
> On 07-08-2012 02:59, Alex Rønne Petersen wrote:
>> On 07-08-2012 02:12, Alex Rønne Petersen wrote:
>>> Hi,
>>>
>>> Has anyone managed to get the 2.060 .deb working on Ubuntu 12.04? On all
>>> 12.04 systems I have access to, all D programs consistently segmentation
>>> fault in gc_init().
>>>
>>
>> Seems to only occur for 64-bit binaries built with DMD. 32-bit ones work
>> fine. Also, it seems to work for people who haven't enabled the
>> precise-proposed repository.
>>
>> (And of course, it worked just fine either way in 11.10.)
>>
>
> Digging further, it appears that in src/gc/gc.d:gc_init() in druntime,
> the ClassInfo object resulting from GC.classinfo contains bogus data (or
> something). It seems to fetch the right object, but ci.init.length is 0
> and ci.init.ptr is null.
>
> Anyone have any ideas?
>

Here's GDB output FWIW:

$ gdb ./test
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/alexrp/Projects/tests/test...(no debugging 
symbols found)...done.
(gdb) run
Starting program: /home/alexrp/Projects/tests/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x000000000041a35c in gc_init ()
(gdb) bt
#0  0x000000000041a35c in gc_init ()
#1  0x00007fffffffe118 in ?? ()
#2  0x00007fffffffdf30 in ?? ()
#3  0x000000000041782e in rt.dmain2.main() ()
#4  0x00007fffffffe118 in ?? ()
#5  0x00007fffffffdf90 in ?? ()
#6  0x000000000041718e in rt.dmain2.main() ()
#7  0x0000000000000001 in ?? ()
#8  0x0000000000000020 in ?? ()
#9  0x000000000043b020 in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0x000000000043b020 in ?? ()
#12 0x00007fffffffe411 in ?? ()
#13 0x00007fffffffe030 in ?? ()
#14 0x00007fffffffe030 in ?? ()
#15 0x0000000000417820 in rt.dmain2.main() ()
#16 0x0000000000417119 in main ()
(gdb) disas
Dump of assembler code for function gc_init:
    0x000000000041a324 <+0>:	push   rbp
    0x000000000041a325 <+1>:	mov    rbp,rsp
    0x000000000041a328 <+4>:	push   rax
    0x000000000041a329 <+5>:	push   rbx
    0x000000000041a32a <+6>:	mov    rdi,QWORD PTR [rip+0x1c00b]        # 
0x43633c <_D2gc3gcx2GC7__ClassZ+4>
    0x000000000041a331 <+13>:	call   0x416650 <malloc at plt>
    0x000000000041a336 <+18>:	mov    rbx,rax
    0x000000000041a339 <+21>:	mov    rdx,QWORD PTR [rip+0x1bffc] 
# 0x43633c <_D2gc3gcx2GC7__ClassZ+4>
    0x000000000041a340 <+28>:	mov    rsi,QWORD PTR [rip+0x1bff5] 
# 0x43633c <_D2gc3gcx2GC7__ClassZ+4>
    0x000000000041a347 <+35>:	mov    rdi,rbx
    0x000000000041a34a <+38>:	call   0x416730 <memcpy at plt>
    0x000000000041a34f <+43>:	mov    QWORD PTR [rip+0x1feda],rbx 
# 0x43a230 <_D2gc2gc3_gcC2gc3gcx2GC>
    0x000000000041a356 <+50>:	mov    rdi,rbx
    0x000000000041a359 <+53>:	mov    rax,QWORD PTR [rbx]
=> 0x000000000041a35c <+56>:	rex.W call QWORD PTR [rax+0x30]
(gdb) print $rax
$1 = 0

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list