[comp.sys.sun] Problems with pause

wolfrum@perm.fmi.uni-passau.de (' Michael Wolfrum ') (04/27/91)

I'm programming a big program system as a SunVIEW application with several
concurrent processes communicating via pipes and signals.

The program system ran fine under the old SunOS 4.0.3. But under the new
SunOS 4.1.1 it lost one of the basic properties of algorithms. Now it does
not terminate in a finite time.

Debugging led me to the realization that the pause() does not terminate
correctly. Manual tells me that pause() should terminate upon termination
of a signal handler routine. In my case one process is executing the
pause() and waiting for a SIGUSR1 signal. Then another process sends the
SIGUSR1 and the signal handler routine is entered, executed and
terminated. So control goes back to pause() but it does not terminate now.
I checked whether there occurs another signal while executing the handler,
but this is not the case.  Thereby I finally came to the conclusion that
the pause() could have a bug under 4.1.1. Strangely enough is moreover the
fact that I can skip this bug by sending another SIGUSR1 from a shell to
the blocking process (kill -SIGUSR1 pid). Doing that causes the blocked
process to continue with execution.

If anyone out there have a similar experience or even better a solution
for my problem, I would be very glad to hear about.

                                Michael Wolfrum
                                e-mail: wolfrum@perm.fmi.uni-passau.de