Subject: pkg/10801: unproven-pthreads fails to wrap vfork (includes patch)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rhialto@polderland.nl>
List: netbsd-bugs
Date: 08/10/2000 04:16:14
>Number:         10801
>Category:       pkg
>Synopsis:       unproven-pthreads fails to wrap vfork
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 10 04:17:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Rhialto
>Release:        pkgsrc as of some days ago <NetBSD-current source date>
>Organization:
	
>Environment:
	
System: NetBSD azenomei.falu.nl 1.4.1 NetBSD 1.4.1 (AZENOMEI) #27: Wed Jun 14 01:41:57 CEST 2000 rhialto@azenomei.falu.nl:/usr/src/sys/arch/alpha/compile/AZENOMEI alpha


>Description:
	
	I built a thread-aware python with unproven-pthreads.
	Subprocesses started to get SIGVTALRM signals.
>How-To-Repeat:
	
	Attempt to install Mojo Nation (see www.mojonation.net).
>Fix:

"config.h" is needed for HAVE_VFORK.
<sys/syscall.h> is needed for SYS___vfork14.

Maybe we should even wrap vfork() *and* __vfork14()?

*** pthreads/process.c.dist	Mon Jul 10 20:23:28 2000
--- pthreads/process.c	Thu Aug 10 13:04:40 2000
***************
*** 38,52 ****
--- 38,60 ----
  #include <pthread.h>
  
  #include <sys/types.h>
+ #include <sys/syscall.h>
  
  #include <stdarg.h>
  #include <stdlib.h>
  #include <unistd.h>
  
+ #include "config.h"
+ 
  #ifndef lint
  static const char rcsid[] = "$Id: process.c,v 1.2 2000/06/27 19:43:02 explorer Exp $";
  #endif
  
+ #ifdef SYS___vfork14
+ #define vfork __vfork14
+ pid_t	 __vfork14(void);
+ #endif
+ 
  /* ==========================================================================
   * fork()
   *
***************
*** 79,85 ****
  /* The semantics of vfork probably won't mix well with the pthread
     library code.  Don't even try.  */
  pid_t
! vfork()
  {
  	return fork();
  }
--- 87,93 ----
  /* The semantics of vfork probably won't mix well with the pthread
     library code.  Don't even try.  */
  pid_t
! vfork(void)
  {
  	return fork();
  }

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert - rhialto@polder   -- Ah only did well at school
\X/ land.nl      -- tae git intae an O level class tae git away fae Begbie.
>Release-Note:
>Audit-Trail:
>Unformatted: