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 602528 - lv2: vocoder plugin breaks gstreamer
lv2: vocoder plugin breaks gstreamer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other Cygwin
: Normal normal
: 0.10.18
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-20 19:31 UTC by Yaakov Selkowitz
Modified: 2010-01-25 09:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Yaakov Selkowitz 2009-11-20 19:31:13 UTC
If the LV2 vocoder plugin[1] is installed, the GStreamer lv2 plugin causes segfaults:

(gst-inspect-0.10:5756): GLib-GObject-CRITICAL **: g_param_spec_internal: assertion `(name[0] >= 'A' && name[0] <= 'Z') || (name[0] >= 'a' && name[0] <= 'z')' failed

Program received signal SIGSEGV, Segmentation fault.
0x547cdd35 in g_param_spec_float () from /usr/bin/cyggobject-2.0-0.dll

The problem appears to be in the LV2 plugin's name (http://home.gna.org/lv2vocoder/1), the last element of which is simply "1" (the plugin version).  Compare this to the swh-plugins, where the last element is the plugin name.

The slv2 tools have no problem with this plugin, so this appears to be a legitimate plugin which GStreamer needs to better handle.

[1] http://download.gna.org/lv2vocoder/
Comment 1 Yaakov Selkowitz 2009-11-22 03:53:28 UTC
Looked into this further.

The problem is actually with the lv2:symbol properties in the vocoder plugin:

$ grep :symbol /usr/lib/lv2/vocoder.lv2/vocoder.ttl
    lv2:symbol "formant";
    lv2:symbol "carrier";
    lv2:symbol "output";
    lv2:symbol "active";
    lv2:symbol "150";
    lv2:symbol "255";
    lv2:symbol "360";
    lv2:symbol "465";
    lv2:symbol "600";
    lv2:symbol "738";
    lv2:symbol "907";
    lv2:symbol "1k1";
    lv2:symbol "1k3";
    lv2:symbol "1k6";
    lv2:symbol "2k";
    lv2:symbol "2k5";
    lv2:symbol "3k1";
    lv2:symbol "3k8";
    lv2:symbol "4k7";
    lv2:symbol "5k8";

The crash occurs immediately during processing the "150" port. gst_lv2_class_get_param_name() returns the :symbol property as a gchar*, which gst_lv2_class_get_param_spec then passes as the name argument to  g_param_spec_float().  The gtk-docs for that function point to g_param_spec_internal(), which states[1] (emphasis mine):

"""A property name consists of segments consisting of ASCII letters and digits, separated by either the '-' or '_' character. The first character of a property name MUST BE A LETTER. Names which violate these rules lead to undefined behaviour."""

But it turns out that is quite close to the lv2:symbol spec[2]:

"""A short name used as a machine and human readable identifier. The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9."""

The difference being that an lv2:symbol can begin with an underscore, whereas apparently a GParamSpec->name cannot.  So while it seems that the vocoder plugin is nonconformant, this does expose valid issues, namely:

* leading underscores in lv2:symbol, which are permitted, need to be mangled for conformance with GParamSpec->name limitations;

* nonconformant ports need to be handled or ignored so as to not crash. (Almost sounds like a security issue, doesn't it?)

[1] http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#g-param-spec-internal
[2] http://lv2plug.in/ns/lv2core/#symbol
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-01-25 09:55:06 UTC
commit faa007d4b0f3f25baf5cc6e3bc3bfffb2f2744de
Author: Stefan Kost <ensonic@users.sf.net>
Date:   Mon Jan 25 11:36:48 2010 +0200

    lv2: create valid gobject property names. Fixes #602528
    
    We cannot use the names as we get them from lv2 for the gparamspec name, only
    for nick/blurb. Apply same algorithms like elsewhere (ladspa) for name.