Hi!

I've built a debug version of librdf and found the following code:

librdf_parser_raptor_constructor (world=0x877e5a0) at
rdf_parser_raptor.c:1328
1328        syntax_name = desc->names[0];
(gdb) bt
#0  librdf_parser_raptor_constructor (world=0x877e5a0)
    at rdf_parser_raptor.c:1328
#1  0xb65b27bd in librdf_init_parser (world=0x877e5a0) at rdf_parser.c:55
#2  0xb65a3ca5 in librdf_world_open (world=0x877e5a0) at rdf_init.c:303
#3  0xb64e739c in slv2_world_new () from /usr/lib/libslv2.so.9
#4  0xb7f6b3a9 in ARDOUR::LV2World::LV2World() ()
   from /usr/lib/ardour2/libardour.so
#5  0xb7eaefd4 in ARDOUR::PluginManager::PluginManager() ()
   from /usr/lib/ardour2/libardour.so
#6  0xb7e5a184 in ARDOUR::init(bool, bool) ()
   from /usr/lib/ardour2/libardour.so
#7  0x08165255 in ARDOUR_UI::ARDOUR_UI(int*, char***) ()
#8  0x08392e5b in main ()
(gdb) frame 0
#0  librdf_parser_raptor_constructor (world=0x877e5a0)
    at rdf_parser_raptor.c:1328
1328        syntax_name = desc->names[0];
(gdb) list
1323        if(!desc) {
1324          /* reached the end of the parsers, now register the
default one */
1325          i = 0;
1326          desc =
raptor_world_get_parser_description(world->raptor_world_ptr, i);
1327        }
1328        syntax_name = desc->names[0];
1329        syntax_label = desc->label;
1330        if(desc->mime_types)
1331          mime_type = desc->mime_types[0].mime_type;
1332        if(desc->uri_strings)
(gdb) p desc
$1 = (const raptor_syntax_description *) 0x0


This code has been added after librdf0-1.0.10 for librdf-1.0.11.
Obviously, description is NULL, and dereferencing it causes the
segfault.

I wonder if raptor_world_get_parser_description should have returned
something different. I cannot judge if it's something big or if a simple
NULL pointer check  in librdf_parser_raptor_constructor would be enough,
maybe also using the old code from 1.0.10 in case of desc==NULL.

Dajobe, I guess we could use your input here. ;)

JFTR, this is the initialization code in libslv2:

SLV2World
slv2_world_new()
{
        SLV2World world = (SLV2World)malloc(sizeof(struct _SLV2World));

        world->world = librdf_new_world();
        if (!world->world) {
                free(world);
                return NULL;
        }

        world->local_world = true;

        librdf_world_open(world->world);

        return slv2_world_new_internal(world);
}


Cheers



_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to