Error while debugging a program using debugglibc.sh

Carlos O'Donell carlos@redhat.com
Tue Oct 29 02:50:00 GMT 2019


On 10/28/19 5:54 PM, Nisarg Shah wrote:
> OS: Ubuntu 18.04 64-bit
> System glibc: 2.27-3ubuntu1
> New glibc: built from master branch
> 
> Hi all,
> I'm following steps from
> https://sourceware.org/glibc/wiki/Testing/Builds to install and use a
> new glibc alongside the default system installation. After building it
> and compiling a simple multithreaded program against it, when I try to
> run it under GDB using the debugglibc.sh, I get the following error -
> 
> The multithreaded program is copied from
> https://timmurphy.org/2010/05/04/pthreads-in-c-a-minimal-working-example/
> 
> Steps to compile the program -
> 
> SYSROOT=/home/<user>/glibc-master (this is where I installed glibc
> using DESTDIR env variable)
> gcc \
>   -L${SYSROOT}/usr/lib64 \
>   -I${SYSROOT}/include \
>   --sysroot=${SYSROOT} \
>   -Wl,-rpath=${SYSROOT}/lib64 \
>   -Wl,--dynamic-linker=${SYSROOT}/lib64/ld-2.18.90.so\
>   -pthread /mnt/hd/pthreads_simple.c
> 
> Steps followed to run GDB -
> 
> $ cd /mnt/hd/glibc-master-build/
> $ ./debugglibc.sh /mnt/hd/a.out

OK.

> Debugging glibc...
> Build directory  : /mnt/hd/glibc-master-build/
> Source directory : /mnt/hd/glibc
> GLIBC Testcase   : /mnt/hd/a.out
> GDB Commands     : /mnt/hd/glibc-master-build/debugglibc.gdb
> Env vars         :
> Reading symbols from /mnt/hd/glibc-master-build//elf/ld.so...done.
> /mnt/hd/glibc-master-build/debugglibc.gdb:5: Error in sourced command file:
> ***The address where /mnt/hd/a.out has been loaded is missing***

This indicates that gdb had a problem determining where a.out should be lodaed.

This isn't normal.

Where did the toolchain you are using come from? Is the gcc you are using
part of your distribution? What distribution are you using?

> I'm not sure how to resolve this. This is the first time I'm
> attempting to build/install glib. Any help would be appreciated.

Can you try this?

./debugglibc.sh ./nptl/tst-align

And see if debugging a normal glibc test case works?

-- 
Cheers,
Carlos.



More information about the Libc-help mailing list