Deadlock in nice_agent_close_async
Hello I am using Janus WebRTC and when the ice session is closed, the nice_agent_close_async method is called. After calling it, the callback worked, but the program control does not return. Here is the stack trace of the blocked thread
(gdb) bt full
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
No locals.
#1 0x00007f22d86554bc in g_mutex_lock_slowpath (mutex=mutex@entry=0x7f2268013a98) at ../glib/gthread-posix.c:1493
No locals.
#2 0x00007f22d8655f52 in g_mutex_lock (mutex=mutex@entry=0x7f2268013a98) at ../glib/gthread-posix.c:1517
No locals.
#3 0x00007f22d8f67bb9 in agent_lock (agent=agent@entry=0x7f2268013a80) at ../agent/agent.c:171
No locals.
#4 0x00007f22d8f6e452 in on_agent_refreshes_pruned (agent=0x7f2268013a80, user_data=0x7f226000a300)
at ../agent/agent.c:7361
task = 0x7f226000a300
user_data = 0x7f226000a300
agent = 0x7f2268013a80
task = <optimized out>
timeout_source = <optimized out>
task = 0x7f226000a300
timeout_source = <optimized out>
#5 0x00007f22d8f7ece5 in on_refresh_removed (data=0x7f226001b720) at ../agent/discovery.c:289
No locals.
#6 0x00007f22d8f7edee in refresh_prune_async (agent=agent@entry=0x7f2268013a80, refreshes=<optimized out>,
function=function@entry=0x7f22d8f6e3c0 <on_agent_refreshes_pruned>, user_data=user_data@entry=0x7f226000a300)
at ../agent/discovery.c:327
data = <optimized out>
it = <optimized out>
timeout = <optimized out>
#7 0x00007f22d8f7fbb2 in refresh_prune_agent_async (agent=agent@entry=0x7f2268013a80,
function=function@entry=0x7f22d8f6e3c0 <on_agent_refreshes_pruned>, user_data=user_data@entry=0x7f226000a300)
at ../agent/discovery.c:334
No locals.
#8 0x00007f22d8f67f02 in nice_agent_close_async (agent=0x7f2268013a80, callback=<optimized out>,
callback_data=<optimized out>) at ../agent/agent.c:7377
task = 0x7f226000a300
#9 0x0000562a0d9183fd in janus_ice_webrtc_free (handle=0x7f22a0005b30) at ice.c:1567
__FUNCTION__ = "janus_ice_webrtc_free"
I got this problem on master. In 0.1.18 this works fine