Hard lock in mutex on seek

Nicolas Dufresne nicolas at ndufresne.ca
Tue Nov 1 13:04:46 UTC 2022


Le lundi 31 octobre 2022 à 17:05 -0700, Bill Hofmann via gstreamer-devel a
écrit :
> Folks:
> 
> Running 1.20.4 on Ubuntu 22.04, my (python) code seeks:
> 
> Oct 27 07:27:55 player0 python3[7546]: set_seek_and_rate 20849000000000ns
> 2022-10-27T07:27:55.185108-07:00
> An hour or two later I noted that it was hard hung.  Attaching to python3
> using gdb, the stack trace looks like below. This required a power cycle, as
> shutdown or kill -9 the process would not work. This is VERY intermittent -
> first time I've seen in months. HOWEVER, since this is intended to be mostly
> unattended, it worries me.
> 
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> futex_wait (private=0, expected=2, futex_word=0x555c97ea0cf0) at
> ../sysdeps/nptl/futex-internal.h:146
> 146 ../sysdeps/nptl/futex-internal.h: No such file or directory.
> (gdb) bt

As its possibly a deadlock, can you run "thread apply all bt", so we can locate,
if any, the other thread implicated ?

> #0  futex_wait (private=0, expected=2, futex_word=0x555c97ea0cf0) at
> ../sysdeps/nptl/futex-internal.h:146
> #1  __GI___lll_lock_wait (futex=futex at entry=0x555c97ea0cf0, private=0) at
> ./nptl/lowlevellock.c:49
> #2  0x00007faad55a70dd in lll_mutex_lock_optimized (mutex=0x555c97ea0cf0) at
> ./nptl/pthread_mutex_lock.c:48
> #3  ___pthread_mutex_lock (mutex=0x555c97ea0cf0) at
> ./nptl/pthread_mutex_lock.c:128
> #4  0x00007faad3045736 in gst_element_send_event (element=0x555c97f54110,
> event=0x7faa8c0c81d0) at ../subprojects/gstreamer/gst/gstelement.c:1980
> #5  0x00007faad3988e2e in  () at /lib/x86_64-linux-gnu/libffi.so.8
> #6  0x00007faad3985493 in  () at /lib/x86_64-linux-gnu/libffi.so.8

ffi debug symbols will help a lot.

regards,
Nicolas

> #7  0x00007faad3b70722 in  () at /usr/lib/python3/dist-
> packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
> #8  0x00007faad3b6e826 in  () at /usr/lib/python3/dist-
> packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
> #9  0x00007faad3b6ea7d in  () at /usr/lib/python3/dist-
> packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
> #10 0x0000555c956fe3bb in _PyObject_MakeTpCall ()
> #11 0x0000555c956f6f59 in _PyEval_EvalFrameDefault ()
> #12 0x0000555c9570812c in _PyFunction_Vectorcall ()
> #13 0x0000555c956f09e6 in _PyEval_EvalFrameDefault ()
> #14 0x0000555c9570812c in _PyFunction_Vectorcall ()
> #15 0x0000555c956f09e6 in _PyEval_EvalFrameDefault ()
> #16 0x0000555c9570812c in _PyFunction_Vectorcall ()
> #17 0x0000555c956f09e6 in _PyEval_EvalFrameDefault ()
> #18 0x0000555c95715c5e in  ()
> #19 0x00007faad3b7254f in  () at /usr/lib/python3/dist-
> packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
> #20 0x00007faad39887ec in  () at /lib/x86_64-linux-gnu/libffi.so.8
> #21 0x00007faad3989050 in  () at /lib/x86_64-linux-gnu/libffi.so.8
> #22 0x00007faad3a672a8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #23 0x00007faad3a66c24 in g_main_context_dispatch () at /lib/x86_64-linux-
> gnu/libglib-2.0.so.0
> #24 0x00007faad3abb6f8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #25 0x00007faad3a66293 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-
> 2.0.so.0
> #26 0x00007faad3988e2e in  () at /lib/x86_64-linux-gnu/libffi.so.8
> #27 0x00007faad3985493 in  () at /lib/x86_64-linux-gnu/libffi.so.8
> #28 0x00007faad3b70722 in  () at /usr/lib/python3/dist-
> packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
> #29 0x00007faad3b6e826 in  () at /usr/lib/python3/dist-
> packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
> #30 0x00007faad3b6ea7d in  () at /usr/lib/python3/dist-
> packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
> #31 0x0000555c956fe3bb in _PyObject_MakeTpCall ()
> #32 0x0000555c956f6f59 in _PyEval_EvalFrameDefault ()
> #33 0x0000555c9570812c in _PyFunction_Vectorcall ()
> #34 0x0000555c956f09e6 in _PyEval_EvalFrameDefault ()
> #35 0x0000555c9570812c in _PyFunction_Vectorcall ()
> #36 0x0000555c956f09e6 in _PyEval_EvalFrameDefault ()
> #37 0x0000555c9570812c in _PyFunction_Vectorcall ()
> #38 0x0000555c956f08a1 in _PyEval_EvalFrameDefault ()
> #39 0x0000555c956ed026 in  ()
> #40 0x0000555c957e3106 in PyEval_EvalCode ()
> #41 0x0000555c9580fe18 in  ()
> #42 0x0000555c95808c6b in  ()
> #43 0x0000555c9580fb65 in  ()
> #44 0x0000555c9580f048 in _PyRun_SimpleFileObject ()
> #45 0x0000555c9580ed43 in _PyRun_AnyFileObject ()
> #46 0x0000555c9580017e in Py_RunMain ()
> #47 0x0000555c957d60dd in Py_BytesMain ()
> #48 0x00007faad5538d90 in __libc_start_call_main
> (main=main at entry=0x555c957d60a0, argc=argc at entry=3,
> argv=argv at entry=0x7ffe8279e068) at ../sysdeps/nptl/libc_start_call_main.h:58
> #49 0x00007faad5538e40 in __libc_start_main_impl (main=0x555c957d60a0, argc=3,
> argv=0x7ffe8279e068, init=<optimized out>, fini=<optimized out>,
> rtld_fini=<optimized out>, stack_end=0x7ffe8279e058)
>     at ../csu/libc-start.c:392
> #50 0x0000555c957d5fd5 in _start ()
> 
> Actual seek code:
> 
>         flags = Gst.SeekFlags.TRICKMODE | Gst.SeekFlags.KEY_UNIT |
> Gst.SeekFlags.SNAP_NEAREST | Gst.SeekFlags.FLUSH
> 
>         seek_event = Gst.Event.new_seek(rate,
>                                             Gst.Format.TIME,
>                                             flags,
>                                             Gst.SeekType.SET,
> position_nanoseconds,
>                                             Gst.SeekType.NONE, 0)
> 
>         if seek_event:
>             self._player.send_event(seek_event)
>         else:
>             Gst.error("change rate failed")
> 
> Pipeline:
> 
> souphttpsrc location="http://localhost/foo.m3u8" ! 
>          parsebin name=pb ! queue ! vaapih265dec !
>          video/x-raw,format=P010_10LE ! 
>          queue max-size-bytes=100663300 ! 
>          kmssink connector-id=308 plane-id=31
>     pb. ! queue ! fdkaacdec ! scaletempo ! volume volume=0.9 ! alsasink
> 
> Thoughts?
> -Bill

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20221101/bca435b5/attachment.htm>


More information about the gstreamer-devel mailing list