This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug] Between and glibc causes ld to segfault.


Wolfram Gloger said:
>
> Have you run the ld command under valgrind?

valgrind -v ld -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread -lpthread -lpthread -lpthread -lpthread -lpthread
-lpthread -lpthread==31925== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==31925== Copyright (C) 2002, and GNU GPL'd, by Julian Seward.
==31925== Using valgrind-1.9.3, a program instrumentation system for
x86-linux.==31925== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
==31925== Startup, with flags:
==31925==    --suppressions=/usr/lib/valgrind/default.supp
==31925==    -v
==31925== Reading suppressions file: /usr/lib/valgrind/default.supp
==31925== Estimated CPU clock rate is 1522 MHz
==31925==
==31925== Reading syms from /usr/i686-pc-linux-gnu/bin/ld
==31925== Reading syms from /lib/ld-2.3.1.so
==31925== Reading syms from /usr/lib/valgrind/vgskin_memcheck.so
==31925== Reading syms from /usr/lib/valgrind/valgrind.so
==31925== Reading syms from /usr/lib/libbfd-2.13.90.0.18.so
==31925== Reading syms from /lib/libdl-2.3.1.so
==31925== Reading syms from /lib/libc-2.3.1.so
==31925== Invalid write of size 4
==31925==    at 0x80515A3: new_statement (ldlang.c:525)
==31925==    by 0x8057F3C: lang_enter_group (ldlang.c:4868)
==31925==    by 0x804B429: yyparse (ldgram.y:338)
==31925==    by 0x8052D24: load_symbols (ldlang.c:1630)
==31925==    Address 0xB is not stack'd, malloc'd or free'd
Segmentation fault

And the tail of a strace is:

munmap(0x400c6000, 4096)                = 0
open("/usr/lib/libpthread.so", O_RDONLY) = 36
brk(0)                                  = 0x85c1000
brk(0x85c5000)                          = 0x85c5000
ioctl(36, SNDCTL_TMR_TIMEBASE, 0xbfffea40) = -1 ENOTTY (Inappropriate
ioctl for device)fstat64(36, {st_mode=S_IFREG|0755, st_size=216, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x400c6000read(36, "/* GNU ld script\n   Use the shar"..., 8192) = 216
read(36, "", 4096)                      = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

And most importantly, when I replace /usr/lib/libpthread.so
which is:

/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )

with a symlink to /lib/libpthread.so.0 all is ok ...

I'm finished now, I have a work around, thanks for your time

Stefan




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]