Lines Matching +full:thread +full:- +full:1 +full:- +full:4
8 - Nodes in the graph represent mutexes.
9 - Edge (A, B) exists if there exists some thread T where lock(A) was called
21 Since this traces all mutex lock and unlock events and all thread creation
28 For shared (read-write) mutexes, a deadlock requires a cycle in the wait
39 Tracing... Hit Ctrl-C to end.
40 ----------------
45 … here while holding Mutex M0 (main::static_mutex3 0x0000000000473c60) in Thread 357250 (lockinvers…
52 @ 000000000040673a std::thread::_Impl<std::_Bind_simple<main::{lambda()#3} ()> >::_M_run()
57 Mutex M0 (main::static_mutex3 0x0000000000473c60) previously acquired by the same Thread 357250 (lo…
64 @ 000000000040673a std::thread::_Impl<std::_Bind_simple<main::{lambda()#3} ()> >::_M_run()
69 …0000473be0) acquired here while holding Mutex M1 (0x00007fff6d738400) in Thread 357251 (lockinvers…
73 @ 0000000000402ea8 main::{lambda()#4}::operator()() const
74 @ 0000000000406b46 void std::_Bind_simple<main::{lambda()#4} ()>::_M_invoke<>(std::_Index_tuple<>)
75 @ 000000000040692d std::_Bind_simple<main::{lambda()#4} ()>::operator()()
76 @ 000000000040671c std::thread::_Impl<std::_Bind_simple<main::{lambda()#4} ()> >::_M_run()
81 Mutex M1 (0x00007fff6d738400) previously acquired by the same Thread 357251 (lockinversion) here:
85 @ 0000000000402e97 main::{lambda()#4}::operator()() const
86 @ 0000000000406b46 void std::_Bind_simple<main::{lambda()#4} ()>::_M_invoke<>(std::_Index_tuple<>)
87 @ 000000000040692d std::_Bind_simple<main::{lambda()#4} ()>::operator()()
88 @ 000000000040671c std::thread::_Impl<std::_Bind_simple<main::{lambda()#4} ()> >::_M_run()
93 …quired here while holding Mutex M2 (global_mutex1 0x0000000000473be0) in Thread 357247 (lockinvers…
97 @ 0000000000402d5f main::{lambda()#1}::operator()() const
98 @ 0000000000406c6c void std::_Bind_simple<main::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>)
99 @ 0000000000406999 std::_Bind_simple<main::{lambda()#1} ()>::operator()()
100 @ 0000000000406776 std::thread::_Impl<std::_Bind_simple<main::{lambda()#1} ()> >::_M_run()
105 Mutex M2 (global_mutex1 0x0000000000473be0) previously acquired by the same Thread 357247 (lockinve…
109 @ 0000000000402d4e main::{lambda()#1}::operator()() const
110 @ 0000000000406c6c void std::_Bind_simple<main::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>)
111 @ 0000000000406999 std::_Bind_simple<main::{lambda()#1} ()>::operator()()
112 @ 0000000000406776 std::thread::_Impl<std::_Bind_simple<main::{lambda()#1} ()> >::_M_run()
117 …quired here while holding Mutex M3 (global_mutex2 0x0000000000473c20) in Thread 357248 (lockinvers…
124 @ 0000000000406758 std::thread::_Impl<std::_Bind_simple<main::{lambda()#2} ()> >::_M_run()
129 Mutex M3 (global_mutex2 0x0000000000473c20) previously acquired by the same Thread 357248 (lockinve…
136 @ 0000000000406758 std::thread::_Impl<std::_Bind_simple<main::{lambda()#2} ()> >::_M_run()
141 Thread 357248 created by Thread 350692 (lockinversion) here:
144 @ 00007fd449658440 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)
145 @ 00000000004033ac std::thread::thread<main::{lambda()#2}>(main::{lambda()#2}&&)
150 Thread 357250 created by Thread 350692 (lockinversion) here:
153 @ 00007fd449658440 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)
154 @ 00000000004034b2 std::thread::thread<main::{lambda()#3}>(main::{lambda()#3}&&)
159 Thread 357251 created by Thread 350692 (lockinversion) here:
162 @ 00007fd449658440 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)
163 @ 00000000004035b8 std::thread::thread<main::{lambda()#4}>(main::{lambda()#4}&&)
168 Thread 357247 created by Thread 350692 (lockinversion) here:
171 @ 00007fd449658440 std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)
172 @ 00000000004032a6 std::thread::thread<main::{lambda()#1}>(main::{lambda()#1}&&)
177 This is output from a process that has a potential deadlock involving 4 mutexes
178 and 4 threads:
180 - Thread 357250 acquired M1 while holding M0 (edge M0 -> M1)
181 - Thread 357251 acquired M2 while holding M1 (edge M1 -> M2)
182 - Thread 357247 acquired M3 while holding M2 (edge M2 -> M3)
183 - Thread 357248 acquired M0 while holding M3 (edge M3 -> M0)
191 #include <thread>
204 auto t1 = std::thread([] {
210 auto t2 = std::thread([] {
216 auto t3 = std::thread([&local_mutex4] {
222 auto t4 = std::thread([&local_mutex4] {
242 # ./deadlock.py 181 --binary /usr/local/bin/lockinversion
244 Tracing... Hit Ctrl-C to end.
247 If the traced process is instantiated from a statically-linked executable,
251 https://lkml.org/lkml/2017/1/13/585), binaries that contain `:` in the path
253 to the binary, and provide the symlink name instead to the `--binary` option.
256 # ./deadlock.py 181 --binary /lib/x86_64-linux-gnu/libpthread.so.0
258 Tracing... Hit Ctrl-C to end.
261 If the traced process is instantiated from a dynamically-linked executable,
266 # ./deadlock.py 181 --dump-graph graph.json --verbose
268 Tracing... Hit Ctrl-C to end.
281 Ctrl-C. If you pass the `--verbose` flag, the program will also dump statistics
283 serialize the graph to analyze it later, you can pass the `--dump-graph FILE`
287 … ./deadlock.py 181 --lock-symbols custom_mutex1_lock,custom_mutex2_lock --unlock_symbols custom_mu…
289 Tracing... Hit Ctrl-C to end.
302 the `--lock-symbols` and `--unlock-symbols` flags to specify different mutex
303 symbols to trace. The flags take a comma-separated string of symbol names.
310 # ./deadlock.py -h
312 usage: deadlock.py [-h] [--binary BINARY] [--dump-graph DUMP_GRAPH]
313 [--verbose] [--lock-symbols LOCK_SYMBOLS]
314 [--unlock-symbols UNLOCK_SYMBOLS]
324 -h, --help show this help message and exit
325 --binary BINARY If set, trace the mutexes from the binary at this
326 path. For statically-linked binaries, this argument is
327 not required. For dynamically-linked binaries, this
330 /lib/x86_64-linux-gnu/libpthread.so.0
331 --dump-graph DUMP_GRAPH
334 --verbose Print statistics about the mutex wait graph.
335 --lock-symbols LOCK_SYMBOLS
336 Comma-separated list of lock symbols to trace. Default
339 --unlock-symbols UNLOCK_SYMBOLS
340 Comma-separated list of unlock symbols to trace.
343 -t THREADS, --threads THREADS
345 default 65536. Note. 40 bytes per thread.
346 -e EDGES, --edges EDGES
353 deadlock 181 --binary /lib/x86_64-linux-gnu/libpthread.so.0
356 # a dynamically-linked binary, this argument
360 deadlock 181 --verbose
364 deadlock 181 --lock-symbols my_mutex_lock1,my_mutex_lock2 \
365 --unlock-symbols my_mutex_unlock1,my_mutex_unlock2
369 deadlock 181 --dump-graph graph.json