Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug command misidentifies binary when libtool is used #207

Open
Mno-hime opened this issue Dec 4, 2019 · 0 comments
Open

debug command misidentifies binary when libtool is used #207

Mno-hime opened this issue Dec 4, 2019 · 0 comments

Comments

@Mno-hime
Copy link

Mno-hime commented Dec 4, 2019

In BIND we have unit tests run via kyua. BIND can be configured with or without libtool. When libtool in BIND is not used kyua debug ... works as intended, however when BIND (and it's tests) was configured with libtool, it seems to me that kyua debug misidentifies the actual binary (e.g. lib/dns/tests/.libs/lt-acl_test) for the libtool shell script (e.g. lib/dns/tests/acl_test).

This is what I get when I run kyua debug lib/dns/tests/acl_test:main in BIND sources:

Process with PID 460414 exited with signal 11 and dumped core; attempting to gather stack trace
"/home/newman/isc/ws/bind9/lib/dns/tests/acl_test": not in executable format: file format not recognized
[New LWP 460414]
Missing separate debuginfo for the main executable file
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/e9/78b474ed3081d2c51b84e2348c8453558b896b
Core was generated by `/home/newman/isc/ws/bind9/lib/dns/tests/.libs/lt-acl_test'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000403b4a in ?? ()
#0  0x0000000000403b4a in ?? ()
#1  0x00000000004050dd in ?? ()
#2  0x00000000004036b1 in ?? ()
#3  0x0000000000403676 in ?? ()
#4  0x0000000000403666 in ?? ()
#5  0x0000000000000000 in ?? ()
GDB exited successfully
Files left in work directory after failure: core.460414
lib/dns/tests/acl_test:main  ->  broken: Received signal 11

The backtrace is useless.

The backtrace is the same as if I run GDB agains the libtool script:

$ gdb --batch -ex backtrace --core=./core.460550 -- lib/dns/tests/acl_test
"/home/newman/isc/ws/bind9/lib/dns/tests/acl_test": not in executable format: file format not recognized
[New LWP 460550]
Missing separate debuginfo for the main executable file
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/e9/78b474ed3081d2c51b84e2348c8453558b896b
Core was generated by `/home/newman/isc/ws/bind9/lib/dns/tests/.libs/lt-acl_test'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000403b4a in ?? ()
#0  0x0000000000403b4a in ?? ()
#1  0x00000000004050dd in ?? ()
#2  0x00000000004036b1 in ?? ()
#3  0x0000000000403676 in ?? ()
#4  0x0000000000403666 in ?? ()
#5  0x0000000000000000 in ?? ()

When I replace the libtool script with the actual binary I get a nice backtrace:

$ gdb --batch -ex backtrace --core=./core.460550 -- lib/dns/tests/.libs/lt-acl_test
[New LWP 460550]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/home/newman/isc/ws/bind9/lib/dns/tests/.libs/lt-acl_test'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  main () at acl_test.c:144
144             printf("%d",*p);
#0  main () at acl_test.c:144

(I think it's even better to run GDB via libtool: ./libtool --mode=execute gdb --batch -ex backtrace --core=./core.460550 -- lib/dns/tests/.libs/lt-acl_test.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant