Opened 2 years ago

Closed 2 years ago

#1107 closed Bug Report (fixed)

lilv_state_new_from_string crash with simple preset

Reported by: falkTX Owned by: dave
Priority: major Component: Lilv
Keywords: Cc:

Description

I have the following state, generated by lilv_state_to_string:

@prefix lv2:  <http : //lv2plug. in/ns/lv2core#> .
@prefix pset: <http : //lv2plug. in/ns/ext/presets#> .
@prefix rdfs: <http : //www.w3. org/2000/01/rdf-schema#> .

<http : //distrho.sf. net/plugins/3BandEQ#preset001>
        a pset:Preset ;
        lv2:appliesTo <http : //distrho.sf. net/plugins/3BandEQ> ;
        rdfs:label "Default" ;
        lv2:port [
                lv2:symbol "high" ;
                pset:value 0.0
        ] , [
                lv2:symbol "low" ;
                pset:value 0.0
        ] , [
                lv2:symbol "low_mid" ;
                pset:value 220.0
        ] , [
                lv2:symbol "master" ;
                pset:value 0.0
        ] , [
                lv2:symbol "mid" ;
                pset:value 0.0
        ] , [
                lv2:symbol "mid_high" ;
                pset:value 2000.0
        ] .

(I added the prefixes just in case).

Calling lilv_state_new_from_string with that state string results in a crash.

I need to get lilv built with debug on, but so far I got this result in gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffef0d4160 in sord_node_get_string () from /Shared/Personal/FOSS/GIT/MOD/mod-app/source/modules/mod-ui/mod/../utils/libmod_utils.so
(gdb) bt
#0  0x00007fffef0d4160 in sord_node_get_string () from /Shared/Personal/FOSS/GIT/MOD/mod-app/source/modules/mod-ui/mod/../utils/libmod_utils.so
#1  0x00007fffef0c6ce0 in new_state_from_model () from /Shared/Personal/FOSS/GIT/MOD/mod-app/source/modules/mod-ui/mod/../utils/libmod_utils.so
#2  0x00007fffef0c7054 in lilv_state_new_from_string () from /Shared/Personal/FOSS/GIT/MOD/mod-app/source/modules/mod-ui/mod/../utils/libmod_utils.so
#3  0x00007fffef0b6a20 in get_state_port_values (
    state=0x130c7e0 "\n@prefix lv2:  <http : //lv2plug. in/ns/lv2core#> .\n@prefix pset: <http : //lv2plug. in/ns/ext/presets#> .\n@prefix rdfs: <http : //www.w3. org/2000/01/rdf-schema#> .\n\n<http : //distrho.sf. net/plugins/3BandEQ#pre"...) at utils_lilv.cpp:2879

And with valgrind:

==6512== Invalid read of size 8
==6512==    at 0xF81C160: sord_node_get_string (in /Shared/Personal/FOSS/GIT/MOD/mod-app/source/modules/mod-ui/utils/libmod_utils.so)
==6512==    by 0xF80ECDF: new_state_from_model (in /Shared/Personal/FOSS/GIT/MOD/mod-app/source/modules/mod-ui/utils/libmod_utils.so)
==6512==    by 0xF80F053: lilv_state_new_from_string (in /Shared/Personal/FOSS/GIT/MOD/mod-app/source/modules/mod-ui/utils/libmod_utils.so)
...
==6512== Process terminating with default action of signal 11 (SIGSEGV)
==6512==  Access not within mapped region at address 0x0

Seems like a null pointer de-reference somewhere.

Attachments (1)

state-new-fix.patch (505 bytes) - added by falkTX 2 years ago.

Download all attachments as: .zip

Change History (3)

Changed 2 years ago by falkTX

comment:1 Changed 2 years ago by falkTX

Attached file seems to fix this.

comment:2 Changed 2 years ago by dave

  • Resolution set to fixed
  • Status changed from new to closed

Applied in r5809, thanks.

Note: See TracTickets for help on using tickets.