[redland] Perl method Stream->end is corrupt
Dave Beckett
dave.beckett at bristol.ac.uk
Thu Jan 11 14:50:22 GMT 2001
>>>Stefan Meinert said:
> Hello!
> I'm still having problems using your Perl-API. Sometimes the method
> Stream->end crashes ($Stream is not empty, but calling end leads to
> a segmentation fault). I'm using perl 5.005_03 on a linux
> machine. Perhaps you can try the following examples on your machine
> to see if you get the same error. Example t2.pl crashes, while
> t3.pl works fine.
The bug isn't in stream; your examples mix buffered output of
stdout (print "hallo"), and buffered output of stderr (warn
"...") so the actual error isn't there.
After more checking, I get both your examples to die for me and the
reason is Perl's funky global object destruction. It manages to
sometimes delete internal Redland objects before they are properly
closed at the Perl level. There doesn't seem to be a good way around
this that I can see so far. The only solution I can suggest is to
ignore all Redland object destructions and leak memory like mad.
My programs don't seem to demonstrate this, however since I delete
objects in the reverse order of creation, use local variables and
don't just end code with 'exit'. I'm not quite sure why, maybe under
more controlled destruction of objects, things work better.
I'll investigate more
Dave
More information about the redland-dev
mailing list