[Bug 797203] shmsrc: race condition when stopping

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Oct 8 20:11:47 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=797203

--- Comment #7 from Aleix Conchillo FlaquƩ <aconchillo at gmail.com> ---
I've checked Josep patch and test. Here's what I found.

Without Josep patch the new test already hangs. This is because the client main
socket is opened without O_NONBLOCK. I have filed bug 797258 with a patch.

Then, with the O_NONBLOCK fix, there still another freeze (with or without
Josep's  patch). This deadlock only occurs when wait-for-connection=TRUE, with
wait-for-connection=FALSE everything works great (with the non-blocking fix).

Here's the stack trace:

Thread 3 (Thread 0x7ff799ed2700 (LWP 30791)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ff7a01e7eaf in g_cond_wait (cond=cond at entry=0x23008d8,
mutex=mutex at entry=0x2300608) at gthread-posix.c:1402
#2  0x00007ff79e6da4b5 in gst_shm_sink_render (bsink=0x23005f0,
buf=0x7ff78c00ab80) at gstshmsink.c:674
#3  0x00007ff79e919c23 in gst_base_sink_chain_unlocked
(basesink=basesink at entry=0x23005f0, obj=obj at entry=0x7ff78c00ab80,
is_list=is_list at entry=0, pad=<optimized out>) at gstbasesink.c:3546
#4  0x00007ff79e91b25c in gst_base_sink_chain_main (is_list=0,
obj=0x7ff78c00ab80, pad=<optimized out>, basesink=0x23005f0) at
gstbasesink.c:3672
#5  gst_base_sink_chain (pad=<optimized out>, parent=0x23005f0,
buf=0x7ff78c00ab80) at gstbasesink.c:3701
#6  0x00007ff7a074110b in gst_pad_chain_data_unchecked (data=<optimized out>,
type=4112, pad=0x22fc2f0) at gstpad.c:4322
#7  gst_pad_push_data (pad=pad at entry=0x22fc0a0, type=type at entry=4112,
data=<optimized out>, data at entry=0x7ff78c00ab80) at gstpad.c:4578
#8  0x00007ff7a0748bb3 in gst_pad_push (pad=pad at entry=0x22fc0a0,
buffer=0x7ff78c00ab80) at gstpad.c:4697
#9  0x00007ff79e91f98d in gst_base_src_loop (pad=0x22fc0a0) at
gstbasesrc.c:2957
#10 0x00007ff7a077b5b1 in gst_task_func (task=0x2305050) at gsttask.c:332
#11 0x00007ff7a01c51dc in g_thread_pool_thread_proxy (data=<optimized out>) at
gthreadpool.c:307
#12 0x00007ff7a01c4ac5 in g_thread_proxy (data=0x21e8720) at gthread.c:784
#13 0x00007ff79ff236ba in start_thread (arg=0x7ff799ed2700) at
pthread_create.c:333
#14 0x00007ff79fc5941d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7ff79a6d3700 (LWP 30790)):
#0  0x00007ff79fc4d811 in __GI_ppoll (fds=0x7ff794001500, nfds=2,
timeout=<optimized out>, timeout at entry=0x0, sigmask=sigmask at entry=0x0) at
../sysdeps/unix/sysv/linux/ppoll.c:50
#1  0x00007ff7a0757a68 in ppoll (__ss=0x0, __timeout=0x0, __nfds=<optimized
out>, __fds=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/poll2.h:77
#2  gst_poll_wait (set=0x21e8680, timeout=timeout at entry=18446744073709551615)
at gstpoll.c:1370
#3  0x00007ff79e6daff0 in pollthread_func (data=0x23005f0) at gstshmsink.c:830
#4  0x00007ff7a01c4ac5 in g_thread_proxy (data=0x21e86d0) at gthread.c:784
#5  0x00007ff79ff236ba in start_thread (arg=0x7ff79a6d3700) at
pthread_create.c:333
#6  0x00007ff79fc5941d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ff7a0e33700 (LWP 30789)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ff7a01e70ac in g_mutex_lock_slowpath (mutex=mutex at entry=0x2300718)
at gthread-posix.c:1320
#2  0x00007ff7a01e7d52 in g_mutex_lock (mutex=mutex at entry=0x2300718) at
gthread-posix.c:1344
#3  0x00007ff79e913bcc in gst_base_sink_change_state (element=0x23005f0,
transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstbasesink.c:5161
#4  0x00007ff7a072668e in gst_element_change_state
(element=element at entry=0x23005f0,
transition=transition at entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at
gstelement.c:2952
#5  0x00007ff7a0726e07 in gst_element_set_state_func (element=0x23005f0,
state=GST_STATE_PAUSED) at gstelement.c:2906
#6  0x00007ff7a0702855 in gst_bin_element_set_state (next=GST_STATE_PAUSED,
current=GST_STATE_PLAYING, start_time=34130956, base_time=4159051704266325,
element=0x23005f0, bin=0x2302080) at gstbin.c:2604
#7  gst_bin_change_state_func (element=0x2302080,
transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstbin.c:2946
#8  0x00007ff7a074e2ba in gst_pipeline_change_state (element=0x2302080,
transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstpipeline.c:508
#9  0x00007ff7a072668e in gst_element_change_state
(element=element at entry=0x2302080,
transition=transition at entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at
gstelement.c:2952
#10 0x00007ff7a0726e07 in gst_element_set_state_func (element=0x2302080,
state=GST_STATE_NULL) at gstelement.c:2906
#11 0x0000000000401e70 in test_shm_live (__i__=<optimized out>) at
elements/shm.c:218
#12 0x00007ff7a0a29c2e in tcase_run_tfun_fork (i=0, tfun=0x22e64d0,
tc=0x22e9b60, sr=0x22e6500) at check_run.c:465
#13 srunner_iterate_tcase_tfuns (tc=0x22e9b60, sr=0x22e6500) at check_run.c:237
#14 srunner_run_tcase (tc=0x22e9b60, sr=0x22e6500) at check_run.c:377
#15 srunner_iterate_suites (print_mode=CK_SILENT, exclude_tags=<optimized out>,
include_tags=<optimized out>, tcname=<optimized out>, sname=<optimized out>,
sr=0x22e6500) at check_run.c:205
#16 srunner_run_tagged (sr=sr at entry=0x22e6500, sname=<optimized out>,
sname at entry=0x0, tcname=<optimized out>, tcname at entry=0x0,
include_tags=<optimized out>, include_tags at entry=0x0, exclude_tags=<optimized
out>, exclude_tags at entry=0x0, print_mode=print_mode at entry=CK_NORMAL) at
check_run.c:740
#17 0x00007ff7a0a29d1d in srunner_run (sr=sr at entry=0x22e6500,
sname=sname at entry=0x0, tcname=tcname at entry=0x0,
print_mode=print_mode at entry=CK_NORMAL) at check_run.c:754
#18 0x00007ff7a0a29d2b in srunner_run_all (sr=sr at entry=0x22e6500,
print_mode=print_mode at entry=CK_NORMAL) at check_run.c:692
#19 0x00007ff7a0a1d8bd in gst_check_run_suite (suite=suite at entry=0x2140690,
name=name at entry=0x402ae5 "shm", fname=fname at entry=0x4029d8 "elements/shm.c") at
gstcheck.c:1067
#20 0x0000000000401aaf in main (argc=1, argv=0x7ffff45dcab8) at
elements/shm.c:249

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list