[comp.unix.wizards] UNIX-WIZARDS Digest V10#090

protin@pica.army.mil (Arthur W. Protin Jr.) (07/18/90)

In article <1277@tuewsd.win.tue.nl> wsinpdb@lso.win.tue.nl (Paul de Bra) writes:
   Sender: wsinpdb@win.tue.nl (Paul de Bra)
   Organization: Eindhoven University of Technology, The Netherlands
   Lines: 15

   In article <960004@teecs.UUCP> belkin@teecs.UUCP (Hershel Belkin) writes:
   >...
   >Every so often I fins a shell process (sh or ksh) which has somehow
   >become dis-associated with its logon session.  By this I mean that
   >the shell's PPID is "1", and the user is no longer logged on.
   >...

   This is the infamous trap/signal/eof bug, which I don't know exactly,
   but some combination of trapping and sending signals and having
   end-of-file on standard input causes an infinite loop in the Bourne
   and Korn shell, at least in some Unix versions which haven't fixed the bug.

   Anyone know the full scoop?

   Paul.

Probably not, but here is another piece of the puzzle that may be of some
help.  A couple of years ago, while at another company, we ported the Korn
shell to the SGI Personal Iris 4D/20.  We found many instances of the shell
running detached and soaking up so many cycles as to alarm us all.  The
problem was traced to a conflict of features.  The trigger was a remote
login session being disconnected.  We tuned in with the debugger in the
middle of the infinite loop.  Ksh would detect an error and "long jump"
to clean up.  In its clean up it tried to display a message, which would
fail.  Ksh would detect the error ...  The problem was that when errors
were detected on input/output operations the errno was checked for
recovery and/or to be ignored.  The errno on the 4D/20 for connection
loss was not a number that was special cased as meaning the loss of
controling terminal.  Thus, when I added that errno to the "if", the
problem was cured.

Arthur Protin
protin@pica.army.mil