develooper Front page | perl.perl5.porters | Postings from April 2006

Garbage collection issues ("Segfault in functional streams")

Thread Next
From:
Christian
Date:
April 28, 2006 16:54
Subject:
Garbage collection issues ("Segfault in functional streams")
Message ID:
p04320426c077f6c34f86@[192.168.40.11]
Hello

There is something strange happening in function calls regarding the 
@_ array. In some circumstances it is keeping references to some data 
which means that data is not being destroyed as it should.

I've posted a bug report about functional streams leading to stack overflow at
http://guest:guest@rt.perl.org/rt3/Ticket/Display.html?id=39017

The things I'm wondering about:

- why do I have to undef $_[0], why is @_=() not enough to free the 
data? What's happening exactly on a function call with the @_ array?

- why am I seeing segfaults upon *cleanup*, not upon stack overflow? 
It seems that it's not the allocation which is using up stack space, 
but the destruction of data which does this (makes sense, since data 
is allocated from the heap, but the deallocation may be recursive). 
Is this guess true or is there something worse going on? Should I 
just run perl with a much higher stack limit (like several hundred 
MB) if I'm going to allocate deeply nested data structures?

Thanks,
Christian.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About