This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Error while debugging a program using debugglibc.sh
- From: Nisarg Shah <nisargshah323 at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Mon, 28 Oct 2019 16:54:28 -0500
- Subject: Error while debugging a program using debugglibc.sh
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
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***
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.
Nisarg