Closed p5pRT closed 20 years ago
David\,
Do you still maintain Sys::Hostname? If so\, I would like to bring a problem to your attention.
On FreeBSD\, the following hangs forever with an infinate loop in sh.
perl -MSys::Hostname -e '$SIG{"CHLD"} = "IGNORE"; hostname();'
The fix is pretty simple: make $SIG{CHLD} local.
retrieving revision 1.1.1.1 diff -c -r1.1.1.1 Hostname.pm *** Hostname.pm 1998/09/09 06:59:55 1.1.1.1 --- Hostname.pm 1999/06/20 22:59:51 *************** *** 94\,99 **** --- 94\,100 ---- # method 3 - trusty old hostname command || eval { local $SIG{__DIE__}; + local $SIG{CHLD}; $host = `(hostname) 2>/dev/null`; # bsdish }
This is a bug report for perl from muir@idiom.com\, generated with the help of perlbug 1.26 running under perl 5.00502.
David\,
Do you still maintain Sys::Hostname? If so\, I would like to bring a problem to your attention.
On FreeBSD\, the following hangs forever with an infinate loop in sh.
perl -MSys::Hostname -e '$SIG{"CHLD"} = "IGNORE"; hostname();'
The fix is pretty simple: make $SIG{CHLD} local.
retrieving revision 1.1.1.1 diff -c -r1.1.1.1 Hostname.pm *** Hostname.pm 1998/09/09 06:59:55 1.1.1.1 --- Hostname.pm 1999/06/20 22:59:51 *************** *** 94\,99 **** --- 94\,100 ---- # method 3 - trusty old hostname command || eval { local $SIG{__DIE__}; + local $SIG{CHLD}; $host = `(hostname) 2>/dev/null`; # bsdish }
This is a bug report for perl from muir@idiom.com\, generated with the help of perlbug 1.26 running under perl 5.00502.
David\,
Do you still maintain Sys::Hostname? If so\, I would like to bring a problem to your attention.
On FreeBSD\, the following hangs forever with an infinate loop in sh.
perl -MSys::Hostname -e '$SIG{"CHLD"} = "IGNORE"; hostname();'
The fix is pretty simple: make $SIG{CHLD} local.
retrieving revision 1.1.1.1 diff -c -r1.1.1.1 Hostname.pm *** Hostname.pm 1998/09/09 06:59:55 1.1.1.1 --- Hostname.pm 1999/06/20 22:59:51 *************** *** 94\,99 **** --- 94\,100 ---- # method 3 - trusty old hostname command || eval { local $SIG{__DIE__}; + local $SIG{CHLD}; $host = `(hostname) 2>/dev/null`; # bsdish }
This is a bug report for perl from muir@idiom.com\, generated with the help of perlbug 1.26 running under perl 5.00502.
Isn't this illustrative of a more general problem of mixing zombies\, sig kids\, explicit reapers\, and backticks? (And maybe pipe opens). I don't think we've ever enumerated precisely what is safe to do in a module with respect to process management to avoid interfering with Perl internals\, the main program\, or other modules. A list of "dos and don'ts"\, would be great to have\, perhaps even something checkable semi-automatically for CPAN and Core modules.
--tom
* Isn't this illustrative of a more general problem of mixing zombies\, * sig kids\, explicit reapers\, and backticks? (And maybe pipe opens). * I don't think we've ever enumerated precisely what is safe to do in a * module with respect to process management to avoid interfering with * Perl internals\, the main program\, or other modules. A list of "dos * and don'ts"\, would be great to have\, perhaps even something checkable * semi-automatically for CPAN and Core modules.
Is that backwards? I would tend to think that the CPAN and Core modules should insulate themselves from things that other programmers rather than trying to document gotchas like:
Don't change $SIG{CHLD} if you use Sys::Hostname or anything that uses Sys::Hostname like ...
Much better IMHO to fix Sys::Hostname so that it always works.
That said\, there are things that module writers should not need to worry about. I was going to say "like changing $[\," but that was fixed by making it file-scoped.
-Dave
Is that backwards? I would tend to think that the CPAN and Core modules should insulate themselves from things that other programmers rather than trying to document gotchas like:
Don't change $SIG{CHLD} if you use Sys::Hostname or anything that uses Sys::Hostname like ...
Much better IMHO to fix Sys::Hostname so that it always works.
That's what I meant for us to go look for.
--tom
fixed in perl 5.6.0
fixed in perl 5.6.0
Migrated from rt.perl.org#892 (status was 'resolved')
Searchable as RT892$