After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666028 - exception may cause test pipeline to be shut down from streaming thread
exception may cause test pipeline to be shut down from streaming thread
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-qa-system
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-12 20:49 UTC by Tim-Philipp Müller
Modified: 2012-05-18 12:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim-Philipp Müller 2011-12-12 20:49:29 UTC
If an exception occurs in python code called from a streaming thread (e.g. in a pad probe callback), the self.stop() will lead to a pipeline set_state(gst.STATE_NULL) being done from the streaming thread, which will dead-lock in the best case scenario, and crash in the worst case scenario.

Example stacktrace, for illustrative purposes:

[New LWP 22566]
[New LWP 22563]
[New LWP 22567]
[New LWP 22569]
[New LWP 22571]
[New LWP 22565]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Core was generated by `/usr/bin/python /home/tpm/gst/releases/gst-qa-system/bin/insanity-pythondbusrun'.
Program terminated with signal 5, Trace/breakpoint trap.
  • #0 g_logv
    at /tmp/buildd/glib2.0-2.30.2/./glib/gmessages.c line 577
  • #0 g_logv
    at /tmp/buildd/glib2.0-2.30.2/./glib/gmessages.c line 577
  • #1 g_log
    at /tmp/buildd/glib2.0-2.30.2/./glib/gmessages.c line 591
  • #2 gst_buffer_unref
    at /home/tpm/gst/releases/gstreamer/gst/gstbuffer.h line 367
  • #3 gst_base_video_codec_free_frame
    at gstbasevideocodec.c line 192
  • #4 gst_base_video_decoder_reset
    at gstbasevideodecoder.c line 968
  • #5 gst_base_video_decoder_change_state
    at gstbasevideodecoder.c line 1331
  • #6 gst_element_change_state
    at gstelement.c line 2761
  • #7 gst_element_set_state_func
    at gstelement.c line 2717
  • #8 gst_bin_element_set_state
    at gstbin.c line 2209
  • #9 gst_bin_change_state_func
    at gstbin.c line 2518
  • #10 gst_decode_bin_change_state
    at gstdecodebin2.c line 4026
  • #11 gst_element_change_state
    at gstelement.c line 2761
  • #12 gst_element_set_state_func
    at gstelement.c line 2717
  • #13 gst_bin_element_set_state
    at gstbin.c line 2209
  • #14 gst_bin_change_state_func
    at gstbin.c line 2518
  • #15 gst_uri_decode_bin_change_state
    at gsturidecodebin.c line 2500
  • #16 gst_element_change_state
    at gstelement.c line 2761
  • #17 gst_element_set_state_func
    at gstelement.c line 2717
  • #18 gst_bin_element_set_state
    at gstbin.c line 2209
  • #19 gst_bin_change_state_func
    at gstbin.c line 2518
  • #20 gst_pipeline_change_state
    at gstpipeline.c line 482
  • #21 gst_play_bin_change_state
    at gstplaybin2.c line 3936
  • #22 gst_element_change_state
    at gstelement.c line 2761
  • #23 gst_element_change_state
    at gstelement.c line 2798
  • #24 gst_element_set_state_func
    at gstelement.c line 2717
  • #25 _wrap_gst_element_set_state
    at gstelement.override line 71
  • #26 call_function
    at ../Python/ceval.c line 4021
  • #27 PyEval_EvalFrameEx
    at ../Python/ceval.c line 2666
  • #28 fast_function
    at ../Python/ceval.c line 4107
  • #29 call_function
    at ../Python/ceval.c line 4042
  • #30 PyEval_EvalFrameEx
    at ../Python/ceval.c line 2666
  • #31 fast_function
    at ../Python/ceval.c line 4107
  • #32 call_function
    at ../Python/ceval.c line 4042
  • #33 PyEval_EvalFrameEx
    at ../Python/ceval.c line 2666
  • #34 PyEval_EvalCodeEx
    at ../Python/ceval.c line 3253
  • #35 function_call
  • #36 PyObject_Call
    at ../Objects/abstract.c line 2529
  • #37 instancemethod_call
  • #38 PyObject_Call
    at ../Objects/abstract.c line 2529
  • #39 do_call
    at ../Python/ceval.c line 4239
  • #40 call_function
    at ../Python/ceval.c line 4044
  • #41 PyEval_EvalFrameEx
    at ../Python/ceval.c line 2666
  • #42 fast_function
    at ../Python/ceval.c line 4107
  • #43 call_function
    at ../Python/ceval.c line 4042
  • #44 PyEval_EvalFrameEx
    at ../Python/ceval.c line 2666
  • #45 PyEval_EvalCodeEx
    at ../Python/ceval.c line 3253
  • #46 function_call
  • #47 PyObject_Call
    at ../Objects/abstract.c line 2529
  • #48 instancemethod_call
  • #49 PyObject_Call
    at ../Objects/abstract.c line 2529
  • #50 PyEval_CallObjectWithKeywords
  • #51 PyErr_PrintEx
    at ../Python/pythonrun.c line 1155
  • #52 data_probe_callback_marshal
    at gstpad.override line 906
  • #53 gst_marshal_BOOLEAN__POINTER
    at gstmarshal.c line 586
  • #54 g_closure_invoke
    at /tmp/buildd/glib2.0-2.30.2/./gobject/gclosure.c line 774
  • #55 signal_emit_unlocked_R
    at /tmp/buildd/glib2.0-2.30.2/./gobject/gsignal.c line 3272
  • #56 g_signal_emitv
    at /tmp/buildd/glib2.0-2.30.2/./gobject/gsignal.c line 2907
  • #57 gst_pad_emit_have_data_signal
    at gstpad.c line 4167
  • #58 gst_pad_push_data
    at gstpad.c line 4473
  • #59 gst_pad_push
    at gstpad.c line 4730
  • #60 gst_base_video_decoder_finish_frame
    at gstbasevideodecoder.c line 1668
  • #61 gst_vp8_dec_handle_frame
    at gstvp8dec.c line 484
  • #62 gst_base_video_decoder_have_frame_2
    at gstbasevideodecoder.c line 1857
  • #63 gst_base_video_decoder_chain
    at gstbasevideodecoder.c line 1293
  • #64 gst_pad_push
    at gstpad.c line 4710
  • #65 gst_single_queue_push_one
    at gstmultiqueue.c line 1087
  • #66 gst_multi_queue_loop
    at gstmultiqueue.c line 1318
  • #67 gst_task_func
    at gsttask.c line 327
  • #68 g_thread_pool_thread_proxy
    at /tmp/buildd/glib2.0-2.30.2/./glib/gthreadpool.c line 319
  • #69 g_thread_create_proxy
    at /tmp/buildd/glib2.0-2.30.2/./glib/gthread.c line 1962
  • #70 start_thread
    at pthread_create.c line 304
  • #71 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #72 ??


The exception handler should either unconditionally schedule the stop from the main thread, or check if it is the main thread or not and marshal it into the main thread if not.
Comment 1 Vincent Penquerc'h 2012-05-18 12:44:00 UTC
Largely obsoleted by the switch to writing tests in C in a separate process.

It might still be possible to write tests in Python though, but I guess it's fair to say it won't be supported anymore.

So I think this can be closed as obsolete.