GNOME Bugzilla – Bug 560380
Deadlock with filesrc ! typefind ! decodebin ! ...
Last modified: 2009-01-09 23:22:11 UTC
Here's a deadlock I can easily reproduce with elisa and gst cvs. I don't have the same with core 0.10.21 (ubuntu intrepid). Apparently filesrc is pushing a newsegment event (which is serialized) while avidemux is pulling... 1. Thread 3 (Thread 0xb5eb2b90 (LWP 4668)): 2. #0 0xb7fb3430 in __kernel_vsyscall () 3. #1 0xb7f6fd09 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0 4. #2 0xb7f6b114 in _L_lock_89 () from /lib/tls/i686/cmov/libpthread.so.0 5. #3 0xb7f6aa42 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0 6. #4 0xb79e5f73 in IA__g_static_rec_mutex_lock (mutex=0x8c7ffd0) at /build/buildd/glib2.0-2.18.2/glib/gthread.c:313 7. #5 0xb699279e in gst_pad_get_range (pad=0x8c681b0, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4200 8. #6 0xb69930ad in gst_pad_pull_range (pad=0x8c68030, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4347 9. #7 0xb5f2d6f9 in gst_type_find_element_getrange (srcpad=0x8c680f0, offset=8850, length=12, buffer=0xb5eb226c) at gsttypefindelement.c:717 10. #8 0xb6992995 in gst_pad_get_range (pad=0x8c680f0, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4217 11. #9 0xb69930ad in gst_pad_pull_range (pad=0x8c84800, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4347 12. #10 0xb6981fc2 in gst_proxy_pad_do_getrange (pad=0x8c85048, offset=8850, size=12, buffer=0xb5eb226c) at gstghostpad.c:200 13. #11 0xb6992995 in gst_pad_get_range (pad=0x8c85048, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4217 14. #12 0xb69930ad in gst_pad_pull_range (pad=0x8c68270, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4347 15. #13 0xb5f2d6f9 in gst_type_find_element_getrange (srcpad=0x8c68330, offset=8850, length=12, buffer=0xb5eb226c) at gsttypefindelement.c:717 16. #14 0xb6992995 in gst_pad_get_range (pad=0x8c68330, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4217 17. #15 0xb69930ad in gst_pad_pull_range (pad=0x8c684b0, offset=8850, size=12, buffer=0xb5eb226c) at gstpad.c:4347 18. #16 0xb5eff3fa in gst_avi_demux_stream_header_pull (avi=0x8cb0d80) at gstavidemux.c:3155 19. #17 0xb5f075e8 in gst_avi_demux_loop (pad=0x8c684b0) at gstavidemux.c:4103 20. #18 0xb69b34f3 in gst_task_func (task=0x8bc8198, tclass=0x8de9c00) at gsttask.c:192 21. #19 0xb79e76c6 in g_thread_pool_thread_proxy (data=0x8de9c90) at /build/buildd/glib2.0-2.18.2/glib/gthreadpool.c:265 22. #20 0xb79e602f in g_thread_create_proxy (data=0x93add48) at /build/buildd/glib2.0-2.18.2/glib/gthread.c:635 23. #21 0xb7f6950f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 24. #22 0xb7eb77ee in clone () from /lib/tls/i686/cmov/libc.so.6 25. 26. Thread 2 (Thread 0xb45ffb90 (LWP 4671)): 27. #0 0xb7fb3430 in __kernel_vsyscall () 28. #1 0xb7f6fd09 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0 29. #2 0xb7f6b114 in _L_lock_89 () from /lib/tls/i686/cmov/libpthread.so.0 30. #3 0xb7f6aa42 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0 31. #4 0xb79e5f73 in IA__g_static_rec_mutex_lock (mutex=0x93adf60) at /build/buildd/glib2.0-2.18.2/glib/gthread.c:313 32. #5 0xb698ea26 in gst_pad_send_event (pad=0x8c684b0, event=0x8846718) at gstpad.c:4621 33. #6 0xb698f345 in gst_pad_push_event (pad=0x8c68330, event=0x8846718) at gstpad.c:4490 34. #7 0xb5f2dce6 in gst_type_find_element_handle_event (pad=0x8c68270, event=0x8846718) at gsttypefindelement.c:550 35. #8 0xb698e94c in gst_pad_send_event (pad=0x8c68270, event=0x8846718) at gstpad.c:4634 36. #9 0xb698f345 in gst_pad_push_event (pad=0x8c85048, event=0x8846718) at gstpad.c:4490 37. #10 0xb6983f6d in gst_proxy_pad_do_event (pad=0x8c84800, event=0x8846718) at gstghostpad.c:123 38. #11 0xb698e94c in gst_pad_send_event (pad=0x8c84800, event=0x8846718) at gstpad.c:4634 39. #12 0xb698f345 in gst_pad_push_event (pad=0x8c680f0, event=0x8846718) at gstpad.c:4490 40. #13 0xb5f2dce6 in gst_type_find_element_handle_event (pad=0x8c68030, event=0x8846718) at gsttypefindelement.c:550 41. #14 0xb698e94c in gst_pad_send_event (pad=0x8c68030, event=0x8846718) at gstpad.c:4634 42. #15 0xb698f345 in gst_pad_push_event (pad=0x8c681b0, event=0x8846718) at gstpad.c:4490 43. #16 0xb6a0f4e4 in gst_base_src_loop (pad=0x8c681b0) at gstbasesrc.c:2204 44. #17 0xb69b34f3 in gst_task_func (task=0x8bc81e8, tclass=0x8de9c00) at gsttask.c:192 45. #18 0xb79e76c6 in g_thread_pool_thread_proxy (data=0x8de9c90) at /build/buildd/glib2.0-2.18.2/glib/gthreadpool.c:265 46. #19 0xb79e602f in g_thread_create_proxy (data=0x914b0d0) at /build/buildd/glib2.0-2.18.2/glib/gthread.c:635 47. #20 0xb7f6950f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 48. #21 0xb7eb77ee in clone () from /lib/tls/i686/cmov/libc.so.6 49. 50. Thread 1 (Thread 0xb7dd58c0 (LWP 4663)): 51. #0 0xb7fb3430 in __kernel_vsyscall () 52. #1 0xb7f6fd09 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0 53. ---Type <return> to continue, or q <return> to quit--- 54. #2 0xb7f6b114 in _L_lock_89 () from /lib/tls/i686/cmov/libpthread.so.0 55. #3 0xb7f6aa42 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0 56. #4 0xb79e5f73 in IA__g_static_rec_mutex_lock (mutex=0x9150a08) at /build/buildd/glib2.0-2.18.2/glib/gthread.c:313 57. #5 0xb698cc35 in post_activate (pad=0x8c68330, new_mode=152373772) at gstpad.c:608 58. #6 0xb6997839 in gst_pad_activate_push (pad=0x8c68330, active=0) at gstpad.c:904 59. #7 0xb6998160 in gst_pad_activate_pull (pad=0x8c68330, active=0) at gstpad.c:748 60. #8 0xb6997ee3 in gst_pad_activate_pull (pad=0x8c684b0, active=0) at gstpad.c:761 61. #9 0xb6998655 in gst_pad_set_active (pad=0x8c684b0, active=0) at gstpad.c:670 62. #10 0xb697c05b in activate_pads (pad=0x8c684b0, ret=0xbfcb20f8, active=0xbfcb2158) at gstelement.c:2511 63. #11 0xb6989117 in gst_iterator_fold (it=0x8cdc320, func=0xb697c030 <activate_pads>, ret=0xbfcb20f8, user_data=0xbfcb2158) at gstiterator.c:540 64. #12 0xb697badf in iterator_activate_fold_with_resync (iter=0x8cdc320, func=0xb697c030 <activate_pads>, user_data=0xbfcb2158) at gstelement.c:2543 65. #13 0xb697bc1d in gst_element_pads_activate (element=0x8cb0d80, active=0) at gstelement.c:2587 66. #14 0xb697bfa9 in gst_element_change_state_func (element=0x8cb0d80, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstelement.c:2665 67. #15 0xb5f0238d in gst_avi_demux_change_state (element=0x8cb0d80, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstavidemux.c:4280 68. #16 0xb6978098 in gst_element_change_state (element=0x8cb0d80, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstelement.c:2427 69. #17 0xb697afdc in gst_element_set_state_func (element=0x8cb0d80, state=GST_STATE_READY) at gstelement.c:2377 70. #18 0xb69772c2 in gst_element_set_state (element=0x8cb0d80, state=GST_STATE_READY) at gstelement.c:2280 71. #19 0xb69685fa in gst_bin_change_state_func (element=0x8c5f1d8, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstbin.c:1974 72. #20 0xb5f62b5a in gst_decode_bin_change_state (element=0x8c5f1d8, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstdecodebin.c:1894 73. #21 0xb6978098 in gst_element_change_state (element=0x8c5f1d8, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstelement.c:2427 74. #22 0xb697afdc in gst_element_set_state_func (element=0x8c5f1d8, state=GST_STATE_READY) at gstelement.c:2377 75. #23 0xb69772c2 in gst_element_set_state (element=0x8c5f1d8, state=GST_STATE_READY) at gstelement.c:2280 76. #24 0xb69685fa in gst_bin_change_state_func (element=0x8c5f0d8, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstbin.c:1974 77. #25 0xb699b7ba in gst_pipeline_change_state (element=0x8c5f0d8, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstpipeline.c:465 78. #26 0xb6978098 in gst_element_change_state (element=0x8c5f0d8, transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstelement.c:2427 79. #27 0xb697afdc in gst_element_set_state_func (element=0x8c5f0d8, state=GST_STATE_READY) at gstelement.c:2377 80. #28 0xb69772c2 in gst_element_set_state (element=0x8c5f0d8, state=GST_STATE_READY) at gstelement.c:2280 81. #29 0xb6a903be in _wrap_gst_element_set_state (self=0x91bcfcc, args=0x904516c, kwargs=0x0) at gstelement.override:71 82. #30 0x080cea39 in PyEval_EvalFrameEx (f=0x8c5e9ac, throwflag=0) at ../Python/ceval.c:3595 83. #31 0x080d0345 in PyEval_EvalCodeEx (co=0x8ff9d10, globals=0x8daab54, locals=0x0, args=0x8c5d768, argcount=1, kws=0x8c5d76c, kwcount=0, defs=0x8db69f8, defcount=1, closure=0x0) at ../Python/ceval.c:2858 84. #32 0x080ce728 in PyEval_EvalFrameEx (f=0x8c5d62c, throwflag=0) at ../Python/ceval.c:3691 85. #33 0x080cfbf5 in PyEval_EvalFrameEx (f=0x8cda464, throwflag=0) at ../Python/ceval.c:3681 86. #34 0x080cfbf5 in PyEval_EvalFrameEx (f=0x8cda6ec, throwflag=0) at ../Python/ceval.c:3681 87. #35 0x080d0345 in PyEval_EvalCodeEx (co=0x8dba848, globals=0x8daab54, locals=0x0, args=0x8ddfb98, argcount=2, kws=0x93dfe08, kwcount=0, defs=0x8db6a18, defcount=1, closure=0x0) at ../Python/ceval.c:2858 88. #36 0x0811797e in function_call (func=0x8dbe6f4, arg=0x8ddfb8c, kw=0x91c20b4) at ../Objects/funcobject.c:517 89. #37 0x0805d867 in PyObject_Call (func=0x80, arg=0x8ddfb8c, kw=0x91c20b4) at ../Objects/abstract.c:1861 90. #38 0x080cd502 in PyEval_EvalFrameEx (f=0x8e52b1c, throwflag=0) at ../Python/ceval.c:3875 91. #39 0x080cfbf5 in PyEval_EvalFrameEx (f=0x8e52394, throwflag=0) at ../Python/ceval.c:3681 92. #40 0x080d0345 in PyEval_EvalCodeEx (co=0xb7cf6de8, globals=0xb7cf52d4, locals=0x0, args=0x90450f8, argcount=1, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:2858 93. #41 0x08117891 in function_call (func=0x89f47d4, arg=0x90450ec, kw=0x0) at ../Objects/funcobject.c:517 94. #42 0x0805d867 in PyObject_Call (func=0x80, arg=0x90450ec, kw=0x0) at ../Objects/abstract.c:1861 95. #43 0x08063a7a in instancemethod_call (func=0x89f47d4, arg=0x90450ec, kw=0x0) at ../Objects/classobject.c:2519 96. #44 0x0805d867 in PyObject_Call (func=0x80, arg=0xb7d9502c, kw=0x0) at ../Objects/abstract.c:1861 97. #45 0x080c850c in PyEval_CallObjectWithKeywords (func=0x8fe6194, arg=0xb7d9502c, kw=0x0) at ../Python/ceval.c:3464 98. #46 0x0805d9f0 in PyObject_CallObject (o=0x8fe6194, a=0xb7d9502c) at ../Objects/abstract.c:1852 99. #47 0xb7ca1e97 in _pyglib_handler_marshal (user_data=0x9042f2c) at /build/buildd/pygobject-2.15.3/glib/pyglib.c:557 100. #48 0xb79bbe26 in g_timeout_dispatch (source=0x914b138, callback=0xfffffe00, user_data=0x9042f2c) at /build/buildd/glib2.0-2.18.2/glib/gmain.c:3589 101. #49 0xb79bb6f8 in IA__g_main_context_dispatch (context=0x8a16718) at /build/buildd/glib2.0-2.18.2/glib/gmain.c:2144 102. #50 0xb79beda3 in g_main_context_iterate (context=0x8a16718, block=1, dispatch=1, self=0x870cfc8) at /build/buildd/glib2.0-2.18.2/glib/gmain.c:2778 103. #51 0xb79bf2c2 in IA__g_main_loop_run (loop=0x90da870) at /build/buildd/glib2.0-2.18.2/glib/gmain.c:2986 104. #52 0xb740b3a9 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
Created attachment 122490 [details] script to reproduce the bug Here's a script to reproduce the bug. The problem is inside gst_type_find_element_activate. Working on a fix for it.
ah yes, hard to solve. I added a sink-caps property on decodebin2 for these cases, which makes it not typefind. See uridecodebin for how it's done.
Created attachment 122838 [details] [review] Add sink-caps property to decodebin Okay, i did it like it's done for decodebin2.