Bug 10274 – DMD 2.063 produces broken binaries

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2013-06-05T06:20:00Z
Last change time
2013-08-13T06:53:59Z
Keywords
pull
Assigned to
nobody
Creator
code

Attachments

IDFilenameSummaryContent-TypeSize
1224junk.bz2Crashing binaryapplication/octet-stream90989
1225junk.oProgram object fileapplication/octet-stream4108

Comments

Comment #0 by code — 2013-06-05T06:20:35Z
Posted at the newsgroup http://forum.dlang.org/thread/87fvwx3g8o.fsf@wyvern.i-did-not-set--mail-host-address--so-tickle-me. Hi folks, I've downloaded the current dmd 2.063 zip and tried it out. This is Ubuntu 12.10 x86_64. Every program I compile segfaults when I try to run it. As a simple example: jlquinn@wyvern:~/re/test$ cat junk.d import std.stdio; void main() { writeln("Hi"); } jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk.d jlquinn@wyvern:~/re/test$ ./junk Segmentation fault (core dumped) The gdb backtrace is somewhere in __libc_start_main, before main() is run. I assume I'm not in the majority, but I literally can't compile and run anything. Any help would be appreciated Thanks Jerry
Comment #1 by code — 2013-06-05T06:22:31Z
(In reply to comment #0) > jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk.d > jlquinn@wyvern:~/re/test$ ./junk > Segmentation fault (core dumped) Can you please post the output of "ldd -r executable"?
Comment #2 by jlquinn — 2013-06-05T12:31:36Z
*** Issue 10261 has been marked as a duplicate of this issue. ***
Comment #3 by jlquinn — 2013-06-06T08:44:06Z
(In reply to comment #1) > Can you please post the output of "ldd -r executable"? jlquinn@wyvern:~/re/test$ ldd -r junk linux-vdso.so.1 => (0x00007fff32dff000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f63b1ae3000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f63b18db000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f63b151b000) /lib64/ld-linux-x86-64.so.2 (0x00007f63b1d21000)
Comment #4 by jlquinn — 2013-06-06T08:44:57Z
Detailed compilation output: jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd -v -w junk.d binary /home/jlquinn/dmd2/linux/bin64/dmd version v2.063 config /home/jlquinn/dmd2/linux/bin64/dmd.conf parse junk importall junk import object (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/object.di) import std.stdio (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/stdio.d) import core.stdc.stdio (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdio.d) import core.stdc.config (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/config.d) import core.stdc.stddef (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stddef.d) import core.stdc.stdarg (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdarg.d) import std.string (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/string.d) import core.exception (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/exception.d) import core.vararg (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/vararg.d) import core.stdc.stdlib (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdlib.d) import core.stdc.string (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/string.d) import std.algorithm (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/algorithm.d) import std.c.string (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/c/string.d) import core.bitop (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/bitop.d) import std.array (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/array.d) import core.memory (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/memory.d) import std.ascii (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/ascii.d) import std.conv (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/conv.d) import std.math (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/math.d) import core.stdc.math (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/math.d) import std.range (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/range.d) import std.exception (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/exception.d) import std.traits (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/traits.d) import std.typetuple (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/typetuple.d) import std.typecons (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/typecons.d) import std.format (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/format.d) import std.bitmanip (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/bitmanip.d) import std.system (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/system.d) import std.functional (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/functional.d) import std.utf (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/utf.d) import core.stdc.errno (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/errno.d) import std.uni (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/uni.d) import std.container (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/container.d) import std.random (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/random.d) import std.c.time (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/c/time.d) import core.stdc.time (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/time.d) import std.numeric (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/numeric.d) import std.c.stdlib (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/c/stdlib.d) import std.complex (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/complex.d) import core.thread (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/thread.di) import core.time (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/time.d) import core.sys.posix.time (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/time.d) import core.sys.posix.config (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/config.d) import core.sys.posix.sys.types (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/types.d) import core.stdc.stdint (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdint.d) import core.stdc.signal (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/signal.d) import core.stdc.wchar_ (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/wchar_.d) import core.sys.posix.signal (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/signal.d) import core.sys.posix.sys.time (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/time.d) import core.sys.posix.sys.select (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/select.d) import core.sys.posix.unistd (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/unistd.d) import core.sys.posix.inttypes (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/inttypes.d) import core.stdc.inttypes (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/stdc/inttypes.d) import std.regex (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/regex.d) import std.internal.uni (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/internal/uni.d) import std.internal.uni_tab (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/internal/uni_tab.d) import std.c.stdio (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/c/stdio.d) import std.stdiobase (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/stdiobase.d) import core.sys.posix.stdio (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/stdio.d) import std.c.linux.linux (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/c/linux/linux.d) import std.c.linux.pthread (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/c/linux/pthread.d) import core.sys.posix.dirent (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/dirent.d) import core.sys.posix.dlfcn (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/dlfcn.d) import core.sys.posix.fcntl (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/fcntl.d) import core.sys.posix.sys.stat (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/stat.d) import core.sys.posix.pwd (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/pwd.d) import core.sys.posix.utime (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/utime.d) import core.sys.posix.sys.mman (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/mman.d) import core.sys.posix.sys.wait (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/wait.d) import std.c.linux.socket (/home/jlquinn/dmd2/linux/bin64/../../src/phobos/std/c/linux/socket.d) import core.sys.posix.arpa.inet (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/arpa/inet.d) import core.sys.posix.sys.socket (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/socket.d) import core.sys.posix.sys.uio (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/uio.d) import core.sys.posix.netdb (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/netdb.d) import core.sys.posix.netinet.in_ (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/netinet/in_.d) import core.sys.posix.netinet.tcp (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/netinet/tcp.d) semantic junk import core.sys.posix.pthread (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/pthread.d) import core.sys.posix.sched (/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sched.d) entry main junk.d semantic2 junk semantic3 junk code junk function D main function std.traits.Demangle!(uint).Demangle.__xopEquals function std.complex.Complex!(real).Complex.toString function std.complex.Complex!(real).Complex.toString.__lambda1314 function std.complex.Complex!(real).Complex.__xopEquals function std.complex.Complex!(real).Complex.opAssign!(real).opAssign function std.complex.Complex!(real).Complex.opEquals!(real).opEquals function std.stdio.writeln!(string).writeln function std.stdio.writeln!(string).writeln.__dgliteral1469 function std.exception.enforce!(bool).enforce function object.reserve!(char).reserve function std.format.formattedWrite!(void delegate(const(char)[]), char, const(real)).formattedWrite function std.format.formattedWrite!(void delegate(const(char)[]), char, const(real)).formattedWrite.__dgliteral1642 function std.format.FormatSpec!(char).FormatSpec.flDash function std.format.FormatSpec!(char).FormatSpec.flDash function std.format.FormatSpec!(char).FormatSpec.flZero function std.format.FormatSpec!(char).FormatSpec.flZero function std.format.FormatSpec!(char).FormatSpec.flSpace function std.format.FormatSpec!(char).FormatSpec.flSpace function std.format.FormatSpec!(char).FormatSpec.flPlus function std.format.FormatSpec!(char).FormatSpec.flPlus function std.format.FormatSpec!(char).FormatSpec.flHash function std.format.FormatSpec!(char).FormatSpec.flHash function std.format.FormatSpec!(char).FormatSpec.this function std.format.FormatSpec!(char).FormatSpec.fillUp function std.format.FormatSpec!(char).FormatSpec.fillUp.check function std.format.FormatSpec!(char).FormatSpec.fillUp.check.__dgliteral1530 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1629 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1630 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1636 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1641 function std.format.FormatSpec!(char).FormatSpec.getCurFmtStr function std.format.FormatSpec!(char).FormatSpec.headUpToNextSpec function std.format.FormatSpec!(char).FormatSpec.toString function std.format.FormatSpec!(char).FormatSpec.__xopEquals function std.format.formatGeneric!(void delegate(const(char)[]), const(real), char).formatGeneric function std.format.formatValue!(void delegate(const(char)[]), const(real), char).formatValue function std.format.formatValue!(void delegate(const(char)[]), const(real), char).formatValue.__dgliteral1519 function std.format.formatValue!(void delegate(const(char)[]), const(real), char).formatValue.__dgliteral1520 function std.range.put!(void delegate(const(char)[]), const(char)).put function std.array.empty!(char).empty function std.array.popFront!(immutable(char)).popFront function std.array.front!(immutable(char)).front function std.utf.decode!(string).decode function std.utf.decodeImpl!(true, string).decodeImpl function std.utf.decodeImpl!(true, string).decodeImpl.invalidUTF function std.utf.decodeImpl!(true, string).decodeImpl.outOfBounds function std.utf.decodeImpl!(true, string).decodeImpl.exception!(string).exception function std.functional.binaryFun!("a == b").binaryFun!(dchar, char).binaryFun function std.array.save!(immutable(char)).save function std.array.popBack!(immutable(char)).popBack function std.utf.strideBack!(string).strideBack function std.array.back!(immutable(char)).back function std.algorithm.find!("a == b", string, char).find function std.exception.enforceEx!(FormatException).enforceEx!(ulong).enforceEx function std.exception.enforceEx!(FormatException).enforceEx!(bool).enforceEx function std.range.put!(void delegate(const(char)[]), char[]).put function std.format.FormatSpec!(char).FormatSpec.writeUpToNextSpec!(void delegate(const(char)[])).writeUpToNextSpec function std.range.put!(void delegate(const(char)[]), const(char)[]).put function std.conv.text!(string, const(char)[]).text function std.conv.textImpl!(string, string, const(char)[]).textImpl function std.conv.to!(string).to!(string).to function std.conv.toImpl!(string, string).toImpl function std.conv.to!(string).to!(const(char)[]).to function std.conv.toImpl!(string, const(char)[]).toImpl function std.conv.to!(const(char)[]).to!(const(char)[]).to function std.conv.toImpl!(const(char)[], const(char)[]).toImpl function std.array.front!(const(char)).front function std.utf.decode!(const(char)[]).decode function std.array.popFront!(const(char)).popFront function std.utf.decodeImpl!(true, const(char)[]).decodeImpl function std.utf.decodeImpl!(true, const(char)[]).decodeImpl.invalidUTF function std.utf.decodeImpl!(true, const(char)[]).decodeImpl.outOfBounds function std.utf.decodeImpl!(true, const(char)[]).decodeImpl.exception!(const(char)[]).exception function std.conv.parse!(int, const(char)[]).parse function std.conv.convError!(const(char)[], int).convError function std.conv.convError_unexpected!(const(char)[]).convError_unexpected function std.conv.text!(string, dchar, string).text function std.conv.textImpl!(string, string, dchar, string).textImpl function std.conv.to!(string).to!(dchar).to function std.conv.toImpl!(string, dchar).toImpl function std.conv.toStr!(string, dchar).toStr function std.array.appender!(string, immutable(char)).appender function std.array.Appender!(string).Appender.Data.__xopEquals function std.array.Appender!(string).Appender.this function std.array.Appender!(string).Appender.reserve function std.array.Appender!(string).Appender.capacity function std.array.Appender!(string).Appender.data function std.array.Appender!(string).Appender.ensureAddable function std.array.Appender!(string).Appender.newCapacity function object.capacity!(immutable(char)).capacity function std.format.formatValue!(Appender!(string), dchar, char).formatValue function std.range.put!(Appender!(string), dchar).put function std.array.Appender!(string).Appender.put!(dchar).put function std.array.popFront!(char).popFront function std.array.front!(char).front function std.utf.decode!(char[]).decode function std.utf.decodeImpl!(true, char[]).decodeImpl function std.utf.decodeImpl!(true, char[]).decodeImpl.invalidUTF function std.utf.decodeImpl!(true, char[]).decodeImpl.outOfBounds function std.utf.decodeImpl!(true, char[]).decodeImpl.exception!(char[]).exception function std.array.Appender!(string).Appender.put!(char[]).put function std.format.formatValue!(Appender!(string), uint, char).formatValue function std.range.put!(Appender!(string), const(char)).put function std.array.Appender!(string).Appender.put!(const(char)).put function std.format.formatIntegral!(Appender!(string), ulong, char).formatIntegral function std.format.formatIntegral!(Appender!(string), ulong, char).formatIntegral.__dgliteral1619 function std.format.formatUnsigned!(Appender!(string), char).formatUnsigned function std.range.put!(Appender!(string), char).put function std.array.Appender!(string).Appender.put!(char).put function std.range.put!(Appender!(string), char[]).put function std.conv.text!(string, string, string).text function std.conv.textImpl!(string, string, string, string).textImpl function std.conv.parse!(uint, const(char)[]).parse function std.conv.convError!(const(char)[], uint).convError function std.algorithm.startsWith!("a == b", const(char)[], char).startsWith function std.conv.to!(ubyte).to!(const(uint)).to function std.conv.toImpl!(ubyte, const(uint)).toImpl function std.conv.parse!(ubyte, const(char)[]).parse function std.conv.convError!(const(char)[], ubyte).convError function std.conv.to!(int).to!(const(uint)).to function std.conv.toImpl!(int, const(uint)).toImpl function std.conv.toImpl!(int, const(uint)).toImpl.__dgliteral1640 function std.exception.enforce!(bool).enforce function std.format.getNthInt!(const(real)).getNthInt function std.format.getNthInt!().getNthInt function std.conv.to!(int).to!(int).to function std.conv.toImpl!(int, int).toImpl function std.format.formatNth!(void delegate(const(char)[]), char, const(real)).formatNth function std.format.formatNth!(void delegate(const(char)[]), char, const(real)).formatNth.gencode!(1LU).gencode function std.conv.to!(string).to!(ulong).to function std.conv.toImpl!(string, ulong).toImpl function std.conv.toStr!(string, ulong).toStr function std.format.formatValue!(Appender!(string), ulong, char).formatValue function std.format.formatValue!(Appender!(string), const(ubyte), char).formatValue function std.format.formatValue!(Appender!(string), const(int), char).formatValue function std.format.formatIntegral!(Appender!(string), long, char).formatIntegral function std.format.formatIntegral!(Appender!(string), long, char).formatIntegral.__dgliteral1690 function std.array.appender!(const(char)[], const(char)).appender function std.array.Appender!(const(char)[]).Appender.Data.__xopEquals function std.array.Appender!(const(char)[]).Appender.this function std.array.Appender!(const(char)[]).Appender.reserve function std.array.Appender!(const(char)[]).Appender.capacity function std.array.Appender!(const(char)[]).Appender.data function std.array.Appender!(const(char)[]).Appender.ensureAddable function std.array.Appender!(const(char)[]).Appender.newCapacity function object.capacity!(const(char)).capacity function std.array.Appender!(const(char)[]).Appender.put!(char).put function std.array.Appender!(const(char)[]).Appender.put!(dchar).put function std.array.Appender!(const(char)[]).Appender.put!(char[]).put function std.conv.text!(string, void*, string, int, string, int, string, char, string, ubyte, string, ubyte, string, bool, string, bool, string, bool, string, bool, string, bool, string, const(char)[], string, const(char)[], string).text function std.conv.textImpl!(string, string, void*, string, int, string, int, string, char, string, ubyte, string, ubyte, string, bool, string, bool, string, bool, string, bool, string, bool, string, const(char)[], string, const(char)[], string).textImpl function std.conv.to!(string).to!(void*).to function std.conv.toImpl!(string, void*).toImpl function std.conv.toStr!(string, void*).toStr function std.format.formatValue!(Appender!(string), void*, char).formatValue function std.format.formatValue!(Appender!(string), void*, char).formatValue.__dgliteral1720 function std.range.put!(Appender!(string), string).put function std.array.Appender!(string).Appender.put!(string).put function std.conv.to!(string).to!(int).to function std.conv.toImpl!(string, int).toImpl function std.conv.toStr!(string, int).toStr function std.format.formatValue!(Appender!(string), int, char).formatValue function std.conv.to!(string).to!(char).to function std.conv.toImpl!(string, char).toImpl function std.conv.toStr!(string, char).toStr function std.format.formatValue!(Appender!(string), char, char).formatValue function std.conv.to!(string).to!(ubyte).to function std.conv.toImpl!(string, ubyte).toImpl function std.conv.toStr!(string, ubyte).toStr function std.format.formatValue!(Appender!(string), ubyte, char).formatValue function std.conv.to!(string).to!(bool).to function std.conv.toImpl!(string, bool).toImpl function std.conv.toStr!(string, bool).toStr function std.format.formatValue!(Appender!(string), bool, char).formatValue gcc junk.o -o junk -m64 -L/home/jlquinn/dmd2/linux/bin64/../lib64 -L/home/jlquinn/dmd2/linux/bin64/../lib32 -Xlinker --no-warn-search-mismatch -Xlinker --export-dynamic -l:libphobos2.a -lpthread -lm -lrt jlquinn@wyvern:~/re/test$ ./junk Segmentation fault (core dumped) jlquinn@wyvern:~/re/test$
Comment #5 by andrei — 2013-06-09T10:19:53Z
I attempted to reproduce the issue as follows: 1. Downloaded Ubuntu 13.04/64 2. Installed it under VirtualBox hosted on OSX 3. In the VM, downloaded and installed 2.063 from dlang.org/download.html. 4. Created file junk.d as indicated 5. Compiled as indicated (log below) 6. Ran the resulting executable, which printed "Hi" and exited normally. This seems to be an installation issue. Jerry, could you please download again, reinstall, and recheck? Thanks! Build log: binary /home/andrei/dmd2/linux/bin64/dmd version v2.063 config /home/andrei/dmd2/linux/bin64/dmd.conf parse junk importall junk import object (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/object.di) import std.stdio (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/stdio.d) import core.stdc.stdio (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdio.d) import core.stdc.config (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/config.d) import core.stdc.stddef (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stddef.d) import core.stdc.stdarg (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdarg.d) import std.string (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/string.d) import core.exception (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/exception.d) import core.vararg (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/vararg.d) import core.stdc.stdlib (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdlib.d) import core.stdc.string (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/string.d) import std.algorithm (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/algorithm.d) import std.c.string (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/string.d) import core.bitop (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/bitop.d) import std.array (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/array.d) import core.memory (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/memory.d) import std.ascii (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/ascii.d) import std.conv (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/conv.d) import std.math (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/math.d) import core.stdc.math (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/math.d) import std.range (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/range.d) import std.exception (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/exception.d) import std.traits (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/traits.d) import std.typetuple (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/typetuple.d) import std.typecons (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/typecons.d) import std.format (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/format.d) import std.bitmanip (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/bitmanip.d) import std.system (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/system.d) import std.functional (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/functional.d) import std.utf (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/utf.d) import core.stdc.errno (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/errno.d) import std.uni (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/uni.d) import std.container (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/container.d) import std.random (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/random.d) import std.c.time (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/time.d) import core.stdc.time (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/time.d) import std.numeric (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/numeric.d) import std.c.stdlib (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/stdlib.d) import std.complex (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/complex.d) import core.thread (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/thread.di) import core.time (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/time.d) import core.sys.posix.time (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/time.d) import core.sys.posix.config (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/config.d) import core.sys.posix.sys.types (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/types.d) import core.stdc.stdint (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdint.d) import core.stdc.signal (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/signal.d) import core.stdc.wchar_ (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/wchar_.d) import core.sys.posix.signal (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/signal.d) import core.sys.posix.sys.time (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/time.d) import core.sys.posix.sys.select (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/select.d) import core.sys.posix.unistd (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/unistd.d) import core.sys.posix.inttypes (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/inttypes.d) import core.stdc.inttypes (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/inttypes.d) import std.regex (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/regex.d) import std.internal.uni (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/internal/uni.d) import std.internal.uni_tab (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/internal/uni_tab.d) import std.c.stdio (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/stdio.d) import std.stdiobase (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/stdiobase.d) import core.sys.posix.stdio (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/stdio.d) import std.c.linux.linux (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/linux/linux.d) import std.c.linux.pthread (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/linux/pthread.d) import core.sys.posix.dirent (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/dirent.d) import core.sys.posix.dlfcn (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/dlfcn.d) import core.sys.posix.fcntl (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/fcntl.d) import core.sys.posix.sys.stat (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/stat.d) import core.sys.posix.pwd (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/pwd.d) import core.sys.posix.utime (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/utime.d) import core.sys.posix.sys.mman (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/mman.d) import core.sys.posix.sys.wait (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/wait.d) import std.c.linux.socket (/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/linux/socket.d) import core.sys.posix.arpa.inet (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/arpa/inet.d) import core.sys.posix.sys.socket (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/socket.d) import core.sys.posix.sys.uio (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/uio.d) import core.sys.posix.netdb (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/netdb.d) import core.sys.posix.netinet.in_ (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/netinet/in_.d) import core.sys.posix.netinet.tcp (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/netinet/tcp.d) semantic junk import core.sys.posix.pthread (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/pthread.d) import core.sys.posix.sched (/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sched.d) entry main junk.d semantic2 junk semantic3 junk code junk function D main function std.traits.Demangle!(uint).Demangle.__xopEquals function std.complex.Complex!(real).Complex.toString function std.complex.Complex!(real).Complex.toString.__lambda1314 function std.complex.Complex!(real).Complex.__xopEquals function std.complex.Complex!(real).Complex.opAssign!(real).opAssign function std.complex.Complex!(real).Complex.opEquals!(real).opEquals function std.stdio.writeln!(string).writeln function std.stdio.writeln!(string).writeln.__dgliteral1469 function std.exception.enforce!(bool).enforce function object.reserve!(char).reserve function std.format.formattedWrite!(void delegate(const(char)[]), char, const(real)).formattedWrite function std.format.formattedWrite!(void delegate(const(char)[]), char, const(real)).formattedWrite.__dgliteral1642 function std.format.FormatSpec!(char).FormatSpec.flDash function std.format.FormatSpec!(char).FormatSpec.flDash function std.format.FormatSpec!(char).FormatSpec.flZero function std.format.FormatSpec!(char).FormatSpec.flZero function std.format.FormatSpec!(char).FormatSpec.flSpace function std.format.FormatSpec!(char).FormatSpec.flSpace function std.format.FormatSpec!(char).FormatSpec.flPlus function std.format.FormatSpec!(char).FormatSpec.flPlus function std.format.FormatSpec!(char).FormatSpec.flHash function std.format.FormatSpec!(char).FormatSpec.flHash function std.format.FormatSpec!(char).FormatSpec.this function std.format.FormatSpec!(char).FormatSpec.fillUp function std.format.FormatSpec!(char).FormatSpec.fillUp.check function std.format.FormatSpec!(char).FormatSpec.fillUp.check.__dgliteral1530 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1629 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1630 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1636 function std.format.FormatSpec!(char).FormatSpec.fillUp.__dgliteral1641 function std.format.FormatSpec!(char).FormatSpec.getCurFmtStr function std.format.FormatSpec!(char).FormatSpec.headUpToNextSpec function std.format.FormatSpec!(char).FormatSpec.toString function std.format.FormatSpec!(char).FormatSpec.__xopEquals function std.format.formatGeneric!(void delegate(const(char)[]), const(real), char).formatGeneric function std.format.formatValue!(void delegate(const(char)[]), const(real), char).formatValue function std.format.formatValue!(void delegate(const(char)[]), const(real), char).formatValue.__dgliteral1519 function std.format.formatValue!(void delegate(const(char)[]), const(real), char).formatValue.__dgliteral1520 function std.range.put!(void delegate(const(char)[]), const(char)).put function std.array.empty!(char).empty function std.array.popFront!(immutable(char)).popFront function std.array.front!(immutable(char)).front function std.utf.decode!(string).decode function std.utf.decodeImpl!(true, string).decodeImpl function std.utf.decodeImpl!(true, string).decodeImpl.invalidUTF function std.utf.decodeImpl!(true, string).decodeImpl.outOfBounds function std.utf.decodeImpl!(true, string).decodeImpl.exception!(string).exception function std.functional.binaryFun!("a == b").binaryFun!(dchar, char).binaryFun function std.array.save!(immutable(char)).save function std.array.popBack!(immutable(char)).popBack function std.utf.strideBack!(string).strideBack function std.array.back!(immutable(char)).back function std.algorithm.find!("a == b", string, char).find function std.exception.enforceEx!(FormatException).enforceEx!(ulong).enforceEx function std.exception.enforceEx!(FormatException).enforceEx!(bool).enforceEx function std.range.put!(void delegate(const(char)[]), char[]).put function std.format.FormatSpec!(char).FormatSpec.writeUpToNextSpec!(void delegate(const(char)[])).writeUpToNextSpec function std.range.put!(void delegate(const(char)[]), const(char)[]).put function std.conv.text!(string, const(char)[]).text function std.conv.textImpl!(string, string, const(char)[]).textImpl function std.conv.to!(string).to!(string).to function std.conv.toImpl!(string, string).toImpl function std.conv.to!(string).to!(const(char)[]).to function std.conv.toImpl!(string, const(char)[]).toImpl function std.conv.to!(const(char)[]).to!(const(char)[]).to function std.conv.toImpl!(const(char)[], const(char)[]).toImpl function std.array.front!(const(char)).front function std.utf.decode!(const(char)[]).decode function std.array.popFront!(const(char)).popFront function std.utf.decodeImpl!(true, const(char)[]).decodeImpl function std.utf.decodeImpl!(true, const(char)[]).decodeImpl.invalidUTF function std.utf.decodeImpl!(true, const(char)[]).decodeImpl.outOfBounds function std.utf.decodeImpl!(true, const(char)[]).decodeImpl.exception!(const(char)[]).exception function std.conv.parse!(int, const(char)[]).parse function std.conv.convError!(const(char)[], int).convError function std.conv.convError_unexpected!(const(char)[]).convError_unexpected function std.conv.text!(string, dchar, string).text function std.conv.textImpl!(string, string, dchar, string).textImpl function std.conv.to!(string).to!(dchar).to function std.conv.toImpl!(string, dchar).toImpl function std.conv.toStr!(string, dchar).toStr function std.array.appender!(string, immutable(char)).appender function std.array.Appender!(string).Appender.Data.__xopEquals function std.array.Appender!(string).Appender.this function std.array.Appender!(string).Appender.reserve function std.array.Appender!(string).Appender.capacity function std.array.Appender!(string).Appender.data function std.array.Appender!(string).Appender.ensureAddable function std.array.Appender!(string).Appender.newCapacity function object.capacity!(immutable(char)).capacity function std.format.formatValue!(Appender!(string), dchar, char).formatValue function std.range.put!(Appender!(string), dchar).put function std.array.Appender!(string).Appender.put!(dchar).put function std.array.popFront!(char).popFront function std.array.front!(char).front function std.utf.decode!(char[]).decode function std.utf.decodeImpl!(true, char[]).decodeImpl function std.utf.decodeImpl!(true, char[]).decodeImpl.invalidUTF function std.utf.decodeImpl!(true, char[]).decodeImpl.outOfBounds function std.utf.decodeImpl!(true, char[]).decodeImpl.exception!(char[]).exception function std.array.Appender!(string).Appender.put!(char[]).put function std.format.formatValue!(Appender!(string), uint, char).formatValue function std.range.put!(Appender!(string), const(char)).put function std.array.Appender!(string).Appender.put!(const(char)).put function std.format.formatIntegral!(Appender!(string), ulong, char).formatIntegral function std.format.formatIntegral!(Appender!(string), ulong, char).formatIntegral.__dgliteral1619 function std.format.formatUnsigned!(Appender!(string), char).formatUnsigned function std.range.put!(Appender!(string), char).put function std.array.Appender!(string).Appender.put!(char).put function std.range.put!(Appender!(string), char[]).put function std.conv.text!(string, string, string).text function std.conv.textImpl!(string, string, string, string).textImpl function std.conv.parse!(uint, const(char)[]).parse function std.conv.convError!(const(char)[], uint).convError function std.algorithm.startsWith!("a == b", const(char)[], char).startsWith function std.conv.to!(ubyte).to!(const(uint)).to function std.conv.toImpl!(ubyte, const(uint)).toImpl function std.conv.parse!(ubyte, const(char)[]).parse function std.conv.convError!(const(char)[], ubyte).convError function std.conv.to!(int).to!(const(uint)).to function std.conv.toImpl!(int, const(uint)).toImpl function std.conv.toImpl!(int, const(uint)).toImpl.__dgliteral1640 function std.exception.enforce!(bool).enforce function std.format.getNthInt!(const(real)).getNthInt function std.format.getNthInt!().getNthInt function std.conv.to!(int).to!(int).to function std.conv.toImpl!(int, int).toImpl function std.format.formatNth!(void delegate(const(char)[]), char, const(real)).formatNth function std.format.formatNth!(void delegate(const(char)[]), char, const(real)).formatNth.gencode!(1LU).gencode function std.conv.to!(string).to!(ulong).to function std.conv.toImpl!(string, ulong).toImpl function std.conv.toStr!(string, ulong).toStr function std.format.formatValue!(Appender!(string), ulong, char).formatValue function std.format.formatValue!(Appender!(string), const(ubyte), char).formatValue function std.format.formatValue!(Appender!(string), const(int), char).formatValue function std.format.formatIntegral!(Appender!(string), long, char).formatIntegral function std.format.formatIntegral!(Appender!(string), long, char).formatIntegral.__dgliteral1690 function std.array.appender!(const(char)[], const(char)).appender function std.array.Appender!(const(char)[]).Appender.Data.__xopEquals function std.array.Appender!(const(char)[]).Appender.this function std.array.Appender!(const(char)[]).Appender.reserve function std.array.Appender!(const(char)[]).Appender.capacity function std.array.Appender!(const(char)[]).Appender.data function std.array.Appender!(const(char)[]).Appender.ensureAddable function std.array.Appender!(const(char)[]).Appender.newCapacity function object.capacity!(const(char)).capacity function std.array.Appender!(const(char)[]).Appender.put!(char).put function std.array.Appender!(const(char)[]).Appender.put!(dchar).put function std.array.Appender!(const(char)[]).Appender.put!(char[]).put function std.conv.text!(string, void*, string, int, string, int, string, char, string, ubyte, string, ubyte, string, bool, string, bool, string, bool, string, bool, string, bool, string, const(char)[], string, const(char)[], string).text function std.conv.textImpl!(string, string, void*, string, int, string, int, string, char, string, ubyte, string, ubyte, string, bool, string, bool, string, bool, string, bool, string, bool, string, const(char)[], string, const(char)[], string).textImpl function std.conv.to!(string).to!(void*).to function std.conv.toImpl!(string, void*).toImpl function std.conv.toStr!(string, void*).toStr function std.format.formatValue!(Appender!(string), void*, char).formatValue function std.format.formatValue!(Appender!(string), void*, char).formatValue.__dgliteral1720 function std.range.put!(Appender!(string), string).put function std.array.Appender!(string).Appender.put!(string).put function std.conv.to!(string).to!(int).to function std.conv.toImpl!(string, int).toImpl function std.conv.toStr!(string, int).toStr function std.format.formatValue!(Appender!(string), int, char).formatValue function std.conv.to!(string).to!(char).to function std.conv.toImpl!(string, char).toImpl function std.conv.toStr!(string, char).toStr function std.format.formatValue!(Appender!(string), char, char).formatValue function std.conv.to!(string).to!(ubyte).to function std.conv.toImpl!(string, ubyte).toImpl function std.conv.toStr!(string, ubyte).toStr function std.format.formatValue!(Appender!(string), ubyte, char).formatValue function std.conv.to!(string).to!(bool).to function std.conv.toImpl!(string, bool).toImpl function std.conv.toStr!(string, bool).toStr function std.format.formatValue!(Appender!(string), bool, char).formatValue gcc junk.o -o junk -m64 -L/home/andrei/dmd2/linux/bin64/../lib64 -L/home/andrei/dmd2/linux/bin64/../lib32 -Xlinker --no-warn-search-mismatch -Xlinker --export-dynamic -l:libphobos2.a -lpthread -lm -lrt
Comment #6 by jlquinn — 2013-06-09T12:42:24Z
(In reply to comment #5) > I attempted to reproduce the issue as follows: > > 1. Downloaded Ubuntu 13.04/64 > > 2. Installed it under VirtualBox hosted on OSX > > 3. In the VM, downloaded and installed 2.063 from dlang.org/download.html. > > 4. Created file junk.d as indicated > > 5. Compiled as indicated (log below) > > 6. Ran the resulting executable, which printed "Hi" and exited normally. > > This seems to be an installation issue. Jerry, could you please download again, > reinstall, and recheck? Thanks! I just pulled down a fresh copy onto my Debian testing x86_64 box and tried it there. Same issue - segfault. I'll repeat on my Ubuntu system but expect the same result. Is there a way we can compare .s files or other intermediate product? Unless there's code in the compiler that says if (user == "jlquinn") { insert segfault; } :-) Would swapping binaries be useful?
Comment #7 by jlquinn — 2013-06-09T23:20:42Z
I pulled down a fresh copy of dmd 2.063 and I still reproduce the segfault on my Ubuntu 12.10 x86_64 system.
Comment #8 by code — 2013-06-10T07:54:40Z
I tried Ubuntu 12.04, Ubuntu 12.10 and Debian in VirtualBox and couldn't reproduce it either. It would be helpful to know more about where it crashes. Can you gdb into the core dump and print the disassemble and backtrace. To enable core dumps use "ulimit -c unlimited" To disable them again "ulimit -c 0" Run the binary to produce a core dump. "./junk" Run gdb and get more information. "gdb junk core.<PID>" "(gdb) disas" "(gdb) bt"
Comment #9 by jlquinn — 2013-06-10T08:20:50Z
Program received signal SIGSEGV, Segmentation fault. 0x0000000000438cc8 in _d_dso_registry () (gdb) disas Dump of assembler code for function _d_dso_registry: 0x0000000000438ac8 <+0>: push %rbp 0x0000000000438ac9 <+1>: mov %rsp,%rbp 0x0000000000438acc <+4>: sub $0x98,%rsp 0x0000000000438ad3 <+11>: push %rbx 0x0000000000438ad4 <+12>: push %r12 0x0000000000438ad6 <+14>: push %r13 0x0000000000438ad8 <+16>: push %r14 0x0000000000438ada <+18>: push %r15 0x0000000000438adc <+20>: mov %rdi,%r12 0x0000000000438adf <+23>: movabs $0x1,%rax 0x0000000000438ae9 <+33>: cmp %rax,(%r12) 0x0000000000438aed <+37>: jae 0x438af0 <_d_dso_registry+40> 0x0000000000438aef <+39>: hlt 0x0000000000438af0 <+40>: mov 0x8(%r12),%rcx 0x0000000000438af5 <+45>: cmpq $0x0,(%rcx) 0x0000000000438af9 <+49>: jne 0x438cce <_d_dso_registry+518> 0x0000000000438aff <+55>: movabs $0x60,%rsi 0x0000000000438b09 <+65>: mov %rax,%rdi 0x0000000000438b0c <+68>: callq 0x42b9a0 <calloc@plt> 0x0000000000438b11 <+73>: mov %rax,%r14 0x0000000000438b14 <+76>: mov 0x8(%r12),%rdx 0x0000000000438b19 <+81>: mov %r14,(%rdx) ---Type <return> to continue, or q <return> to quit--- 0x0000000000438b1c <+84>: lea -0x70(%rbp),%rax 0x0000000000438b20 <+88>: xor %rcx,%rcx 0x0000000000438b23 <+91>: mov %rcx,(%rax) 0x0000000000438b26 <+94>: mov %rcx,0x8(%rax) 0x0000000000438b2a <+98>: mov %rcx,0x10(%rax) 0x0000000000438b2e <+102>: mov %rcx,0x18(%rax) 0x0000000000438b32 <+106>: mov %rcx,0x20(%rax) 0x0000000000438b36 <+110>: mov %rcx,0x28(%rax) 0x0000000000438b3a <+114>: mov 0x18(%r12),%rax 0x0000000000438b3f <+119>: mov 0x10(%r12),%rbx 0x0000000000438b44 <+124>: sub %rbx,%rax 0x0000000000438b47 <+127>: cqto 0x0000000000438b49 <+129>: and $0x7,%rdx 0x0000000000438b50 <+136>: add %rdx,%rax 0x0000000000438b53 <+139>: sar $0x3,%rax 0x0000000000438b57 <+143>: mov %rbx,%rdx 0x0000000000438b5a <+146>: mov %rax,-0x70(%rbp) 0x0000000000438b5e <+150>: mov %rdx,-0x68(%rbp) 0x0000000000438b62 <+154>: lea -0x70(%rbp),%rsi 0x0000000000438b66 <+158>: lea 0x10(%r14),%rdi 0x0000000000438b6a <+162>: movsq %ds:(%rsi),%es:(%rdi) 0x0000000000438b6c <+164>: movsq %ds:(%rsi),%es:(%rdi) 0x0000000000438b6e <+166>: movsq %ds:(%rsi),%es:(%rdi) ---Type <return> to continue, or q <return> to quit--- 0x0000000000438b70 <+168>: movsq %ds:(%rsi),%es:(%rdi) 0x0000000000438b72 <+170>: movsq %ds:(%rsi),%es:(%rdi) 0x0000000000438b74 <+172>: movsq %ds:(%rsi),%es:(%rdi) 0x0000000000438b76 <+174>: mov 0x28(%r12),%rcx 0x0000000000438b7b <+179>: mov 0x20(%r12),%r13 0x0000000000438b80 <+184>: sub %r13,%rcx 0x0000000000438b83 <+187>: movabs $0xaaaaaaaaaaaaaaab,%rax 0x0000000000438b8d <+197>: imul %rcx 0x0000000000438b90 <+200>: add %rcx,%rdx 0x0000000000438b93 <+203>: mov %rcx,%rax 0x0000000000438b96 <+206>: sar $0x3f,%rax 0x0000000000438b9a <+210>: sar $0x4,%rdx 0x0000000000438b9e <+214>: sub %rax,%rdx 0x0000000000438ba1 <+217>: mov %rdx,%rax 0x0000000000438ba4 <+220>: mov %r13,%rdx 0x0000000000438ba7 <+223>: mov %rax,(%r14) 0x0000000000438baa <+226>: mov %rdx,0x8(%r14) 0x0000000000438bae <+230>: mov 0x8(%r12),%rsi 0x0000000000438bb3 <+235>: lea -0x40(%rbp),%rdi 0x0000000000438bb7 <+239>: callq 0x438d40 <_D2rt14sections_linux18findDSOInfoForAddrFNbxPvPS4core3sys5linux4link12dl_phdr_infoZb> 0x0000000000438bbc <+244>: test %al,%al 0x0000000000438bbe <+246>: jne 0x438bc1 <_d_dso_registry+249> ---Type <return> to continue, or q <return> to quit--- 0x0000000000438bc0 <+248>: hlt 0x0000000000438bc1 <+249>: mov -0x28(%rbp),%ax 0x0000000000438bc5 <+253>: and $0xffff,%eax 0x0000000000438bca <+258>: mov %eax,%eax 0x0000000000438bcc <+260>: mov -0x30(%rbp),%rcx 0x0000000000438bd0 <+264>: mov %rax,-0x90(%rbp) 0x0000000000438bd7 <+271>: mov %rcx,-0x88(%rbp) 0x0000000000438bde <+278>: cmpq $0x0,-0x90(%rbp) 0x0000000000438be6 <+286>: je 0x438c92 <_d_dso_registry+458> 0x0000000000438bec <+292>: mov -0x88(%rbp),%r12 0x0000000000438bf3 <+299>: mov -0x90(%rbp),%rdx 0x0000000000438bfa <+306>: imul $0x38,%rdx,%rbx 0x0000000000438bfe <+310>: add -0x88(%rbp),%rbx 0x0000000000438c05 <+317>: mov (%r12),%esi 0x0000000000438c09 <+321>: cmp $0x1,%esi 0x0000000000438c0c <+324>: jne 0x438c6f <_d_dso_registry+423> 0x0000000000438c0e <+326>: testl $0x2,0x4(%r12) 0x0000000000438c17 <+335>: je 0x438c6f <_d_dso_registry+423> 0x0000000000438c19 <+337>: mov 0x28(%r12),%rsi 0x0000000000438c1e <+342>: mov 0x10(%r12),%rcx 0x0000000000438c23 <+347>: add -0x40(%rbp),%rcx 0x0000000000438c27 <+351>: mov %rsi,-0x80(%rbp) 0x0000000000438c2b <+355>: mov %rcx,-0x78(%rbp) ---Type <return> to continue, or q <return> to quit--- 0x0000000000438c2f <+359>: lea 0x40(%r14),%r13 0x0000000000438c33 <+363>: mov 0x0(%r13),%rsi 0x0000000000438c37 <+367>: mov 0x8(%r13),%r15 0x0000000000438c3b <+371>: inc %r15 0x0000000000438c3e <+374>: mov %r15,%rdi 0x0000000000438c41 <+377>: shl $0x4,%rdi 0x0000000000438c45 <+381>: callq 0x439040 <_D2rt4util9container8xreallocFPvmZPv> 0x0000000000438c4a <+386>: mov %rax,0x0(%r13) 0x0000000000438c4e <+390>: mov %r15,0x8(%r13) 0x0000000000438c52 <+394>: mov -0x78(%rbp),%rdx 0x0000000000438c56 <+398>: mov -0x80(%rbp),%rax 0x0000000000438c5a <+402>: mov %r15,%r8 0x0000000000438c5d <+405>: shl $0x4,%r8 0x0000000000438c61 <+409>: add 0x0(%r13),%r8 0x0000000000438c65 <+413>: mov %rax,-0x10(%r8) 0x0000000000438c69 <+417>: mov %rdx,-0x8(%r8) 0x0000000000438c6d <+421>: jmp 0x438c85 <_d_dso_registry+445> 0x0000000000438c6f <+423>: cmp $0x7,%esi 0x0000000000438c72 <+426>: jne 0x438c85 <_d_dso_registry+445> 0x0000000000438c74 <+428>: mov -0x10(%rbp),%rdi 0x0000000000438c78 <+432>: mov %rdi,0x50(%r14) 0x0000000000438c7c <+436>: mov 0x28(%r12),%rax ---Type <return> to continue, or q <return> to quit--- 0x0000000000438c81 <+441>: mov %rax,0x58(%r14) 0x0000000000438c85 <+445>: add $0x38,%r12 0x0000000000438c89 <+449>: cmp %rbx,%r12 0x0000000000438c8c <+452>: jb 0x438c05 <_d_dso_registry+317> 0x0000000000438c92 <+458>: mov 0x48f37(%rip),%rsi # 0x481bd0 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array> 0x0000000000438c99 <+465>: mov 0x48f34(%rip),%rbx # 0x481bd4 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array+4> 0x0000000000438ca0 <+472>: inc %rbx 0x0000000000438ca3 <+475>: mov %rbx,%rdi 0x0000000000438ca6 <+478>: shl $0x3,%rdi 0x0000000000438caa <+482>: callq 0x439040 <_D2rt4util9container8xreallocFPvmZPv> 0x0000000000438caf <+487>: mov %rax,0x48f1a(%rip) # 0x481bd0 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array> 0x0000000000438cb6 <+494>: mov %rbx,0x48f17(%rip) # 0x481bd4 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array+4> 0x0000000000438cbd <+501>: mov 0x48f0c(%rip),%rcx # 0x481bd0 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_l---Type <return> to continue, or q <return> to quit--- inux3DSOZ5Array> 0x0000000000438cc4 <+508>: lea (%rcx,%rbx,8),%rax => 0x0000000000438cc8 <+512>: mov %r14,-0x8(%rax) 0x0000000000438ccc <+516>: jmp 0x438d31 <_d_dso_registry+617> 0x0000000000438cce <+518>: mov 0x8(%r12),%rdx 0x0000000000438cd3 <+523>: mov (%rdx),%rbx 0x0000000000438cd6 <+526>: mov 0x48ef3(%rip),%rsi # 0x481bd0 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array> 0x0000000000438cdd <+533>: mov 0x48ef0(%rip),%r14 # 0x481bd4 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array+4> 0x0000000000438ce4 <+540>: dec %r14 0x0000000000438ce7 <+543>: mov %r14,%rdi 0x0000000000438cea <+546>: shl $0x3,%rdi 0x0000000000438cee <+550>: callq 0x439040 <_D2rt4util9container8xreallocFPvmZPv> 0x0000000000438cf3 <+555>: mov %rax,0x48ed6(%rip) # 0x481bd0 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array> 0x0000000000438cfa <+562>: mov %r14,0x48ed3(%rip) # 0x481bd4 <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array+4> ---Type <return> to continue, or q <return> to quit--- 0x0000000000438d01 <+569>: mov 0x8(%r12),%rcx 0x0000000000438d06 <+574>: movq $0x0,(%rcx) 0x0000000000438d0d <+581>: lea 0x40(%rbx),%r13 0x0000000000438d11 <+585>: mov 0x0(%r13),%rsi 0x0000000000438d15 <+589>: xor %rdi,%rdi 0x0000000000438d18 <+592>: callq 0x439040 <_D2rt4util9container8xreallocFPvmZPv> 0x0000000000438d1d <+597>: mov %rax,0x0(%r13) 0x0000000000438d21 <+601>: movq $0x0,0x8(%r13) 0x0000000000438d29 <+609>: mov %rbx,%rdi 0x0000000000438d2c <+612>: callq 0x42b9b0 <free@plt> 0x0000000000438d31 <+617>: pop %r15 0x0000000000438d33 <+619>: pop %r14 0x0000000000438d35 <+621>: pop %r13 0x0000000000438d37 <+623>: pop %r12 0x0000000000438d39 <+625>: pop %rbx 0x0000000000438d3a <+626>: mov %rbp,%rsp 0x0000000000438d3d <+629>: pop %rbp 0x0000000000438d3e <+630>: retq End of assembler dump. (gdb) #0 0x0000000000438cc8 in _d_dso_registry () #1 0x000000000043375f in ?? () #2 0x0000000000000001 in ?? () #3 0x000000000045a778 in TypeInfo_PS3std5array17__T8AppenderTAxaZ8Appender4Data.__init() () #4 0x00000000004586b8 in ?? () #5 0x00000000004588a8 in ?? () #6 0x0000000000458190 in ?? () #7 0x00000000004586b8 in ?? () #8 0x0000000000000040 in ?? () #9 0x000000000044fd4d in __libc_csu_init () #10 0x00007ffff7617700 in __libc_start_main (main=0x436184 <main>, argc=1, ubp_av=0x7fffffffe198, init=0x44fcf0 <__libc_csu_init>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe188) at libc-start.c:185 #11 0x000000000042bcc9 in _start () (gdb)
Comment #10 by jlquinn — 2013-06-10T08:33:57Z
I tried building dmd on my machine but irstate.h is missing from the zip file.
Comment #11 by code — 2013-06-10T09:46:49Z
(In reply to comment #10) > I tried building dmd on my machine but irstate.h is missing from the zip file. No problem, I already found something. The +4 offset is wrong it should be +8 because it's the length field of rt.util.container.Array(T) and on X86_64 the pointer before it is 8 byte. <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array+4> Also the rest of your asm slightly differs from mine. So either we're not linking against the same library or your linker rewrites code (LTO?).
Comment #12 by jlquinn — 2013-06-10T09:56:26Z
(In reply to comment #11) > (In reply to comment #10) > > I tried building dmd on my machine but irstate.h is missing from the zip file. > > No problem, I already found something. The +4 offset is wrong it should be +8 > because it's the length field of rt.util.container.Array(T) and on X86_64 the > pointer before it is 8 byte. > <_D2rt14sections_linux12_static_dsosS2rt4util9container36__T5ArrayTPS2rt14sections_linux3DSOZ5Array+4> Good, I'm glad I'm not undergoing severe hallucination :-) > Also the rest of your asm slightly differs from mine. So either we're not > linking against the same library or your linker rewrites code (LTO?). jlquinn@wyvern:~/re/test$ ldd --version ldd (Ubuntu EGLIBC 2.15-0ubuntu20.1) 2.15 Here's the strace of all files opened while compiling: jlquinn@wyvern:~/re/test$ strace -f -e open ~/dmd2/linux/bin64/dmd -g junk.d open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3 open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 open("/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3 open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 open("/home/jlquinn/dmd2/linux/bin64/dmd.conf", O_RDONLY) = 3 open("/home/jlquinn/dmd2/linux/bin64/dmd.conf", O_RDONLY) = 3 Process 22301 attached [pid 22301] open("junk.d", O_RDONLY) = 3 [pid 22301] open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 4 [pid 22300] open("/home/jlquinn/dmd2/linux/bin64/../../src/druntime/import/object.di", O_RDONLY) = 3 Process 22301 detached open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3 open("junk.o", O_WRONLY|O_CREAT|O_TRUNC, 0644) = 3 Process 22302 attached [pid 22302] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 [pid 22302] open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 [pid 22302] open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 [pid 22302] open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3 [pid 22302] open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale/en_US.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale/en_US/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale/en.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale/en.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale/en/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale-langpack/en_US/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22302] open("/usr/share/locale-langpack/en/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) Process 22303 attached Process 22302 suspended [pid 22303] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 [pid 22303] open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 [pid 22303] open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 [pid 22303] open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3 [pid 22303] open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale/en_US.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale/en_US/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale/en.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale/en.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale/en/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale-langpack/en_US/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/usr/share/locale-langpack/en/LC_MESSAGES/gcc-4.7.mo", O_RDONLY) = -1 ENOENT (No such file or directory) [pid 22303] open("/tmp/cchy5rqP.c", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 [pid 22303] open("/tmp/ccannUTm.o", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 [pid 22303] open("/tmp/ccCqnnnU.ld", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 [pid 22303] open("/tmp/ccCA2QQr.le", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 [pid 22303] open("/tmp/ccCqnnnU.ld", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 [pid 22303] open("/tmp/ccCA2QQr.le", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 5 Process 22304 attached Process 22303 suspended [pid 22304] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/usr/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o", O_RDONLY|O_CLOEXEC) = 3 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o", O_RDONLY|O_CLOEXEC) = 5 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/crtbegin.o", O_RDONLY|O_CLOEXEC) = 6 [pid 22304] open("junk.o", O_RDONLY|O_CLOEXEC) = 7 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/crtend.o", O_RDONLY|O_CLOEXEC) = 8 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.o", O_RDONLY|O_CLOEXEC) = 9 [pid 22304] open("/home/jlquinn/dmd2/linux/bin64/../lib64/libphobos2.a", O_RDONLY|O_CLOEXEC) = 10 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libpthread.so", O_RDONLY|O_CLOEXEC) = 11 [pid 22304] open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 12 [pid 22304] open("/usr/lib/x86_64-linux-gnu/libpthread_nonshared.a", O_RDONLY|O_CLOEXEC) = 13 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libm.so", O_RDONLY|O_CLOEXEC) = 14 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/librt.so", O_RDONLY|O_CLOEXEC) = 15 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a", O_RDONLY|O_CLOEXEC) = 16 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so", O_RDONLY|O_CLOEXEC) = 17 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libc.so", O_RDONLY|O_CLOEXEC) = 18 [pid 22304] open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 19 [pid 22304] open("/usr/lib/x86_64-linux-gnu/libc_nonshared.a", O_RDONLY|O_CLOEXEC) = 20 [pid 22304] open("/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", O_RDONLY|O_CLOEXEC) = 21 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a", O_RDONLY|O_CLOEXEC) = 22 [pid 22304] open("/usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so", O_RDONLY|O_CLOEXEC) = 23 [pid 22304] open("junk", O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0777) = 24 Process 22303 resumed Process 22304 detached [pid 22303] --- SIGCHLD (Child exited) @ 0 (0) --- [pid 22303] open("/tmp/ccCqnnnU.ld", O_RDONLY) = 3 [pid 22303] open("/tmp/ccCA2QQr.le", O_RDONLY) = 3 Process 22302 resumed Process 22303 detached [pid 22302] --- SIGCHLD (Child exited) @ 0 (0) --- Process 22302 detached --- SIGCHLD (Child exited) @ 0 (0) --- jlquinn@wyvern:~/re/test$
Comment #13 by bugzilla — 2013-06-10T23:11:35Z
Jerry reported on the n.g. that valgrind reports an "Invalid write of size 8" at: 0x0000000000438cc8 <+512>: mov %r14,-0x8(%rax)
Comment #14 by code — 2013-06-11T04:56:16Z
OK, let's start with a simple thing. sha1sum /usr/lib64/libphobos2.a 40cddd5a8a9f28c000346014cbb4221a3bbd91b4 /usr/lib64/libphobos2.a
Comment #15 by jlquinn — 2013-06-11T06:23:47Z
jlquinn@wyvern:~/re/test$ sha1sum /home/jlquinn/dmd2/linux/lib64/libphobos2.* 40cddd5a8a9f28c000346014cbb4221a3bbd91b4 /home/jlquinn/dmd2/linux/lib64/libphobos2.a 8494571c0d7487e75345ab0c979530667626fdda /home/jlquinn/dmd2/linux/lib64/libphobos2.so jlquinn@wyvern:~/re/test$ sha1sum /home/jlquinn/dmd2/linux/bin64/dmd 8cdb0c1903774d12a8593dc2ecc2d260b9c02bcd /home/jlquinn/dmd2/linux/bin64/dmd
Comment #16 by jlquinn — 2013-06-11T06:26:12Z
Additional data - the following gives me a working program: dmd -c junk.d copy junk.o libphobos2.a to centos6.4 x86_64 machine on centos6.4, link using gcc link line given by dmd -v junk.d
Comment #17 by jlquinn — 2013-06-11T06:27:07Z
Also, the stdio bits are a red herring. The following also segfaults: void main() {}
Comment #18 by jlquinn — 2013-06-11T06:31:36Z
Created attachment 1224 Crashing binary cat > junk.d void main() { } dmd junk.d This is the executable junk.
Comment #19 by code — 2013-06-11T07:03:15Z
OK, can you dump the linker output? dmd junk -L--verbose
Comment #20 by jlquinn — 2013-06-11T07:31:24Z
jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk -L--verbose /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o succeeded /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o succeeded /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbegin.o succeeded /usr/bin/ld: Attempt to open junk.o succeeded /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/crtend.o succeeded /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.o succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libphobos2.a succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libpthread.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libpthread.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libpthread.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libpthread.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libpthread.so failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libpthread.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libpthread.so succeeded /usr/bin/ld: Attempt to open /lib/x86_64-linux-gnu/libpthread.so.0 succeeded /usr/bin/ld: Attempt to open /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libm.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libm.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libm.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libm.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libm.so failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libm.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libm.so succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/librt.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/librt.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/librt.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/librt.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/librt.so failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/librt.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/librt.so succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.so failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libc.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libc.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libc.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libc.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libc.so failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libc.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libc.so succeeded /usr/bin/ld: Attempt to open /lib/x86_64-linux-gnu/libc.so.6 succeeded /usr/bin/ld: Attempt to open /usr/lib/x86_64-linux-gnu/libc_nonshared.a succeeded /usr/bin/ld: Attempt to open /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.so failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a succeeded /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib64/libgcc_s.a failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.so failed /usr/bin/ld: Attempt to open /home/jlquinn/dmd2/linux/bin64/../lib32/libgcc_s.a failed /usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so succeeded
Comment #21 by code — 2013-06-11T11:53:31Z
(In reply to comment #20) > jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk -L--verbose Please with the linker version and the linker script.
Comment #22 by maxim — 2013-06-11T12:21:59Z
(In reply to comment #18) > Created an attachment (id=1224) [details] > Crashing binary > > cat > junk.d > void main() { > } > > dmd junk.d > > This is the executable junk. Object file (dmd -c) would be helpful too.
Comment #23 by jlquinn — 2013-06-11T13:09:09Z
I assume this is the linker script generated by dmd -v: gcc junk.o -o junk -m64 -Xlinker --verbose -L/home/jlquinn/dmd2/linux/bin64/../lib64 -L/home/jlquinn/dmd2/linux/bin64/../lib32 -Xlinker --no-warn-search-mismatch -Xlinker --export-dynamic -l:libphobos2.a -lpthread -lm -lrt jlquinn@wyvern:~/re/test$ ldd --version ldd (Ubuntu EGLIBC 2.15-0ubuntu20.1) 2.15 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.
Comment #24 by jlquinn — 2013-06-11T13:10:56Z
Created attachment 1225 Program object file output of dmd -c junk.d
Comment #25 by code — 2013-06-11T13:35:58Z
(In reply to comment #23) > I assume this is the linker script generated by dmd -v: > No, it's part of the output when you pass --verbose to the linker. When I compile dmd junk -L--verbose the linker output should contain them. On my machine this looks like this. GNU ld version 2.23.51.0.1-3.fc18 20120806 ... using internal linker script: ================================================== ... ================================================== attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o succeeded ... > jlquinn@wyvern:~/re/test$ ldd --version The linker is usually called ld, ldd is a different tool.
Comment #26 by jlquinn — 2013-06-11T14:01:07Z
(In reply to comment #25) > (In reply to comment #23) > > I assume this is the linker script generated by dmd -v: > > > No, it's part of the output when you pass --verbose to the linker. > When I compile dmd junk -L--verbose the linker output should contain them. > > On my machine this looks like this. > > > GNU ld version 2.23.51.0.1-3.fc18 20120806 > ... > using internal linker script: > ================================================== > ... > ================================================== > attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o > succeeded > ... > > > jlquinn@wyvern:~/re/test$ ldd --version > The linker is usually called ld, ldd is a different tool. oops: jlquinn@wyvern:~/re/test$ ld --version GNU gold (GNU Binutils for Ubuntu 2.22.90.20120924) 1.11 Copyright 2011 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. OK, apparently it's a difference between gnu ld and gold. There doesn't seem to be a linker script. -L--verbose doesn't dump the script for gold: jlquinn@wyvern:~/re/test$ /home/jlquinn/dmd2/linux/bin64/dmd junk.d -L--debug=script /usr/bin/ld: Dumping linker script jlquinn@wyvern:~/re/test$
Comment #27 by code — 2013-06-12T00:56:13Z
Comment #28 by github-bugzilla — 2013-06-12T16:21:51Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b470799d2b250cd93953d92f101d8d5081f100a7 fix Issue 10274 - Elf64 uses only the explicit addends of a relocation. It seems like ld.bfd still adds the value at the to be relocated address, but ld.gold does not. https://github.com/D-Programming-Language/dmd/commit/bd98b631fcb98700549a2f998f1be2086ce69d41 Merge pull request #2164 from dawgfoto/fix10724 fix Issue 10274 - DMD 2.063 produces broken binaries
Comment #29 by github-bugzilla — 2013-06-12T16:32:24Z
Commit pushed to 2.063 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e123e4f3ac9daf6cca6138004727f21d42992ad1 Merge pull request #2164 from dawgfoto/fix10724 fix Issue 10274 - DMD 2.063 produces broken binaries
Comment #30 by github-bugzilla — 2013-06-12T16:33:06Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/dc42b5e3bc93c54e444caf22653c4a5a7a89d968 Merge pull request #2164 from dawgfoto/fix10724 fix Issue 10274 - DMD 2.063 produces broken binaries
Comment #31 by jlquinn — 2013-06-20T20:35:57Z
I confirm the fix works. Thanks!