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

segmentation fault when closing session in streaming plugin #72

Closed
jacobhub opened this issue Sep 30, 2014 · 2 comments
Closed

segmentation fault when closing session in streaming plugin #72

jacobhub opened this issue Sep 30, 2014 · 2 comments

Comments

@jacobhub
Copy link

in version 0.0.6 when closing a streaming session janus seg faults, this doesnt happen on 0.0.4. this is the output:

this is the gdb stack trace:

Thread 20 (Thread 0x7fffc75ef700 (LWP 28942)):
#0 0x00007ffff592ac6d in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff74432f5 in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#2 0x00007ffff5c0b182 in start_thread (arg=0x7fffc75ef700) at pthread_create.c:312
#3 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 19 (Thread 0x7fffc7df0700 (LWP 28938)):
#0 0x00007ffff592ac6d in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff769afe4 in g_main_context_poll (priority=2147483647, n_fds=8, fds=0x7fffe4015780, timeout=-1, context=0x7fffdc02e040) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:4028
#2 g_main_context_iterate (context=0x7fffdc02e040, block=block@entry=1, dispatch=dispatch@entry=1, self=) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3729
#3 0x00007ffff769b30a in g_main_loop_run (loop=0x7fffe4001760) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3928
#4 0x00007ffff52c693e in ?? () from /usr/lib/x86_64-linux-gnu/libgupnp-igd-1.0.so.4
#5 0x00007ffff76bff15 in g_thread_proxy (data=0x7fffd4005190) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#6 0x00007ffff5c0b182 in start_thread (arg=0x7fffc7df0700) at pthread_create.c:312
#7 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 18 (Thread 0x7fffc85f1700 (LWP 28937)):
#0 0x00007ffff5c12b9d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff76c14a8 in g_usleep (microseconds=microseconds@entry=1000000) at /build/buildd/glib2.0-2.40.0/./glib/gtimer.c:259
#2 0x000000000041222d in janus_ice_thread (data=0x7fffdc001f20) at ice.c:817
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x7fffd4005140) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffc85f1700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 17 (Thread 0x7fffc8df2700 (LWP 28936)):
#0 0x00007ffff5c12b9d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff76c14a8 in g_usleep (microseconds=microseconds@entry=100000) at /build/buildd/glib2.0-2.40.0/./glib/gtimer.c:259
#2 0x00000000004167cc in janus_ws_notifier (source=source@entry=0x7fffc8df1a10, max_events=max_events@entry=1) at janus.c:2253
#3 0x000000000041c560 in janus_ws_handler (cls=, connection=0x7fffd8011110, url=0x7fffd80112c4 "/janus/1840250953", method=, version=, upload_data=0x0, upload_data_size=0x7fffc8df1b98,

ptr=0x7fffd8011168) at janus.c:681

#4 0x00007ffff743f83d in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#5 0x00007ffff7440a40 in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#6 0x00007ffff744344b in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#7 0x00007ffff5c0b182 in start_thread (arg=0x7fffc8df2700) at pthread_create.c:312
#8 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 16 (Thread 0x7fffc95f3700 (LWP 28935)):
#0 g_list_remove_all (list=0x7fffd4004850, data=data@entry=0x7fffdc000e90) at /build/buildd/glib2.0-2.40.0/./glib/glist.c:546
#1 0x00007ffff15b41ed in janus_streaming_destroy_session (handle=0x7fffdc001ec0, error=) at plugins/janus_streaming.c:581
#2 0x0000000000411733 in janus_ice_handle_destroy (gateway_session=gateway_session@entry=0x7fffe0000c60, handle_id=handle_id@entry=2629961381) at ice.c:323
#3 0x0000000000419752 in janus_process_incoming_request (source=0x7fffc95f2a10, root=0x7fffe0003190) at janus.c:1009
#4 0x000000000041bc49 in janus_ws_handler (cls=, connection=0x7fffd8008df0, url=0x7fffd8008fa5 "/janus/1840250953/2629961381", method=, version=, upload_data=0x0,

upload_data_size=0x7fffc95f2b98, ptr=0x7fffd8008e48) at janus.c:705

