Re: Linux has a broken shutdown syscall!

kstar@chapin.edu
Tue, 28 Apr 1998 17:19:35 -0400 (EDT)


Perry Harrington said:
> Andy Dougherty said:
> > Hmm. This is going to be tricky for Perl to deal with. I imagine we can
> > safely assume that 2.0.x kernels are going to be in widespread use for
> > quite a while (since they generally work so well). I could have Perl's
> > Configure detect and deal with this at build time, but since it is common
> > for folks to distribute Linux binaries, we can't assume that perl will
> > always run on the same kernel under which it was built.
> >
> > I'm open to suggestions.

At compile time, test the condition via Configure, and patch
perl's shutdown() to add 1 to the ``how'' parameter (don't just
swap 0 and 1, that's not the bug).

At runtime, only if the ``add 1'' patch is compiled in and taint
mode is off, check the environment variable PERL_SHUTDOWN_FIX; if
it's a non-empty string (such as ``NO''), turn off the patch.

This lets people build correctly-functioning perls, on buggy
(currently more common, IMO) Linux boxes, which can be patched to
work on very-new, non-buggy Linuces. Thus, the onus is on people
who use development or really-recent kernels, and who also want to
install pre-compiled perls based on older kernels; my sense is that
this savvy group will be willing to exert the extra effort.

Add some documentation (to README?), warning people of the
temperature of the water in their vicinity.

> Do the 'uname' system call and look at the version number at runtime. Have 2
> configuration variables which contain the shutdown states. If you detect
> strncmp(utsname.release,"2.0",3)==0 then set it up for the munge, else
> make it right. This can all just be an #ifdef to please the clean code guys.

The bug is fixed in 2.1.x (for some unknown-to-me value of x)
and, based on a Usenet search, has some likelihood of making it
into 2.0.34 -- scanning for "2.0" is probably not sufficient.

Peace,
* Kurt Starsinic (kstar@isinet.com) ------------------ Technical Specialist *
| "Beware of bugs in the above code; I have only |
| proved it correct, not tried it." - Donald Knuth |
Institute for Scientific Information http://www.isinet.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu