damziobro / gdb-automatic-deadlock-detector Goto Github PK
View Code? Open in Web Editor NEWScript adds new command to GDB which allows automatically detect C/C++ thread locking and deadlocks in GDB debugger
License: MIT License
Script adds new command to GDB which allows automatically detect C/C++ thread locking and deadlocks in GDB debugger
License: MIT License
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
__GI___poll (timeout=100, nfds=1, fds=0xbed30650) at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
custom command => blocked - command show how threads blocks themselves waiting on mutexes
Displaying blocking threads using 'blocked' command
/build/gdb-Y5K2MU/gdb-8.2.1/gdb/inline-frame.c:156: internal-error: void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion `frame_id_p (*this_id)' fail.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
This is a bug, please report it. For instructions, see:
http://www.gnu.org/software/gdb/bugs/.
/build/gdb-Y5K2MU/gdb-8.2.1/gdb/inline-frame.c:156: internal-error: void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion `frame_id_p (*this_id)' fail.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
Aborted (core dumped)
I got no useful output from the analysis:
$ gdb -x gdbcommands myexec core.1234
[New LWP 2880]
[New LWP 32369]
[New LWP 3027]
[New LWP 25174]
o o o
********************************************************************************
Displaying blocking threads using 'blocked' command
Python Exception <type 'exceptions.TypeError'> argument of type 'NoneType' is not iterable:
gdbcommands:5: Error in sourced command file:
Error occurred in Python command: argument of type 'NoneType' is not iterable
Given that NoneType is synonymous with "no data", can I assume that no deadlock was detected?
(gdb) blocked
********************************************************************************
Displaying blocking threads using 'blocked' command
Python Exception <class 'ValueError'> invalid literal for int() with base 10: '-':
Error occurred in Python: invalid literal for int() with base 10: '-'
While running
gdb -c core ./deadlockExample -x ./gdbcommands -batch
got an error that module named gdbDisplayLockedThreads not found.
Looks like the current working directory is absent in the python path.
Hi,
Thanks a lot for this great script!
Am I right that it won't work for pthread_rwlock_t?
regards
When I tried using this script I got the following error
Displaying blocking threads using 'blocked' command
Python Exception <class 'gdb.error'> No symbol "mutex" in current context.:
Error occurred in Python command: No symbol "mutex" in current context.
Is this because of my pthread library? do we have any solution for the same?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.