This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Sigsegv signal while loading libc2.18
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: waseem sarwar <waseemsarwar103 at hotmail dot com>, "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Fri, 01 Nov 2013 15:02:20 -0700
- Subject: Re: Sigsegv signal while loading libc2.18
- Authentication-results: sourceware.org; auth=none
- References: <BAY168-W1288D8DFBA14230789CAA9F1F50 at phx dot gbl>
On 11/1/13 2:16 PM, waseem sarwar wrote:
Hi All,
I have a pre-compiled binary that needs glibc version 2.14 or greater but my current ubuntu 10.04 (intel x86_64 arch) has glibc version 2.11. I decided to compile glibc 2.18 from source on my platform by using the following configuration The compilation succeeds without an issue.
../glibc-2.18/configure --prefix=/root/test_waseem//gnu-c-2.18/ --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-profile --enable-kernel=2.6.32 libc_cv_forced_unwind=yes libc_cv_ctors_header=yes libc_cv_c_cleanup=yes --with-headers=/usr/include CFLAGS="-O2 -fno-stack-protector -fPIC" CXXFLAGS="-O2 -fno-stack-protector -fPIC"
Now when I try to preload the library using LD_PRELOAD and try to execute the binary, it gives segmentation fault right away.
Which library are you preloading? Presumably libc.so.6
See this explanation for why this isn't supposed to work:
http://stackoverflow.com/a/19714115/50617
What you probably want to do is "make install" in glibc build directory,
and then:
/root/test_waseem//gnu-c-2.18/lib64/ld-linux-x86-64.so.2
--library-path /root/test_waseem//gnu-c-2.18/lib64
/path/to/your/pre-compiled/executable.
I believe that its giving the seg fault at dynamic loading time as when i try to debug it with gdb, it crashed before the execution starts.
Correct.
I have tried a few different configuration params (and with different compiler flags) but nothing works. Please respond with the possible solution. Thanks in advance.
--Waseem