[comp.windows.x] signals and X

NEVILLE@20cvx1.draper.COM (08/12/89)

Hi,
	I know this may have discussed before but....

	Is it bad to Trap signals like this in an X program ?

	void zombie_ast(signum)
	int signum;
	{
		wait();
		signal(SIGCHLD,zombie_ast);
	}

	We are doing this to get rid of defunct processes
and it works until we try to use X program we wrote.  This is
BAD.  It crashes with a memory fault core dumped.

	Is there a better way to do this ?

	We use an HP/9000 360 with UNIX 6.5 (SYS V)
and X11r3.  The program uses widgets.

				Thanks In Advance,	
				George

rws@EXPO.LCS.MIT.EDU (08/14/89)

You don't give any clue to where the program is crashing (when will people ever
learn to provide this kind of information?), so it's rather difficult to give an
explanation.  But, if you're trying to use the MIT Xlib implementation in an
environment with System V signal semantics (particularly as they apply to the
write system call), you're in for real problems.  System V signals are awful to
deal with, and we don't claim that R3 works in that environment.  If that isn't
your problem, then you'll have to provide more information.

dyer@spdcc.COM (Steve Dyer) (08/15/89)

Post V6-wait() takes a pointer as an argument.  Calling wait()
without any arguments will use whatever garbage is on the stack as a
pointer.  ==> core dump


-- 
Steve Dyer
dyer@ursa-major.spdcc.com aka {ima,harvard,rayssd,linus,m2c}!spdcc!dyer
dyer@arktouros.mit.edu

rjh@hare.udev.cdc.com (rj huebsch) (12/18/90)

Background info:  Using X11R4  Xt & Xaw

I have an X client that is basically a "current configuration" display. 
Whenever
the configuration changes, the client is sent a signal (SIGUSR1) to reread the 
configuration and update the display.

Problem:  Although the client is getting the signal, the client display isn't
          updated until the client receives pointer focus.

BTW,  this worked at X11R3


Please respond via e-mail and I'll summarize if there's interest.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rick Huebsch                  E-mail:  rjh@udev.cdc.com
Control Data Corporation      AT&T:    (612) 482-3544