[redland-dev] Perl: Double-free when parsing Turtle data / Compile problem

René Puls rpuls+lists at kcore.de
Mon Aug 23 00:27:19 BST 2004


Hi,

I get a double-free error message when I try to parse some RDF data
in Turtle format using the Perl bindings. Sample script:

--- cut here ---

#!/usr/bin/perl -w

use RDF::Redland;

my $storage = new RDF::Redland::Storage("hashes", "test",
                           "new='yes',hash-type='memory'");
my $model = new RDF::Redland::Model($storage, "");
my $parser = new RDF::Redland::Parser("turtle");
my $base_uri = new RDF::Redland::URI('http://foo/');

my $input = q{
@prefix ex: <http://example.com/> .
ex:foo ex:bar _:baz .
};

# double-free error message appears after this line:
$parser->parse_string_into_model($input, $base_uri, $model);

--- cut here ---

The error message (on OS X 10.3.5) is:
*** malloc[10867]: error for object 0x1af7b0: Double free

I can duplicate this error message as often as I want by duplicating
the second line (the only statement) in $input. (That is, if I have two
of these statements, I also get two double-frees.)

This seems to be related to anonymous nodes in Turtle (e.g. _:somename),
but it does not happen when I run the same input data through the
"rapper" utility.

Also, the script does not actually crash, it just prints these messages
but otherwise seems to work correctly.

I am using redland-0.9.18 and redland-bindings-0.9.18.1.

Kind regards,
René Puls

PS: I forgot to report this earlier, but redland-bindings-0.9.18.1 does
not compile correctly on OS X. Compilation of both Perl and Python 
bindings (I haven't tested the others) aborts with the error message:

/bin/sh: line 1: swig: command not found

(As a quick-and-dirty fix, I have simply removed the offending target in 
the Makefile; it looks like Swig is only necessary when you want to 
regenerate some of the bindings code...)



More information about the redland-dev mailing list