Hello All, I am using Strongswan 5.0.4 and see it deadlocked. All the ipsec commands that I run hang (ex: ipsec statusall). Here is the back trace of all the threads.
(gdb) thread 1 [Switching to thread 1 (Thread 0x7f7a48676700 (LWP 12216))] #0 0x00007f7a47b969f7 in do_sigwait () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b969f7 in do_sigwait () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a47b96a79 in sigwait () from /lib/x86_64-linux-gnu/libpthread.so.0 #2 0x0000000000401b2b in run () at charon.c:102 #3 main (argc=<optimized out>, argv=<optimized out>) at charon.c:434 (gdb) thread 2 [Switching to thread 2 (Thread 0x7f7a30f14700 (LWP 12233))] #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a48242620 in wait_ (mutex=0xc72810, this=<optimized out>) at threading/mutex.c:229 #2 wait_ (this=<optimized out>, mutex=0xc72810) at threading/mutex.c:217 #3 0x00007f7a47dcc4fc in wait_for_entry (entry=0x7f7a18000d90, segment=<optimized out>, this=<optimized out>) at sa/ike_sa_manager.c:711 #4 0x00007f7a47dcc5c4 in checkout (this=0xc723e0, ike_sa_id=<optimized out>) at sa/ike_sa_manager.c:1114 #5 0x00007f7a47dc39f6 in execute (this=0x7f7a18002f50) at processing/jobs/delete_ike_sa_job.c:56 #6 0x00007f7a4823f8fb in process_jobs (worker=0xc77360) at processing/processor.c:219 #7 0x00007f7a48241d30 in thread_main (this=0xc77390) at threading/thread.c:309 #8 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #9 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #10 0x0000000000000000 in ?? () (gdb) thread 3 [Switching to thread 3 (Thread 0x7f7a31715700 (LWP 12232))] #0 0x00007f7a47b922b3 in pthread_rwlock_rdlock () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b922b3 in pthread_rwlock_rdlock () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a48242cba in read_lock (this=<optimized out>) at threading/rwlock.c:120 #2 0x00007f7a47dd0160 in complete (ike_sa=0x7f7a18000a40, child_sa=0x7f7a20008720, this=<optimized out>) at sa/trap_manager.c:338 #3 0x00007f7a47dd025a in child_state_change (child_sa=<optimized out>, ike_sa=<optimized out>, listener=<optimized out>, state=<optimized out>) at sa/trap_manager.c:379 #4 child_state_change (listener=<optimized out>, ike_sa=<optimized out>, child_sa=<optimized out>, state=<optimized out>) at sa/trap_manager.c:371 #5 0x00007f7a47dad952 in child_state_change (this=0xc374b0, child_sa=0x7f7a20008720, state=CHILD_INSTALLED) at bus/bus.c:428 #6 0x00007f7a47dc5b5c in set_state (this=0x7f7a20008720, state=CHILD_INSTALLED) at sa/child_sa.c:234 #7 0x00007f7a47dd906d in select_and_install (this=0x7f7a18008e50, no_dh=<optimized out>, ike_auth=<optimized out>) at sa/ikev2/tasks/child_create.c:667 #8 0x00007f7a47dd98a1 in build_r (this=0x7f7a18008e50, message=0x7f7a20006b10) at sa/ikev2/tasks/child_create.c:1229 #9 0x00007f7a47dd3fc8 in build_response (request=0x7f7a28000c70, this=0x7f7a18001930) at sa/ikev2/task_manager_v2.c:652 #10 process_request (message=0x7f7a28000c70, this=0x7f7a18001930) at sa/ikev2/task_manager_v2.c:929 #11 process_message (msg=0x7f7a28000c70, this=0x7f7a18001930) at sa/ikev2/task_manager_v2.c:1153 #12 process_message (this=0x7f7a18001930, msg=0x7f7a28000c70) at sa/ikev2/task_manager_v2.c:1075 #13 0x00007f7a47dc94ff in process_message (this=0x7f7a18000a40, message=0x7f7a28000c70) at sa/ike_sa.c:1268 #14 0x00007f7a47dc4067 in execute (this=0x7f7a28000900) at processing/jobs/process_message_job.c:74 #15 0x00007f7a4823f8fb in process_jobs (worker=0xc77030) at processing/processor.c:219 #16 0x00007f7a48241d30 in thread_main (this=0xc77060) at threading/thread.c:309 #17 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #18 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #19 0x0000000000000000 in ?? () (gdb) thread 4 [Switching to thread 4 (Thread 0x7f7a31f16700 (LWP 12231))] #0 0x00007f7a47b922b3 in pthread_rwlock_rdlock () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b922b3 in pthread_rwlock_rdlock () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a48242cba in read_lock (this=<optimized out>) at threading/rwlock.c:120 #2 0x00007f7a47dcfa9c in acquire (this=0xc39180, reqid=3, src=0x7f7a2c001150, dst=0x7f7a2c001210) at sa/trap_manager.c:264 #3 0x00007f7a47dc3763 in execute (this=<optimized out>) at processing/jobs/acquire_job.c:59 #4 0x00007f7a4823f8fb in process_jobs (worker=0xc76d00) at processing/processor.c:219 #5 0x00007f7a48241d30 in thread_main (this=0xc76d30) at threading/thread.c:309 #6 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #7 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000000000000000 in ?? () (gdb) thread 5 [Switching to thread 5 (Thread 0x7f7a32717700 (LWP 12230))] #0 0x00007f7a47b9604d in accept () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b9604d in accept () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a39b98a2b in receive (this=0xc70f40) at stroke_socket.c:742 #2 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #3 0x00007f7a4823f8fb in process_jobs (worker=0xc769d0) at processing/processor.c:219 #4 0x00007f7a48241d30 in thread_main (this=0xc76a00) at threading/thread.c:309 #5 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #6 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #7 0x0000000000000000 in ?? () (gdb) thread 6 [Switching to thread 6 (Thread 0x7f7a32f18700 (LWP 12229))] #0 0x00007f7a47b961c3 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b961c3 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a39dad07a in recvfrom (__addr_len=0x7f7a32f17d0c, __addr=0x7f7a32f17d60, __flags=0, __n=28, __buf=0x7f7a32f17d40, __fd=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/socket2.h:77 #2 receive_arp (this=0xc67520) at farp_spoofer.c:109 #3 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #4 0x00007f7a4823f8fb in process_jobs (worker=0xc766a0) at processing/processor.c:219 #5 0x00007f7a48241d30 in thread_main (this=0xc766d0) at threading/thread.c:309 #6 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #7 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000000000000000 in ?? () (gdb) thread 7 [Switching to thread 7 (Thread 0x7f7a33719700 (LWP 12228))] #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a47dc3157 in send_packets (this=0xc66900) at network/sender.c:152 #2 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #3 0x00007f7a4823f8fb in process_jobs (worker=0xc76370) at processing/processor.c:219 #4 0x00007f7a48241d30 in thread_main (this=0xc763a0) at threading/thread.c:309 #5 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #6 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #7 0x0000000000000000 in ?? () (gdb) thread 8 [Switching to thread 8 (Thread 0x7f7a33f1a700 (LWP 12227))] #0 0x00007f7a478b5823 in select () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt #0 0x00007f7a478b5823 in select () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007f7a39fb0780 in receiver (this=0xc665f0, packet=0x7f7a33f19d68) at socket_default_socket.c:185 #2 0x00007f7a47dc3655 in receiver (this=0xc38fd0, packet=0x7f7a33f19d68) at network/socket_manager.c:71 #3 0x00007f7a47dc2437 in receive_packets (this=0xc66670) at network/receiver.c:430 #4 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #5 0x00007f7a4823f8fb in process_jobs (worker=0xc76040) at processing/processor.c:219 #6 0x00007f7a48241d30 in thread_main (this=0xc76070) at threading/thread.c:309 #7 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #8 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #9 0x0000000000000000 in ?? () (gdb) thread 9 [Switching to thread 9 (Thread 0x7f7a3471b700 (LWP 12226))] #0 0x00007f7a47b961c3 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b961c3 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a3a3bdfbf in recvfrom (__addr_len=0x7f7a3471a768, __addr=0x7f7a3471a750, __flags=0, __n=1536, __buf=0x7f7a3471a770, __fd=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/socket2.h:77 #2 receive_events (this=0xc62b50) at kernel_netlink_net.c:1070 #3 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #4 0x00007f7a4823f8fb in process_jobs (worker=0xc75d10) at processing/processor.c:219 #5 0x00007f7a48241d30 in thread_main (this=0xc75d40) at threading/thread.c:309 #6 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #7 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000000000000000 in ?? () (gdb) thread 10 [Switching to thread 10 (Thread 0x7f7a34f1c700 (LWP 12225))] #0 0x00007f7a47b961c3 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b961c3 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a3a3b9191 in recvfrom (__addr_len=0x7f7a34f1b96c, __addr=0x7f7a34f1b960, __flags=0, __n=1024, __buf=0x7f7a34f1b970, __fd=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/socket2.h:77 #2 receive_events (this=0xc62610) at kernel_netlink_ipsec.c:985 #3 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #4 0x00007f7a4823f8fb in process_jobs (worker=0xc759e0) at processing/processor.c:219 #5 0x00007f7a48241d30 in thread_main (this=0xc75a10) at threading/thread.c:309 #6 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #7 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000000000000000 in ?? () (gdb) thread 11 [Switching to thread 11 (Thread 0x7f7a3571d700 (LWP 12224))] #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a4823ffe3 in schedule (this=0xc365a0) at processing/scheduler.c:223 #2 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #3 0x00007f7a4823f8fb in process_jobs (worker=0xc756b0) at processing/processor.c:219 #4 0x00007f7a48241d30 in thread_main (this=0xc756e0) at threading/thread.c:309 #5 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #6 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #7 0x0000000000000000 in ?? () (gdb) thread 12 [Switching to thread 12 (Thread 0x7f7a35f1e700 (LWP 12223))] #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b92d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a39b98935 in handle (this=0xc70f40) at stroke_socket.c:718 #2 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #3 0x00007f7a4823f8fb in process_jobs (worker=0xc75380) at processing/processor.c:219 #4 0x00007f7a48241d30 in thread_main (this=0xc753b0) at threading/thread.c:309 #5 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #6 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #7 0x0000000000000000 in ?? () (gdb) thread 13 [Switching to thread 13 (Thread 0x7f7a3671f700 (LWP 12222))] #0 0x00007f7a47b9589c in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b9589c in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a47b91065 in _L_lock_858 () from /lib/x86_64-linux-gnu/libpthread.so.0 #2 0x00007f7a47b90eba in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0 #3 0x00007f7a4824253a in lock (this=<optimized out>) at threading/mutex.c:105 #4 0x00007f7a48242597 in lock_r (this=0xc37760) at threading/mutex.c:136 #5 0x00007f7a47dad80e in message (this=0xc374b0, message=0x7f7a28002df0, incoming=true, plain=false) at bus/bus.c:450 #6 0x00007f7a47dd36e0 in process_message (this=0x7f7a18005760, msg=0x7f7a28002df0) at sa/ikev2/task_manager_v2.c:1082 #7 0x00007f7a47dc94ff in process_message (this=0x7f7a18001d30, message=0x7f7a28002df0) at sa/ike_sa.c:1268 #8 0x00007f7a47dc4067 in execute (this=0x7f7a28000b50) at processing/jobs/process_message_job.c:74 #9 0x00007f7a4823f8fb in process_jobs (worker=0xc75050) at processing/processor.c:219 #10 0x00007f7a48241d30 in thread_main (this=0xc75080) at threading/thread.c:309 #11 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #12 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #13 0x0000000000000000 in ?? () (gdb) thread 14 [Switching to thread 14 (Thread 0x7f7a36f20700 (LWP 12221))] #0 0x00007f7a47b9589c in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b9589c in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a47b91065 in _L_lock_858 () from /lib/x86_64-linux-gnu/libpthread.so.0 #2 0x00007f7a47b90eba in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0 #3 0x00007f7a4824253a in lock (this=<optimized out>) at threading/mutex.c:105 #4 0x00007f7a48242597 in lock_r (this=0xc37760) at threading/mutex.c:136 #5 0x00007f7a47dad903 in child_state_change (this=0xc374b0, child_sa=0x7f7a280019b0, state=CHILD_ROUTED) at bus/bus.c:419 #6 0x00007f7a47dc6aa4 in set_state (state=CHILD_ROUTED, this=0x7f7a280019b0) at sa/child_sa.c:234 #7 add_policies (this=0x7f7a280019b0, my_ts_list=<optimized out>, other_ts_list=<optimized out>) at sa/child_sa.c:834 #8 0x00007f7a47dcff99 in install (this=0xc39180, peer=0xc7abd0, child=0xc777a0) at sa/trap_manager.c:167 #9 0x00007f7a39b9c3c4 in charon_route (peer_cfg=0xc7abd0, child_cfg=0xc777a0, name=0x7f7a36f1fd18 "remote-40.0.0.2", out=0x7f7a280014b0) at stroke_control.c:606 #10 0x00007f7a39b9c4eb in route (this=<optimized out>, msg=0x7f7a36f1faa0, out=0x7f7a280014b0) at stroke_control.c:672 #11 0x00007f7a39b99421 in stroke_route (out=0x7f7a280014b0, msg=0x7f7a36f1faa0, this=<optimized out>) at stroke_socket.c:324 #12 process (ctx=0x7f7a14000900) at stroke_socket.c:628 #13 0x00007f7a4823f0be in execute (this=<optimized out>) at processing/jobs/callback_job.c:77 #14 0x00007f7a4823f8fb in process_jobs (worker=0xc74d20) at processing/processor.c:219 #15 0x00007f7a48241d30 in thread_main (this=0xc74d50) at threading/thread.c:309 #16 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #17 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #18 0x0000000000000000 in ?? () (gdb) thread 15 [Switching to thread 15 (Thread 0x7f7a37721700 (LWP 12220))] #0 0x00007f7a47b922b3 in pthread_rwlock_rdlock () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b922b3 in pthread_rwlock_rdlock () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a48242cba in read_lock (this=<optimized out>) at threading/rwlock.c:120 #2 0x00007f7a47dcfa9c in acquire (this=0xc39180, reqid=3, src=0x7f7a2c0012d0, dst=0x7f7a2c001390) at sa/trap_manager.c:264 #3 0x00007f7a47dc3763 in execute (this=<optimized out>) at processing/jobs/acquire_job.c:59 #4 0x00007f7a4823f8fb in process_jobs (worker=0xc74780) at processing/processor.c:219 #5 0x00007f7a48241d30 in thread_main (this=0xc74a70) at threading/thread.c:309 #6 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #7 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000000000000000 in ?? () (gdb) thread 16 [Switching to thread 16 (Thread 0x7f7a37f22700 (LWP 12219))] #0 0x00007f7a47b9589c in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0 (gdb) bt #0 0x00007f7a47b9589c in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f7a47b91065 in _L_lock_858 () from /lib/x86_64-linux-gnu/libpthread.so.0 #2 0x00007f7a47b90eba in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0 #3 0x00007f7a4824253a in lock (this=<optimized out>) at threading/mutex.c:105 #4 0x00007f7a48242597 in lock_r (this=0xc37760) at threading/mutex.c:136 #5 0x00007f7a47dad80e in message (this=0xc374b0, message=0x7f7a28003690, incoming=true, plain=false) at bus/bus.c:450 #6 0x00007f7a47dd36e0 in process_message (this=0x7f7a24001e90, msg=0x7f7a28003690) at sa/ikev2/task_manager_v2.c:1082 #7 0x00007f7a47dc94ff in process_message (this=0x7f7a24000f70, message=0x7f7a28003690) at sa/ike_sa.c:1268 #8 0x00007f7a47dc4067 in execute (this=0x7f7a280038e0) at processing/jobs/process_message_job.c:74 #9 0x00007f7a4823f8fb in process_jobs (worker=0xc746b0) at processing/processor.c:219 #10 0x00007f7a48241d30 in thread_main (this=0xc746e0) at threading/thread.c:309 #11 0x00007f7a47b8ee9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #12 0x00007f7a478bc4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6 #13 0x0000000000000000 in ?? () It looks to me (I am not familiar with the layering of code, so I could be completely off here) that thread 3, 4 and 15 are waiting on a lock that has been taken by thread 14. Whereas thread 3 has taken a lock that is being waited on by thread 13, 14 and 16. Does this look familiar to the developers?
_______________________________________________ Users mailing list [email protected] https://lists.strongswan.org/mailman/listinfo/users
