Bug 676659 - [gold] Segmentation fault (core dumped) ../generated/adfiles/adlc
Summary: [gold] Segmentation fault (core dumped) ../generated/adfiles/adlc
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Omair Majid
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-10 16:03 UTC by Michal Nowak
Modified: 2013-03-08 02:11 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-01 21:37:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
make hotspot use -Wl,-export-dynamic instead of -export-dynamic (1.06 KB, patch)
2011-02-11 23:24 UTC, Omair Majid
no flags Details | Diff

Description Michal Nowak 2011-02-10 16:03:45 UTC
Description of problem:

When rebuilding java-1.6.0-openjdk-1.6.0.0-51.1.9.5.fc15 on x86_64 adlc segfaults when ld is set to gold:

[...]
g++ -m64 -Xlinker -O1 -Wl,--hash-style=both -m64 -export-dynamic -o ../generated/adfiles/adlc ../generated/adfiles/adlparse.o ../generated/adfiles/archDesc.o ../generated/adfiles/arena.o ../generated/adfiles/dfa.o ../generated/adfiles/dict2.o ../generated/adfiles/filebuff.o ../generated/adfiles/forms.o ../generated/adfiles/formsopt.o ../generated/adfiles/formssel.o ../generated/adfiles/main.o ../generated/adfiles/adlc-opcodes.o ../generated/adfiles/output_c.o ../generated/adfiles/output_h.o
/usr/bin/ld: warning: cannot find entry symbol 'xport-dynamic'
../generated/adfiles/adlc -DLINUX -D_GNU_SOURCE -DAMD64 -q -T -g -D_LP64 ../generated/adfiles/linux_x86_64.ad  \
 -c../generated/adfiles/mktmp18097/ad_x86_64.cpp -h../generated/adfiles/mktmp18097/ad_x86_64.hpp -a../generated/adfiles/mktmp18097/dfa_x86_64.cpp -v../generated/adfiles/mktmp18097/adGlobals_x86_64.hpp \
    || { rm -rf ../generated/adfiles/mktmp18097; exit 1; }
/bin/sh: line 2: 18153 Segmentation fault      (core dumped) ../generated/adfiles/adlc -DLINUX -D_GNU_SOURCE -DAMD64 -q -T -g -D_LP64 ../generated/adfiles/linux_x86_64.ad -c../generated/adfiles/mktmp18097/ad_x86_64.cpp -h../generated/adfiles/mktmp18097/ad_x86_64.hpp -a../generated/adfiles/mktmp18097/dfa_x86_64.cpp -v../generated/adfiles/mktmp18097/adGlobals_x86_64.hpp
make[7]: *** [refresh_adfiles] Error 1


From                To                  Syms Read   Shared Object Library
0x0000003993659410  0x00000039936c1c8a  No          /usr/lib64/libstdc++.so.6
0x0000003992a03ef0  0x0000003992a43a9c  No          /lib64/libm.so.6
0x0000003992202880  0x0000003992211fac  No          /lib64/libgcc_s.so.1
0x000000399121eb60  0x00000039913428cc  No          /lib64/libc.so.6
0x0000003990e00b20  0x0000003990e1929a  No          /lib64/ld-linux-x86-64.so.2
0x00007fff7d3e9600  0x00007fff7d3e9990  No          /lib/modules/2.6.38-0.rc4.git0.1.fc15.x86_64/vdso/vdso.so
No symbol "__abort_msg" in current context.
No symbol "__glib_assert_msg" in current context.
rax            0x1c     28
rbx            0x0      0
rcx            0x20     32
rdx            0x3990e0ed30     247243795760
rsi            0x7fff7d36a6b8   140735294121656
rdi            0x39910222a8     247245972136
rbp            0x0      0x0
rsp            0x7fff7d36a6b0   0x7fff7d36a6b0
r8             0x8      8
r9             0xb      11
r10            0x7fff7d36a3a0   140735294120864
r11            0x39936b91e0     247286436320
r12            0x0      0
r13            0x7fff7d36a6b0   140735294121648
r14            0x0      0
r15            0x0      0
rip            0x0      0
eflags         0x10206  [ PF IF RF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0
No function contains program counter for selected frame.



%----cmdline
../generated/adfiles/adlc -DLINUX -D_GNU_SOURCE -DAMD64 -q -T -g -D_LP64 ../generated/adfiles/linux_x86_64.ad -c../generated/adfiles/mktmp26822/ad_x86_64.cpp -h../generated/adfiles/mktmp26822/ad_x86_64.hpp -a../generated/adfiles/mktmp26822/dfa_x86_64.cpp -v../generated/adfiles/mktmp26822/adGlobals_x86_64.hpp

Comment 1 Omair Majid 2011-02-10 16:27:31 UTC
I think -export-dynamic should be --export-dynamic.

Comment 2 Omair Majid 2011-02-11 23:10:27 UTC
After some digging, this seems to be a regression in gcc.

The -export-dynamic flag is broken in gcc 4.6 [1]. gcc now treats xport-dynamic as the entry point. The standard bfd-based linker prints a warning:
/usr/bin/ld: warning: cannot find entry symbol xport-dynamic; defaulting to 00000000004013a0
Apparently this address is fine. gold, I assume does something different which causes the executable to be invalid.

The man page for gcc claims -rdynamic should be used to pass -export-dynamic, but that's a recent addition [2] and not usable when we need to work with older versions of gcc too.

What works for me is using -Wl,-export-dynamic instead of -export-dynamic.

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47390
[2] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37454

Comment 3 Omair Majid 2011-02-11 23:24:41 UTC
Created attachment 478327 [details]
make hotspot use -Wl,-export-dynamic instead of -export-dynamic

I have tested this on gcc 4.6.0 + gold and gcc 4.6.0 + ld as well as gcc 4.4.5 + ld.

Comment 4 Andrew John Hughes 2011-02-13 15:25:29 UTC
Omair, this patch just seems to remove -export-dynamic not replace it.

Comment 5 Andrew John Hughes 2011-02-13 16:03:23 UTC
It's ok, saw the full version on the list.  Looks fine, I'll include it in the upcoming releases.

Comment 6 Michal Nowak 2011-02-14 13:18:13 UTC
Thanks for the patch Omair.

Comment 7 Omair Majid 2011-02-14 15:52:28 UTC
(In reply to comment #4)
> Omair, this patch just seems to remove -export-dynamic not replace it.

Hm.. the bugzilla viewer has some issues with nested patches. The path shows up fine using "View" (https://bugzilla.redhat.com/attachment.cgi?id=478327) but looks broken everywhere else.

Comment 8 Andrew John Hughes 2011-02-15 23:10:52 UTC
In new releases: http://blog.fuseyism.com/index.php/2011/02/15/security-icedtea6-1710-187-and-197-released/

Should hit Fedora RPMs soon.

Comment 9 Omair Majid 2011-04-01 21:37:45 UTC
This fix is present in 1.10 which was built for F15: http://koji.fedoraproject.org/koji/buildinfo?buildID=235771


Note You need to log in before you can comment on or make changes to this bug.