weird behavior with 2.0.31-pre10

Ion Badulescu (ionut@moisil.cs.columbia.edu)
Wed, 1 Oct 1997 04:59:32 -0400 (EDT)


Hi,

I'm experiencing a very weird behavior from a simple perl script on a
system running 2.0.31-pre10. I'm not sure if it happens only with this
kernel, as I haven't rebooted yet.

More to the point: the script reads from stdin, line by line, and tries to
match a pattern; if it succeeds, it runs a system(...). If the command
executed is something as benign as a sleep(5), nothing unusual happens; if
the command is "ssh server command", the stdin of the script somehow
becomes "unreadable", so the next read() from libc returns 0 bytes. The
script runs with its stdin redirected from a file.

This is the significant part of the diff between the output of strace in
both cases:

fstat(0, {st_mode=S_IFREG|0664, st_size=60451, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40008000
read(0, "\nFrom ......., 4096) = 4096
fork() = 469
....
....
-read(0, "", 4096) = 0
-read(0, "", 4096) = 0
-sigprocmask(SIG_SETMASK, [], NULL) = 0
-_exit(0) = ?
+read(0, "cs.columbia.edu (8.8.5/8.6.6) id"..., 4096) = 4096
+fork() = 462
+...
+...

Any ideas? Am I missing something obvious?

Ionut

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.