1.3.17 reboot by strace

Thomas Koenig (Thomas.Koenig@ciw.uni-karlsruhe.de)
Fri, 11 Aug 1995 21:50:59 +0200 (CES)


I just rebooted a 1.3.17 kernel by doing a "strace perlscript" with the
following script (which I didn't write, somebody sent it to me to debug,
so no comments on style or usability, please :-)

There was no debugging info or kernel Oops printed that I could see;
the net connection just hung after Perl had done a brk(). Same
thing happened when I started this from a virtual console.

Vanilla 1.3.17 kernel, Perl 5.001m compiled for a.out.

#!/usr/bin/perl
pipe (CHILDREAD, PARENTWRITE);
pipe (PARENTREAD, CHILDWRITE);
select (CHILDWRITE); $| =3D 1;

$pid =3D fork;
if ($pid > 0) {
close(CHILDWRITE);
close(CHILDREAD);

print PARENTWRITE "A\n"; #send option to child process
while (<PARENTREAD>) {print;} #processing of child's output
print PARENTWRITE "Q\n"; #send quit command to child
return;
} else {
open(STDOUT, ">&CHILDWRITE");
open(STDIN, "<&CHILDREAD");
close(PARENTWRITE);
close(PARENTREAD);
system "trivial";
return;
}
-- =

Thomas K=F6nig, Thomas.Koenig@ciw.uni-karlsruhe.de, ig25@dkauni2.bitnet.
The joy of engineering is to find a straight line on a double
logarithmic diagram.