[Issue 10274] DMD 2.063 produces broken binaries

2013-06-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Martin Nowak c...@dawg.eu changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Jerry Quinn jlqu...@optonline.net changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED


--- Comment #31 from Jerry Quinn jlqu...@optonline.net 2013-06-20 20:35:57 
PDT ---
I confirm the fix works.  Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Martin Nowak c...@dawg.eu changed:

   What|Removed |Added

   Keywords||pull


--- Comment #27 from Martin Nowak c...@dawg.eu 2013-06-12 00:56:13 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2164

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #28 from github-bugzi...@puremagic.com 2013-06-12 16:21:51 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #29 from github-bugzi...@puremagic.com 2013-06-12 16:32:24 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #30 from github-bugzi...@puremagic.com 2013-06-12 16:33:06 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #13 from Walter Bright bugzi...@digitalmars.com 2013-06-10 
23:11:35 PDT ---
Jerry reported on the n.g. that valgrind reports an Invalid write of size 8
at:

0x00438cc8 +512:mov%r14,-0x8(%rax)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #14 from Martin Nowak c...@dawg.eu 2013-06-11 04:56:16 PDT ---
OK, let's start with a simple thing.

sha1sum /usr/lib64/libphobos2.a
40cddd5a8a9f28c000346014cbb4221a3bbd91b4  /usr/lib64/libphobos2.a

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #15 from Jerry Quinn jlqu...@optonline.net 2013-06-11 06:23:47 
PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #17 from Jerry Quinn jlqu...@optonline.net 2013-06-11 06:27:07 
PDT ---
Also, the stdio bits are a red herring.  The following also segfaults:


