From nobody@www.freebsd.org  Mon Jun 24 13:18:03 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 7BB1F37B400
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Jun 2002 13:18:03 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g5OKI3hG016439
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Jun 2002 13:18:03 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g5OKI35o016438;
	Mon, 24 Jun 2002 13:18:03 -0700 (PDT)
Message-Id: <200206242018.g5OKI35o016438@www.freebsd.org>
Date: Mon, 24 Jun 2002 13:18:03 -0700 (PDT)
From: Greg Quinlan <gwq_uk@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: iBCS2 emulation fork process core dumps
X-Send-Pr-Version: www-1.0

>Number:         39802
>Category:       i386
>Synopsis:       iBCS2 emulation fork process core dumps
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    emulation
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 24 13:20:04 PDT 2002
>Closed-Date:    Fri Sep 03 06:12:05 GMT 2004
>Last-Modified:  Fri Sep 03 06:12:05 GMT 2004
>Originator:     Greg Quinlan
>Release:        4.6-Stable
>Organization:
>Environment:
4.6-Stable
>Description:
Using iBCS2 emulation ONLY with IBCS2 Binaries ONLY;
Any iBCS2 (COFF/SCO) binary which forks a process (child process) will get the next
PID (ranging from X to 99999, see /sys/sys/proc.h), but most iBCS2 binaries
have an upper PID limit of around 32700 (short int). So after the PID count exceeds this
value, the program will crash (core dump). It may give an error of 'can't fork process' or similar.

>How-To-Repeat:
The problem will not reproduce itself until the current PID reaches around 32700
which may not happen for some time after a boot or reboot.

Wait for the PID number to exceed 'short int', and for an iBCS2 program to fork
a child process.
>Fix:
- Modify the /sys/sys/proc.h
change PID_MAX from 99999 to a safe value of 32759, and 
also change NO_PID from 100000 to a safe value of 32760.
- Remake the kernel & reboot.

This should be included as a WARNING in the documentation for IBCS2 emulation.
Or modified automatically if the option for iBCS2 is included in the /etc/rc.conf file.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Fri Sep 3 02:25:47 GMT 2004 
State-Changed-Why:  
Is this still a problem with modern versions of FreeBSD? 


Responsible-Changed-From-To: freebsd-bugs->emulation 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Sep 3 02:25:47 GMT 2004 
Responsible-Changed-Why:  
This looks like an error in the emulation code. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39802 
State-Changed-From-To: feedback->closed 
State-Changed-By: tjr 
State-Changed-When: Fri Sep 3 06:11:29 GMT 2004 
State-Changed-Why:  
Duplicate of i386/11165. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39802 
>Unformatted:
