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

Re: Trouble with PERLIO_INIT/PERLIO_TERM changes

Thread Previous | Thread Next
Jarkko Hietaniemi
November 30, 2006 03:20
Re: Trouble with PERLIO_INIT/PERLIO_TERM changes
Message ID:
> Why don't you have Foo.xs? It's in the test distro that I sent before, 
> along with the

Duh, yes, bad day yesterday.

>> Basically the thing with the PERLIO_DEBUG log is that open (and up)
>> increment the refcnt, close decrements it.  If they don't match,
>> something is internally wrong with perlio, or something bypassed
>> perlio.
> The debug.txt that I sent (did you get that alright?) makes only two 


> mentions of fd 4:
> refcnt_inc: fd 4 refcnt=1
> refcnt_dec: fd 4 refcnt=0
> so nothing looks like it doesn't match, and yet it still croaks with the 
> message:
> refcnt_dec: fd 4: 0 <= 0
> I'm guessing that the file was opened (inc refcnt to 1), then closed 
> (dec refcnt to 0) and then some attempt was made within PerlIO to close 
> it again (triggering the croak)?

That would make it, yes.  Maybe fire up a debugger and set a breakpoint
to the croak() in PerlIOUnix_refcnt_dec()?  Compare the stack trace with
the one if coming from a (Perl-level) close()?

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