GNOME Bugzilla – Bug 347794
Do not reset SIGSEGV handler when --gst-disable-segtrap is active
Last modified: 2006-07-17 17:40:42 UTC
I am writing an application that has custom SIGSEGV handler. Unfortunately the function _gst_plugin_fault_handler_restore resets the handler to SIG_DFL, even if _gst_disable_segtrap == TRUE. Note that my pipe is builded automatically and therefore new plugins can be loaded anytime during the stream processing. I propose that _gst_plugin_fault_handler_restore does nothing in the case that _gst_plugin_fault_handler_setup did not set the signal handler. Simple patch attached. More complex patch could use _gst_plugin_fault_handler_is_setup, but I am not sure what was the developers intention with this flag. It would be also nice to have API for setting _gst_disable_segtrap = TRUE from the application. Thanks Michal
Created attachment 69048 [details] [review] Patch to disable SIGSEGV handler override
Thanks. Also added methods to get/set current core behaviour. * docs/gst/gstreamer-sections.txt: * gst/gst.c: (gst_segtrap_is_enabled), (gst_segtrap_set_enabled): * gst/gst.h: * gst/gstplugin.c: (_gst_plugin_fault_handler_restore): Add two functions to check and change the SIGSEGV behaviour when loading plugins. Don't mess with the SIGSEGV handler when we were told not to. Fixes #347794. API: gst_segtrap_is_enabled API: gst_segtrap_set_enabled