Bug in wait4 ?

Andreas Degert (ad@papyrus.hamburg.com)
01 Apr 1997 14:50:32 +0200


Hello,

I'm experiencing strange problems when trying to run latex from a
printer filter script.

It works correctly when I start the filter script directly from my
shell account. latex uses the kpathsea library and starts MakeTeXTeX
as a child process.

When it's started from the printer filter, MakeTeXTeX is run, but
latex stopps with 'No child process', that should be an ECHILD return
from wait4, meaning there is no such child pid. The latex-process is
definitely waiting for MakeTeXTeX, as can be seen when i put a
"sleep 10" into the MakeTeXTeX-script.

When I try to strace the process (latex) when run through lpd, it
hangs after some KB of output (but strace-ing works when starting the
filter-script from my shell). strace has status S, waiting in wait4,
and latex has status T, waiting in syscall_trace.

This was on kernel 2.0.27 / libc.so.5.4.20 / strace 3.1 (Debian
distribution 1.2), but i've experienced it with other kernel versions
too.

Any Idea what is happening, or what I could test/try next? latex is
quite big, and i didn't want to get the sources and compile it with
some debug statements before asking in the list (and i don't know how
to reproduce this strange behaviour with other programs).

thanks

Andreas