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 684765 - Plugins without a klass in the metadata crashes autoaudiosink
Plugins without a klass in the metadata crashes autoaudiosink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.0.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-25 08:40 UTC by Daniel Narvaez
Modified: 2012-09-25 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
plugin: Fail if no valid plugin metadata is set (1.51 KB, patch)
2012-09-25 11:10 UTC, Sebastian Dröge (slomo)
committed Details | Review
elementfactory: Fail if no valid element factory metadata is set (3.54 KB, patch)
2012-09-25 11:10 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Daniel Narvaez 2012-09-25 08:40:48 UTC
I have a plugin which doesn't call gst_element_class_set_static_metadata and it causes this crash in the autoaudiosink:

gst-launch-1.0 -v -m audiotestsrc ! audioconvert ! audioresample ! autoaudiosink
Setting pipeline to PAUSED ...
Before klass
Caught SIGSEGV accessing address (nil)
  • #0 __libc_waitpid
  • #1 g_on_error_stack_trace
  • #2 fault_spin
    at gst-launch.c line 139
  • #3 fault_handler_sigaction
  • #4 <signal handler called>
  • #5 __strstr_sse42
  • #6 gst_auto_audio_sink_factory_filter
  • #7 gst_registry_feature_filter
  • #8 gst_auto_audio_sink_find_best
  • #9 gst_auto_audio_sink_detect
    at gstautoaudiosink.c line 348
  • #10 gst_auto_audio_sink_change_state
  • #11 gst_element_change_state
  • #12 gst_element_set_state_func
  • #13 gst_bin_element_set_state
  • #14 gst_bin_change_state_func
  • #15 gst_element_change_state
  • #16 gst_element_set_state_func
  • #17 main

Comment 1 Sebastian Dröge (slomo) 2012-09-25 10:57:41 UTC
Your element should have called gst_element_set_metadata(), it's not allowed to register (gst_element_register()) elements without the metadata.

We should add checks for that and fail if someone tries to do it.
Comment 2 Sebastian Dröge (slomo) 2012-09-25 11:10:19 UTC
Created attachment 225130 [details] [review]
plugin: Fail if no valid plugin metadata is set
Comment 3 Sebastian Dröge (slomo) 2012-09-25 11:10:26 UTC
Created attachment 225131 [details] [review]
elementfactory: Fail if no valid element factory metadata is set
Comment 4 Tim-Philipp Müller 2012-09-25 11:58:15 UTC
Maybe it should be g_warning() rather than GST_ERROR, since the latter is not necessarily printed at all when the debugging system is disabled, and isn't printed unless *:1 is use. Also, it's kind of a programming error in a way.
Comment 5 Sebastian Dröge (slomo) 2012-09-25 13:12:54 UTC
commit 24cad1a91cb8029017cc41a7288ba9a6728b2a9c
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue Sep 25 13:09:38 2012 +0200

    elementfactory: Fail if no valid element factory metadata is set

commit cfc7661f654f7a3ee1bbf479629569f555372fbf
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue Sep 25 13:09:28 2012 +0200

    plugin: Fail if no valid plugin metadata is set