This is the mail archive of the libc-help@sourceware.org mailing list for the glibc 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: Sigsegv signal while loading libc2.18


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 		 	   		



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