how to exit from a signal routine

Bob Lenk rml at hpfcdc.HP.COM
Sat Jul 8 07:38:39 AEST 1989


> No -- The Standard doesn't create the problem, it merely documents it.

Yes!  As a common example, if the signal interrupts a malloc() call in
most implementations, malloc() may have static data structures in an
inconsistent state.  If the signal handler calls longjmp(), and some
code later calls malloc() or one of its friends, the standard's
description of "undefined behavior" applies quite well on any UN*X
implementation I know of.  Programs that work in these environments may
be avoiding malloc() and other troublesome routines by design (based on
knowledge of what routines are safe in this regard) or by luck, or they
may really have the problem but never (or rarely) encounter it.

		Bob Lenk
		rml at hpfcla.hp.com
		hplabs!hpfcla!rml



More information about the Comp.std.c mailing list