[comp.bugs.4bsd] abort

gww@marduk.UUCP (Gary Winiger) (09/05/87)

Subject: abort(3) returns to user. +fix
Index:	libc/gen/abort.c 4.3BSD

Description:
	When abort is called, it may return to the user and continue
	processing before core is dumped.
Repeat-By:
	Run a program that calls abort(3) on a multiprocessor system where
	the kernel process is on a different cpu from the user process.
	Examine the core dump stack trace with adb and notice that the
	program has continued to run after abort was called.
Fix:
	It is possible for the user process calling abort() to continue
	after the abort before the kernel process gets it stopped.
	Add code to abort to wait for the kill signal to occur.

	The attached code modification solves this problem at Elxsi.

Gary..
{ucbvax!sun,lll-lcc!lll-tis,amdahl!altos86,bridge2}!elxsi!gww
--------- cut --------- snip --------- :.,$w diff -------------
*** /tmp/,RCSt1001187	Thu Jun 18 17:56:07 1987
--- abort.c	Thu Jun 18 17:55:11 1987
***************
*** 1,5 ****
--- 1,8 ----
  /*
   * $Log:	abort.c,v $
+  * Revision 1.2  87/06/18  17:54:12  gww
+  * Guarantee abort doesn't return to user.
+  * 
   * Revision 1.1  87/01/15  15:35:03  gww
   * Initial revision
   * 
***************
*** 11,17 ****
   */
  
  #if defined(LIBC_SCCS) && !defined(lint)
! static char *ERcsId = "$Header: abort.c,v 1.1 87/01/15 15:35:03 gww Exp $ ENIX BSD";
  static char sccsid[] = "@(#)abort.c	5.3 (Berkeley) 3/9/86";
  #endif LIBC_SCCS and not lint
  
--- 14,20 ----
   */
  
  #if defined(LIBC_SCCS) && !defined(lint)
! static char *ERcsId = "$Header: abort.c,v 1.2 87/06/18 17:54:12 gww Exp $ ENIX BSD";
  static char sccsid[] = "@(#)abort.c	5.3 (Berkeley) 3/9/86";
  #endif LIBC_SCCS and not lint
  
***************
*** 25,28 ****
--- 28,32 ----
  	signal(SIGILL, SIG_DFL);
  	sigsetmask(~sigmask(SIGILL));
  	kill(getpid(), SIGILL);
+ 	sigpause(~sigmask(SIGILL));
  }