This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/81968] [8 regression] early lto debug objects make Solaris ld SEGV
- From: "ro at CeBiTec dot Uni-Bielefeld.DE" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Jan 2018 10:35:53 +0000
- Subject: [Bug lto/81968] [8 regression] early lto debug objects make Solaris ld SEGV
- Auto-submitted: auto-generated
- References: <bug-81968-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968
--- Comment #47 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #45 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot
> Uni-Bielefeld.DE> ---
[...]
>> that should have been used as the reloc section for the new section 2.
>> I see sh_info is still 9, it should be 2. That's eventually
>> missing handling in the section removal patch.
>
> I'll try to figure this out.
Indeed. I've just attached an updated patch that does just that.
* I needed to change the signature of handle_lto_debug_sections to
realloc the new section name: while before we could just skip over the
initial .gnu.debuglto_ resp. .gnu.lto_.debug_ part, to map from
.rel.gnu.debuglto_ (or .rela and variants), it neets to copy parts of
the name.
* The patch also remaps sh_info/sh_link for SHT_REL and SHT_RELA sections.
* Besides, it gets rid of two compilation warnings:
/vol/gcc/src/hg/trunk/local/libiberty/simple-object-elf.c:1355:8: warning: ISO
C90 forbids mixed declarations and code [-Wpedantic]
char *gnu_lto = strings;
^
/vol/gcc/src/hg/trunk/local/libiberty/simple-object-elf.c:1356:24: warning:
request for implicit conversion from 'void *' to 'char *' not permitted in C++
[-Wc++-compat]
while ((gnu_lto = memchr (gnu_lto, 'g',
^
With this patch, all early-debug related failures on Solaris are gone,
except for gcc.dg/debug/pr41893-1.c at -gdwarf-2 -g3 which also exists
on Linux.
However, testing the patch on Linux produced weird results: during a
regular make check run, many LTO tests FAIL like this:
*** Error in
`/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/testsuite/g++5/../../lto-wrapper':
free(): invalid next size (normal): 0x000000000197a900 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x791fb)[0x7fe8b712c1fb]
/lib64/libc.so.6(+0x8288a)[0x7fe8b713588a]
/lib64/libc.so.6(cfree+0x4c)[0x7fe8b71392bc]
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/testsuite/g++5/../../lto-wrapper[0x472b2e]
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/testsuite/g++5/../../lto-wrapper[0x472c76]
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/testsuite/g++5/../../lto-wrapper[0x40668d]
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/testsuite/g++5/../../lto-wrapper[0x407245]
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/testsuite/g++5/../../lto-wrapper[0x404ab6]
/lib64/libc.so.6(__libc_start_main+0xf1)[0x7fe8b70d3401]
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/testsuite/g++5/../../lto-wrapper[0x404bea]
======= Memory map: ========
00400000-00501000 r-xp 00000000 08:11 24914219
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/lto-wrapper
00701000-00703000 r--p 00101000 08:11 24914219
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/lto-wrapper
00703000-00704000 rw-p 00103000 08:11 24914219
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/lto-wrapper
00704000-00706000 rw-p 00000000 00:00 0
01952000-01995000 rw-p 00000000 00:00 0 [heap]
7fe8b0000000-7fe8b0021000 rw-p 00000000 00:00 0
7fe8b0021000-7fe8b4000000 ---p 00000000 00:00 0
7fe8b6e9b000-7fe8b6eb2000 r-xp 00000000 08:11 24911852
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/libgcc_s.so.1
7fe8b6eb2000-7fe8b70b1000 ---p 00017000 08:11 24911852
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/libgcc_s.so.1
7fe8b70b1000-7fe8b70b2000 r--p 00016000 08:11 24911852
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/libgcc_s.so.1
7fe8b70b2000-7fe8b70b3000 rw-p 00017000 08:11 24911852
/var/scratch/gcc/regression/trunk/4.10.10-gcc-gas-gld/build/gcc/libgcc_s.so.1
7fe8b70b3000-7fe8b7270000 r-xp 00000000 fd:00 527324
/usr/lib64/libc-2.24.so
[...]
However, when run the same test manually instead of via runtest, it just
PASSes. I haven't yet been able to figure out what's wrong.
Rainer