From nobody  Wed Feb 10 14:59:28 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id OAA02485;
          Wed, 10 Feb 1999 14:59:28 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199902102259.OAA02485@hub.freebsd.org>
Date: Wed, 10 Feb 1999 14:59:28 -0800 (PST)
From: marcel@scc.nl
To: freebsd-gnats-submit@freebsd.org
Subject: Linux emulator: sig 11 on process exit
X-Send-Pr-Version: www-1.0

>Number:         10015
>Category:       i386
>Synopsis:       Linux emulator: sig 11 on process exit
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 10 15:00:00 PST 1999
>Closed-Date:    Wed Feb 10 23:59:52 PST 1999
>Last-Modified:  Thu Feb 11 00:00:21 PST 1999
>Originator:     Marcel Moolenaar
>Release:        3.0-stable
>Organization:
SCC vof
>Environment:
FreeBSD scones.sup.scc.nl 3.0-STABLE FreeBSD 3.0-STABLE #11: Wed Feb 10 23:40:27 CET 1999     marcel@scones.sup.scc.nl:/usr/src/sys/compile/SCONES  i386

>Description:
Statically linked Linux binaries seg fault when exiting. This is
caused by a call to atexit with an invalid address. This call is
especially made when register DX is non-zero when a newly created
process starts running (e.g. it's entry point is called).

>How-To-Repeat:
n/a
>Fix:
Apply the following patch:

*** machdep.c.orig      Wed Feb 10 23:49:27 1999
--- machdep.c   Wed Feb 10 23:48:52 1999
***************
*** 860,865 ****
--- 860,872 ----
        /* Initialize the npx (if any) for the current process. */
        npxinit(__INITIAL_NPXCW__);
  #endif
+ 
+       /*
+        * XXX - Linux emulator
+        * Make sure sure edx is 0x0 on entry. Linux binaries depend
+        * on it.
+        */
+       p->p_retval[1] = 0;
  }
  
  static int

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: msmith 
State-Changed-When: Wed Feb 10 23:59:52 PST 1999 
State-Changed-Why:  
Patch applied, happiness! 
>Unformatted:
