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

Re: $^E bug and perl 5.8.0

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
November 19, 2003 08:44
Subject:
Re: $^E bug and perl 5.8.0
Message ID:
Pine.LNX.4.58.0311191144510.7503@sprite.sidhe.org
On Wed, 19 Nov 2003, Chris Nandor wrote:

> However, the code above is broken anyway, as Dan might point out, since
> $error_handler COULD contain syscalls, so I am modifying this particular
> code to set $^E right before the return, and use a lexical var for the
> other stuff.  That fixes the immediate problem, and it is more robust in
> case $error_handler does contain a syscall.

I was insufficiently pedantic -- it's not just system calls that can
change errno (just checked). Any C library function can do so. Including,
unfortunately, malloc. Luckily there's right-to-left ordering of
evaluation (more or less) so "$foo = $!;" will be OK. Anything fancier,
though, that could involve a function call (including plain
stringification) may not be. Bring on the Heisenbugs!

I think I'll take steps to make this less likely for Parrot, though I'm
not sure there's truly any good way to get around it anywhere but in the
actual application code.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | 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