[comp.sys.ncr] vi/SIGPWR interaction in SVR3

jalsop@seachg.UUCP (John Alsop) (05/03/90)

As I understand things, most Tower applications software should be ignoring
the SIGPWR signal, as all the power recovery cleanup happens behind the
scenes.

It seems that in SVR3 on both the 4x0/6x0 and [357]00 versions, "vi" is not
ignoring this signal.  This causes strange behaviour when a power recovery
occurs and you are in a child process of vi.

To reproduce the problem:

   $ cd /tmp
   $ vi
   :!sh         	# start a subshell

   [ Next few lines are interaction with the sub-shell ]

   $ ps -f		# show process id's
     UID   PID  PPID  C   STIME   TTY  TIME COMMAND
   jalsop  3922     1  0 08:44:24    b  0:12 -csh
   jalsop  6988  3922  0 17:29:12    b  0:04 vi
   jalsop  7080  6988  0 17:36:55    b  0:00 sh

   [ Cause a SIGPWR either by turning the machine on and off, or sending a
     SIGPWR explicitly to the vi process]

   $ kill -19 6988

   [ At this point, vi wakes up, thinking that the sub-shell has finished.
     As a result, both vi and the shell start grabbing input from the tty at
     the same time, causing mass confusion.  You will most likely have to
     turn your terminal off and on to clear the situation.]

This problem does not occur on SVR2 (Release 2.01.01) nor does it occur
on SVR3 with programs that start a sub-shell using the system() call
(without enabling the SIGPWR signal).  Therefore I assume that vi has enabled
this signal on purpose.

Can anyone suggest why this is occurring, or possible ways to circumvent
the problem.