[redland-dev] Redland 1.0.1 Segfault

Dave Beckett dave.beckett at bristol.ac.uk
Wed Jun 1 15:54:28 BST 2005


On Mon, 30 May 2005 21:31:18 -0400, crschmidt at crschmidt.net (Christopher Schmidt) wrote:

> List - 
> 
> I just compiled the new Redland (1.0.1) and Redland Bindings (1.0.1.1).
> I attempted to run julie on this new setup, and ran into a Segfault on
> a query:
> 
> #1  0x40649473 in librdf_free_stream (stream=0x82295f8) at rdf_stream.c:123
> #2  0x4064d178 in rasqal_redland_finish_triples_match (rtm=0x0, 
>     user_data=0x8229518) at rdf_query_rasqal.c:424
> #3  0x4066e2a6 in rasqal_free_triples_match (rtm=0x82165a0)
>     at rasqal_engine.c:465

These last two lines are suspicious, as the functions call each other
directly but the inner one has lost the rtm object pointer even
though rasqal_free_triples_match just used rtm->finish to get the
address of the rasqal_redland_finish_triples_match function.

I've seen this before and it usually happens when you are calling a
newer or older library (rasqal in this case) than you originally
compiled redland against.  Or it's memory corruption and gdb gets
confused.


> Another example script:
> 
> import wrapper as w
> m = w.get_model()
> import RDF
> for i in m.find_statements(RDF.Statement(None, None, RDF.Node("crschmidt"))):
>     print i
> 
> crashes with a simpler backtrace:
> #0  0x00000000 in ?? ()
> #1  0x40599473 in librdf_free_stream (stream=0x81e4a80) at
> rdf_stream.c:123
> #2  0x405728ea in _wrap_librdf_free_stream (self=0x0, args=0x0)
>     at Redland_wrap.c:6733

again this looks crazy.  python passes in NULL pointers and they
magically turn into a stream pointer in the called process.

> I checked the lines, and they all seem to match up to the new code.
> Additionally, errors like these are confirmed by kasei on his machine.
> I'm not sure exactly what the problem is here: I'm running against
> Rasqal 0.9.9 and Raptor 1.4.6. Any pointers to things I may be messing
> up would be helpful.

I tried to write a self contained small example of this and got no
crash whatever I tried.  Can you give me something with sample data
that doesn't involve 'wrapper'?

Dave


More information about the redland-dev mailing list