void main() {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #16 from Jerry Quinn jlqu...@optonline.net 2013-06-11 06:26:12 
PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #18 from Jerry Quinn jlqu...@optonline.net 2013-06-11 06:31:36 
PDT ---
Created an attachment (id=1224)
Crashing binary

cat  junk.d
void main() {
}

dmd junk.d

This is the executable junk.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #19 from Martin Nowak c...@dawg.eu 2013-06-11 07:03:15 PDT ---
OK, can you dump the linker output?
dmd junk -L--verbose

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #20 from Jerry Quinn jlqu...@optonline.net 2013-06-11 07:31:24 
PDT ---
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 

[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #21 from Martin Nowak c...@dawg.eu 2013-06-11 11:53:31 PDT ---
(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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Maxim Fomin ma...@maxim-fomin.ru changed:

   What|Removed |Added

 CC||ma...@maxim-fomin.ru


--- Comment #22 from Maxim Fomin ma...@maxim-fomin.ru 2013-06-11 12:21:59 PDT 
---
(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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #23 from Jerry Quinn jlqu...@optonline.net 2013-06-11 13:09:09 
PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #24 from Jerry Quinn jlqu...@optonline.net 2013-06-11 13:10:56 
PDT ---
Created an attachment (id=1225)
Program object file

output of dmd -c junk.d

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #25 from Martin Nowak c...@dawg.eu 2013-06-11 13:35:58 PDT ---
(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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #26 from Jerry Quinn jlqu...@optonline.net 2013-06-11 14:01:07 
PDT ---
(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$

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #7 from Jerry Quinn jlqu...@optonline.net 2013-06-09 23:20:42 PDT 
---
I pulled down a fresh copy of dmd 2.063 and I still reproduce the segfault on
my Ubuntu 12.10 x86_64 system.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #8 from Martin Nowak c...@dawg.eu 2013-06-10 07:54:40 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #9 from Jerry Quinn jlqu...@optonline.net 2013-06-10 08:20:50 PDT 
---
Program received signal SIGSEGV, Segmentation fault.
0x00438cc8 in _d_dso_registry ()
(gdb) disas
Dump of assembler code for function _d_dso_registry:
   0x00438ac8 +0:push   %rbp
   0x00438ac9 +1:mov%rsp,%rbp
   0x00438acc +4:sub$0x98,%rsp
   0x00438ad3 +11:push   %rbx
   0x00438ad4 +12:push   %r12
   0x00438ad6 +14:push   %r13
   0x00438ad8 +16:push   %r14
   0x00438ada +18:push   %r15
   0x00438adc +20:mov%rdi,%r12
   0x00438adf +23:movabs $0x1,%rax
   0x00438ae9 +33:cmp%rax,(%r12)
   0x00438aed +37:jae0x438af0 _d_dso_registry+40
   0x00438aef +39:hlt
   0x00438af0 +40:mov0x8(%r12),%rcx
   0x00438af5 +45:cmpq   $0x0,(%rcx)
   0x00438af9 +49:jne0x438cce _d_dso_registry+518
   0x00438aff +55:movabs $0x60,%rsi
   0x00438b09 +65:mov%rax,%rdi
   0x00438b0c +68:callq  0x42b9a0 calloc@plt
   0x00438b11 +73:mov%rax,%r14
   0x00438b14 +76:mov0x8(%r12),%rdx
   0x00438b19 +81:mov%r14,(%rdx)
---Type return to continue, or q return to quit---
   0x00438b1c +84:lea-0x70(%rbp),%rax
   0x00438b20 +88:xor%rcx,%rcx
   0x00438b23 +91:mov%rcx,(%rax)
   0x00438b26 +94:mov%rcx,0x8(%rax)
   0x00438b2a +98:mov%rcx,0x10(%rax)
   0x00438b2e +102:mov%rcx,0x18(%rax)
   0x00438b32 +106:mov%rcx,0x20(%rax)
   0x00438b36 +110:mov%rcx,0x28(%rax)
   0x00438b3a +114:mov0x18(%r12),%rax
   0x00438b3f +119:mov0x10(%r12),%rbx
   0x00438b44 +124:sub%rbx,%rax
   0x00438b47 +127:cqto   
   0x00438b49 +129:and$0x7,%rdx
   0x00438b50 +136:add%rdx,%rax
   0x00438b53 +139:sar$0x3,%rax
   0x00438b57 +143:mov%rbx,%rdx
   0x00438b5a +146:mov%rax,-0x70(%rbp)
   0x00438b5e +150:mov%rdx,-0x68(%rbp)
   0x00438b62 +154:lea-0x70(%rbp),%rsi
   0x00438b66 +158:lea0x10(%r14),%rdi
   0x00438b6a +162:movsq  %ds:(%rsi),%es:(%rdi)
   0x00438b6c +164:movsq  %ds:(%rsi),%es:(%rdi)
   0x00438b6e +166:movsq  %ds:(%rsi),%es:(%rdi)
---Type return to continue, or q return to quit---
   0x00438b70 +168:movsq  %ds:(%rsi),%es:(%rdi)
   0x00438b72 +170:movsq  %ds:(%rsi),%es:(%rdi)
   0x00438b74 +172:movsq  %ds:(%rsi),%es:(%rdi)
   0x00438b76 +174:mov0x28(%r12),%rcx
   0x00438b7b +179:mov0x20(%r12),%r13
   0x00438b80 +184:sub%r13,%rcx
   0x00438b83 +187:movabs $0xaaab,%rax
   0x00438b8d +197:imul   %rcx
   0x00438b90 +200:add%rcx,%rdx
   0x00438b93 +203:mov%rcx,%rax
   0x00438b96 +206:sar$0x3f,%rax
   0x00438b9a +210:sar$0x4,%rdx
   0x00438b9e +214:sub%rax,%rdx
   0x00438ba1 +217:mov%rdx,%rax
   0x00438ba4 +220:mov%r13,%rdx
   0x00438ba7 +223:mov%rax,(%r14)
   0x00438baa +226:mov%rdx,0x8(%r14)
   0x00438bae +230:mov0x8(%r12),%rsi
   0x00438bb3 +235:lea-0x40(%rbp),%rdi
   0x00438bb7 +239:callq  0x438d40
_D2rt14sections_linux18findDSOInfoForAddrFNbxPvPS4core3sys5linux4link12dl_phdr_infoZb
   0x00438bbc +244:test   %al,%al
   0x00438bbe +246:jne0x438bc1 _d_dso_registry+249
---Type return to continue, or q return to quit---
   0x00438bc0 +248:hlt
   0x00438bc1 +249:mov-0x28(%rbp),%ax
   0x00438bc5 +253:and$0x,%eax
   0x00438bca +258:mov%eax,%eax
   0x00438bcc +260:mov-0x30(%rbp),%rcx
   0x00438bd0 +264:mov%rax,-0x90(%rbp)
   0x00438bd7 +271:mov%rcx,-0x88(%rbp)
   0x00438bde +278:cmpq   $0x0,-0x90(%rbp)
   0x00438be6 +286:je 0x438c92 _d_dso_registry+458
   0x00438bec +292:mov-0x88(%rbp),%r12
   0x00438bf3 +299:mov-0x90(%rbp),%rdx
   0x00438bfa +306:imul   $0x38,%rdx,%rbx
   0x00438bfe +310:add-0x88(%rbp),%rbx
   0x00438c05 +317:mov(%r12),%esi
   0x00438c09 +321:cmp$0x1,%esi
   0x00438c0c +324:jne0x438c6f _d_dso_registry+423
   0x00438c0e +326:testl  $0x2,0x4(%r12)
   0x00438c17 +335:je 0x438c6f _d_dso_registry+423
   0x00438c19 +337:mov0x28(%r12),%rsi
   

[Issue 10274] DMD 2.063 produces broken binaries

2013-06-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #10 from Jerry Quinn jlqu...@optonline.net 2013-06-10 08:33:57 
PDT ---
I tried building dmd on my machine but irstate.h is missing from the zip file.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #11 from Martin Nowak c...@dawg.eu 2013-06-10 09:46:49 PDT ---
(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?).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #12 from Jerry Quinn jlqu...@optonline.net 2013-06-10 09:56:26 
PDT ---
(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 

[Issue 10274] DMD 2.063 produces broken binaries

2013-06-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #5 from Andrei Alexandrescu and...@erdani.com 2013-06-09 10:19:53 
PDT ---
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
importobject   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/object.di)
importstd.stdio   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/stdio.d)
importcore.stdc.stdio   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdio.d)
importcore.stdc.config   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/config.d)
importcore.stdc.stddef   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stddef.d)
importcore.stdc.stdarg   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdarg.d)
importstd.string   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/string.d)
importcore.exception   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/exception.d)
importcore.vararg   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/vararg.d)
importcore.stdc.stdlib   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/stdlib.d)
importcore.stdc.string   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/string.d)
importstd.algorithm   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/algorithm.d)
importstd.c.string   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/string.d)
importcore.bitop   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/bitop.d)
importstd.array   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/array.d)
importcore.memory   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/memory.d)
importstd.ascii   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/ascii.d)
importstd.conv   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/conv.d)
importstd.math   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/math.d)
importcore.stdc.math   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/math.d)
importstd.range   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/range.d)
importstd.exception   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/exception.d)
importstd.traits   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/traits.d)
importstd.typetuple   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/typetuple.d)
importstd.typecons   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/typecons.d)
importstd.format   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/format.d)
importstd.bitmanip   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/bitmanip.d)
importstd.system   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/system.d)
importstd.functional   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/functional.d)
importstd.utf(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/utf.d)
importcore.stdc.errno   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/errno.d)
importstd.uni(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/uni.d)
importstd.container   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/container.d)
importstd.random   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/random.d)
importstd.c.time   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/time.d)
importcore.stdc.time   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/stdc/time.d)
importstd.numeric   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/numeric.d)
importstd.c.stdlib   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/c/stdlib.d)
importstd.complex   
(/home/andrei/dmd2/linux/bin64/../../src/phobos/std/complex.d)
importcore.thread   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/thread.di)
importcore.time   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/time.d)
importcore.sys.posix.time   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/time.d)
importcore.sys.posix.config   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/config.d)
importcore.sys.posix.sys.types   
(/home/andrei/dmd2/linux/bin64/../../src/druntime/import/core/sys/posix/sys/types.d)
importcore.stdc.stdint   

[Issue 10274] DMD 2.063 produces broken binaries

2013-06-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #6 from Jerry Quinn jlqu...@optonline.net 2013-06-09 12:42:24 PDT 
---
(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?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #3 from Jerry Quinn jlqu...@optonline.net 2013-06-06 08:44:06 PDT 
---
(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 =  (0x7fff32dff000)
libpthread.so.0 = /lib/x86_64-linux-gnu/libpthread.so.0
(0x7f63b1ae3000)
librt.so.1 = /lib/x86_64-linux-gnu/librt.so.1 (0x7f63b18db000)
libc.so.6 = /lib/x86_64-linux-gnu/libc.so.6 (0x7f63b151b000)
/lib64/ld-linux-x86-64.so.2 (0x7f63b1d21000)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274



--- Comment #1 from Martin Nowak c...@dawg.eu 2013-06-05 06:22:31 PDT ---
(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?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10274] DMD 2.063 produces broken binaries

2013-06-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10274


Jerry Quinn jlqu...@optonline.net changed:

   What|Removed |Added

 CC||jlqu...@optonline.net


--- Comment #2 from Jerry Quinn jlqu...@optonline.net 2013-06-05 12:31:36 PDT 
---
*** Issue 10261 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---