there is a problem when debug glibc compiled by myself with gdb

Paul Pluzhnikov
Mon Aug 11 14:47:00 GMT 2014

On Mon, Aug 11, 2014 at 4:56 AM, Guoqiuping <> wrote:

> Would anyone can help me?

The first two commands in GDB that you'll want to use are "where" and
"info shared".

I expect that you'll discover that the crash is happening in the
dynamic loader (, and that your program loaded the system, not the /home/hksee/glibc2111/.../ (which would
explain the crash -- mismatch between and is not

> ../glibc-2.11.1/configure --prefix=/home/hksee/glibc2111 CFLAGS "-O1 -g" = CPPFLAGS "-O1 -g"
> make
> make install

This puts into /home/hksee/glibc2111/lib64 or some such.

> and then ran my test program in gdb as below, but Segmentation fault happened:
> gdb elf/
> (gdb) set exec-wrapper env LD_LIBRARY_PATH=~/glibc2111:~/glibc2111/elf

This tells the loader to look for in glibc2111 or
glibc211/elf. The latter shouldn't exist at all, and the former should
not contain, so the setting is plain wrong.

Likely you want either:



  /home/hksee/glibc2111/elf/ --library-path
/home/hksee/glibc2111/lib64 ~/tmp/testmalloc

Paul Pluzhnikov

More information about the Libc-help mailing list