develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [perl #75556] segfault in PerlIOBuf_fill when filehandle is closed in a signal handler

Thread Next
From:
Father Chrysostomos
Date:
July 25, 2010 13:02
Subject:
Re: [perl #75556] segfault in PerlIOBuf_fill when filehandle is closed in a signal handler
Message ID:
0B55D7C7-6F03-40D2-8B9D-91417B0DBA86@cpan.org
> PerlIOUnix_read has a loop which makes a blocking read, and calls
> PERL_ASYNC_CHECK() if the read is interrupted by a signal.
> 
> Once PERL_ASYNC_CHECK() has returned, the pointers "f" and "buf"
> in PerlIOUnix_read are pointing to freed space, which looks fairly
> simple to detect and handle. Similar bugs also need fixing
> elsewhere in perlio.c.

I don’t know a lot about C, but I think that the freed memory could be re-used for something else, in which case checking that it has been freed (how do you do that, BTW?) will not be reliable. (Someone please correct me if I’m wrong.) Maybe we need some sort of refcounting mechanism for PerlIOl’s. How much of the PerlIO API is public?


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