develooper Front page | perl.perl5.porters | Postings from January 2020

Re: 'system' anomaly in perl-5.8.9

Thread Previous | Thread Next
Zefram via perl5-porters
January 26, 2020 04:38
Re: 'system' anomaly in perl-5.8.9
Message ID:
James E Keenan wrote:
>Then, running via a 'system' call from each of the executables
>results in a value of '$?' of '134' for all versions except 5.8.9, where the
>value of '$?' is '6'.

The difference is the bit that indicates whether the child process
dumped core.  In order to see any difference here, one must have core
dumps enabled.  If they are disabled (typically via resource limits),
all perl versions yield 6.  In my tests I get 134 on all versions except
5.8.9, 5.9.{3..5}, and 5.10.0, for each of which I get 6.  Core is
actually dumped on all perl versions, and the status returned to the
parent perl via the syscall indicates so.

perl5101delta lists, as a fixed bug, "On some UNIX systems,
the value in C<$?> would not have the top bit set (C<$? & 128>)
even if the child core dumped.".  Looking at the git logs, this
bug apparently never had an RT ticket, but was fixed by commit
de8ca8af19546d4922bab4537a72c9b2b3354009, copied into the 5.10 maint
track in commit 9335ce6b110b7036bf83488f121dc5841ab916b7.  I haven't
identified which commit introduced it.


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