Bug#634070: composite sampler segfault

Gabriel Beddingfield gabrbedd at gmail.com
Sun Jul 17 04:58:58 UTC 2011


On 07/16/2011 10:01 AM, Benoît Delcour wrote:
> lv2_jack_host http://gabe.is-a-geek.org/composite/plugins/sampler/1
> URI:    http://gabe.is-a-geek.org/composite/plugins/sampler/1
> Plugin Name:    Composite Sampler
> JACK Name:      Composite Sampler
> Connected to JACK.
> Successfully instantiated plugin.
> Erreur de segmentation

I built SLV2 with debug symbols, and here's what I get for a backtrace. 
  Long story short:  this is an SLV2 bug.

(Edited for brevity)
$ gdb /usr/bin/lv2_jack_host
(gdb) set args http://gabe.is-a-geek.org/composite/plugins/sampler/1
(gdb) run
Starting program: /usr/bin/lv2_jack_host 
http://gabe.is-a-geek.org/composite/plugins/sampler/1
[Thread debugging using libthread_db enabled]
URI:	http://gabe.is-a-geek.org/composite/plugins/sampler/1
Plugin Name:	Composite Sampler
JACK Name:	Composite Sampler
[New Thread 0xb7fdfb70 (LWP 14386)]
Connected to JACK.
[New Thread 0xb75a4b70 (LWP 14389)]
Successfully instantiated plugin.
Set volume to 1.000000
[New Thread 0xb6bffb70 (LWP 14390)]

Program received signal SIGSEGV, Segmentation fault.
0x0804937a in uri_to_id (callback_data=0x0, map=0x0, uri=0xa51980 
"http://lv2plug.in/ns/ext/midi#MidiEvent")
     at ../hosts/lv2_jack_host.c:80
80		if (!strcmp(map, LV2_EVENT_URI) && !strcmp(uri, SLV2_EVENT_CLASS_MIDI))
(gdb) bt
#0  0x0804937a in uri_to_id (callback_data=0x0, map=0x0, uri=0xa51980 
"http://lv2plug.in/ns/ext/midi#MidiEvent")
     at ../hosts/lv2_jack_host.c:80
#1  0x00a4fc12 in Composite::Plugin::EngineLv2::_activate (this=0x80b5920)
     at /home/gabriel/code/composite/composite/src/sampler/EngineLv2.cpp:173
#2  0x00a5028d in Composite::Plugin::EngineLv2::activate 
(instance=0x80b5920)
     at /home/gabriel/code/composite/composite/src/sampler/EngineLv2.cpp:77
#3  0x08049bb5 in slv2_instance_activate (argc=2, argv=0xbffff004) at 
../slv2/plugininstance.h:128
#4  main (argc=2, argv=0xbffff004) at ../hosts/lv2_jack_host.c:203
(gdb) list
75	uint32_t
76	uri_to_id(LV2_URI_Map_Callback_Data callback_data,
77	          const char*               map,
78	          const char*               uri)
79	{
80		if (!strcmp(map, LV2_EVENT_URI) && !strcmp(uri, SLV2_EVENT_CLASS_MIDI))
81			return MIDI_EVENT_ID;
82		else
83			return 0; // no id for you!
84	}
(gdb)

The docs for the uri-map extension clearly say that the `map` parameter 
may be null.[1]  However, if you pass a null to strcmp it will segfault. 
  Looks like checking for (map == 0) is the fix.

Thanks,
Gabriel

[1] http://lv2plug.in/ns/ext/uri-map/ (see uri-map.h)





More information about the pkg-multimedia-maintainers mailing list