CC: | Pierre Phaneuf <pierre.phaneuf [...] seanodes.com>, Erwan Velu <erwan.velu [...] seanodes.com> |
Subject: | [PATCH] Bug in bug-forks in END block |
Date: | Tue, 31 Oct 2006 18:25:51 +0100 |
To: | bug-forks [...] rt.cpan.org |
From: | Alban Crequy <alban.crequy [...] seanodes.com> |
Hello,
I have a bug on perl-forks-0.19 in the function _unblock_sigset(). When
reading the code of perl-forks-0.20, I think the bug is still present.
_unblock_sigset() may be called from the END block. In END blocks, the
variable $? is reserved for the return code. But POSIX::sigprocmask,
called from _unblock_sigset(), may change the variable $?, which is bad.
Symptoms without the attached patch:
My main function returns with "exit 42;" but perl returns 255.
With the attached patch, perl always returns with the value I setted in
the "exit" statement.
I'm not sure though that this patch is the right solution for this
problem.
$ perl -v, uname -a, distro
This is perl, v5.8.7 built for i386-linux
Linux alban 2.6.12-25mdk #1 Fri Aug 18 15:09:47 MDT 2006 i686 Intel(R)
Pentium(R) 4 CPU 2.80GHz unknown GNU/Linux
Mandriva Linux release 2006.0 (Official) for i586
Have a nice day,
Alban
Message body is not shown because sender requested not to inline it.