From owner-freebsd-bugs@FreeBSD.ORG Wed May 14 03:40:21 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D45237B401 for ; Wed, 14 May 2003 03:40:21 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B31E743FA3 for ; Wed, 14 May 2003 03:40:20 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h4EAeKUp014215 for ; Wed, 14 May 2003 03:40:20 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h4EAeKat014214; Wed, 14 May 2003 03:40:20 -0700 (PDT) Date: Wed, 14 May 2003 03:40:20 -0700 (PDT) Message-Id: <200305141040.h4EAeKat014214@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Thomas Moestl Subject: Re: kern/52198: Kernel trap 12 when debugging fork() with ald [/usr/ports/devel/ald] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Thomas Moestl List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2003 10:40:21 -0000 The following reply was made to PR kern/52198; it has been noted by GNATS. From: Thomas Moestl To: Lolownia Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/52198: Kernel trap 12 when debugging fork() with ald [/usr/ports/devel/ald] Date: Wed, 14 May 2003 03:26:31 +0200 On Wed, 2003/05/14 at 03:19:24 +0200, Thomas Moestl wrote: > On Wed, 2003/05/14 at 00:36:36 +0200, Lolownia wrote: > > > > >Number: 52198 > > >Category: kern > > >Synopsis: Kernel trap 12 when debugging fork() with ald [/usr/ports/devel/ald] > > [...] > > When stepping through simple assembler program with fork() syscall, > > system drops into DDB > > db> trace > > sw1b(2f,2f,2f,bfbff64c,bfbff654) at sw1b+0xa9 > > fork_trampoline() at fork_trampoline > > --- trap 0xa, eip = 0x804849c, esp = 0xbfbff628, ebp = 0xbfbff644 --- > > This is a bug in cpu_fork(); it bogusly bases the kernel eflags to be > set for a new process on the user eflags of the forking process (since > a commit which seems to originally have been intended to clear PSL_I, > about a year ago). > The patch below should fix this; it will just use a sane initial > value, since cloning the forking process' kernel eflags (as was done > before the commit mentioned above) Oops, actually, that commit introduced eflags saving and restoring in cpu_switch() altogether, so scratch that remarks about the previous behaviour. Need sleep. The patch should be correct, however. - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C