#5 0x00007ffff743f83d in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#6 0x00007ffff7440a40 in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#7 0x00007ffff744344b in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#8 0x00007ffff5c0b182 in start_thread (arg=0x7fffc95f3700) at pthread_create.c:312
#9 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 15 (Thread 0x7fffc9df4700 (LWP 28934)):
#0 0x00007ffff592f8e3 in select () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff15b47d5 in janus_streaming_relay_thread (data=data@entry=0x7fffd4004300) at plugins/janus_streaming.c:1920
#2 0x00007ffff15b4d90 in janus_streaming_relay_thread (data=0x7fffd4004300) at plugins/janus_streaming.c:1852
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x679a80) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffc9df4700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 13 (Thread 0x7fffcadf6700 (LWP 28932)):
#0 0x00007ffff592ac6d in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff769afe4 in g_main_context_poll (priority=2147483647, n_fds=1, fds=0x7fffcc001c30, timeout=1999, context=0x671030) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:4028
#2 g_main_context_iterate (context=0x671030, block=block@entry=1, dispatch=dispatch@entry=1, self=) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3729
#3 0x00007ffff769b30a in g_main_loop_run (loop=0x6711a0) at /build/buildd/glib2.0-2.40.0/./glib/gmain.c:3928
#4 0x0000000000415217 in janus_sessions_watchdog (user_data=0x6711a0) at janus.c:279
#5 0x00007ffff76bff15 in g_thread_proxy (data=0x679720) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#6 0x00007ffff5c0b182 in start_thread (arg=0x7fffcadf6700) at pthread_create.c:312
#7 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 12 (Thread 0x7fffcb5f7700 (LWP 28931)):
#0 0x00007ffff592ac6d in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff7445376 in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#2 0x00007ffff744635d in ?? () from /usr/lib/x86_64-linux-gnu/libmicrohttpd.so.10
#3 0x00007ffff5c0b182 in start_thread (arg=0x7fffcb5f7700) at pthread_create.c:312
#4 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 11 (Thread 0x7fffcbdf8700 (LWP 28930)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=50000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007fffcbdfcee2 in janus_voicemail_handler (data=) at plugins/janus_voicemail.c:480
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x6796d0) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffcbdf8700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 10 (Thread 0x7fffe89db700 (LWP 28929)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=50000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007fffe91e16ba in janus_audiobridge_handler (data=) at plugins/janus_audiobridge.c:589
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x679680) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffe89db700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 9 (Thread 0x7fffe91dc700 (LWP 28928)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=1000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007fffe91e0968 in janus_audiobridge_mixer_thread (data=0x67bdb0) at plugins/janus_audiobridge.c:1290
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x679630) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffe91dc700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 8 (Thread 0x7fffe9be8700 (LWP 28927)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=50000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007fffe9bee4e2 in janus_sip_handler (data=) at plugins/janus_sip.c:663
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x6795e0) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffe9be8700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 7 (Thread 0x7fffea5f6700 (LWP 28926)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=50000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007fffea5f9f6a in janus_echotest_handler (data=) at plugins/janus_echotest.c:410
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x679590) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffea5f6700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 6 (Thread 0x7fffeaffd700 (LWP 28925)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=50000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007ffff01a009a in janus_videoroom_handler (data=) at plugins/janus_videoroom.c:1192
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x679540) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffeaffd700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 5 (Thread 0x7fffeb7fe700 (LWP 28924)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=50000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007ffff03aa462 in janus_videocall_handler (data=) at plugins/janus_videocall.c:446
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x6794f0) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffeb7fe700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7fffebfff700 (LWP 28923)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=50000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007ffff15b587a in janus_streaming_handler (data=) at plugins/janus_streaming.c:1227
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x6794a0) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7fffebfff700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7ffff0daf700 (LWP 28922)):
#0 0x00007ffff58fe9bd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff592ffe4 in usleep (useconds=useconds@entry=1000) at ../sysdeps/unix/sysv/linux/usleep.c:32
#2 0x00007ffff15b5152 in janus_streaming_filesource_thread (data=0x66f3c0) at plugins/janus_streaming.c:1805
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x679450) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7ffff0daf700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7ffff15b0700 (LWP 28921)):
#0 0x00007ffff592f8e3 in select () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff15b47d5 in janus_streaming_relay_thread (data=data@entry=0x66f340) at plugins/janus_streaming.c:1920
#2 0x00007ffff15b4d90 in janus_streaming_relay_thread (data=0x66f340) at plugins/janus_streaming.c:1852
#3 0x00007ffff76bff15 in g_thread_proxy (data=0x679400) at /build/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4 0x00007ffff5c0b182 in start_thread (arg=0x7ffff15b0700) at pthread_create.c:312
#5 0x00007ffff5937fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7ffff7fda880 (LWP 28917)):
#0 0x00007ffff5938653 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff3d04563 in ?? () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#2 0x00007ffff3cf0905 in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#3 0x00007ffff6041d95 in libwebsock_wait (ctx=0x670ec0) at api.c:138
#4 0x000000000040929e in main (argc=, argv=) at janus.c:4300

@lminiero
Copy link
Member

Hi,

please don't just paste logs like this: post them somewhere and provide a link, as otherwise this messes up the automatic issues references.

That said, I'll look into this ASAP.

lminiero pushed a commit that referenced this issue Oct 2, 2014
@lminiero
Copy link
Member

lminiero commented Oct 2, 2014

I've not been able to replicate the issue, but if the issue is with the map of listeners, I've strenghtened its management using a lock to avoid potential race conditions. Can you let me know if that solves the issue for you?

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

2 participants