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

Garbage collection issues ("Segfault in functional streams")

Thread Next
April 28, 2006 16:54
Garbage collection issues ("Segfault in functional streams")
Message ID:

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

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?


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About