NetBSD Problem Report #10175

Received: (qmail 12899 invoked from network); 22 May 2000 23:31:51 -0000
Message-Id: <200005222330.JAA43615@echo.sprc.qut.edu.au>
Date: Tue, 23 May 2000 09:30:58 +1000 (EST)
From: Gregory McGarry <g.mcgarry@ieee.org>
Reply-To: g.mcgarry@ieee.org
To: gnats-bugs@gnats.netbsd.org
Subject: Deterministic panics from userspace on NetBSD/i386 1.4.2
X-Send-Pr-Version: 3.95

>Number:         10175
>Category:       kern
>Synopsis:       Normal user can deterministically crash system
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    chs
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 22 23:32:01 +0000 2000
>Closed-Date:    Wed Jun 14 03:04:11 +0000 2000
>Last-Modified:  Wed Jun 14 03:04:11 +0000 2000
>Originator:     Gregory McGarry
>Release:        1.4.2
>Organization:
Signal Processing Research Centre
>Environment:


NetBSD/i386 1.4.2

>Description:

I'm interested in getting checkpointing working on NetBSD.  I've
started by looking at userspace checkpointing.  I have code which
(should) preserve execution state in an (a.out) executable.  Upon
execution the process recommences execution at the last checkpoint.

When the checkpoint executable is run as a normal user, the system
freezes.

Revealing this finding on port-i386, Martin Huseman <martin@rumolt.teuto.de>
was able to confirm the problem, however, his system developed a panic,
rather than a system freeze:

panic: AMAP_B2SLOT: invalid byte count

backtrace is:

_amap_alloc(1256c,0,1,c2f6df40) at _amap_alloc+0x22
_amap_copy(c2ee8580,c2f66568,1,1,a000,a001) at _amap_copy+0xb6
_uvmfault_amapcopy(c2f6df40,c2ee8580,106,0,0) at _uvmfault_amapcopy+0xc8
_uvm_fault(c2ee8580,a000,0,3,0) at _uvm_fault+0x17f
_trap() at _trap+0x40b

>How-To-Repeat:

The code is available at
http://www.sprc.qut.edu.au/~mcgarry/netbsd/checkpoint.tar.gz
The archive is less than 10KB.

Compile on NetBSD/i386 1.4.2.  The code requires a.out support, so
a -current system may show similar behaviour.
Execute ./main, which will create a ./main.checkpoint file which
(is supposed to) preserve process execution state.  Upon execution
of ./main.checkpoint to restore the process execution, watch the
system freeze or panic.  The problem occurs when the stack is restored
in recover().

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->chs 
Responsible-Changed-By: chs 
Responsible-Changed-When: Mon Jun 12 21:19:47 PDT 2000 
Responsible-Changed-Why:  
I'm looking at this. 

From: Chuck Silvers <chuq@chuq.com>
To: Gregory McGarry <g.mcgarry@ieee.org>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/10175: Deterministic panics from userspace on NetBSD/i386 1.4.2
Date: Tue, 13 Jun 2000 10:05:27 -0700

 could you try your reproduction case after updating
 to rev. 1.18 of kern/exec_subr.c ?
 hopefully that will fix it.

 -Chuck
State-Changed-From-To: open->feedback 
State-Changed-By: chs 
State-Changed-When: Tue Jun 13 10:08:42 PDT 2000 
State-Changed-Why:  
waiting for feedback on a change which should fix the problem. 

From: Gregory McGarry <g.mcgarry@ieee.org>
To: Chuck Silvers <chuq@chuq.com>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/10175: Deterministic panics from userspace on NetBSD/i386
 1.4.2
Date: Wed, 14 Jun 2000 07:25:01 +1000

 Chuck Silvers wrote:

 > could you try your reproduction case after updating
 > to rev. 1.18 of kern/exec_subr.c ?
 > hopefully that will fix it.

 Sorry for the delay in responding.  I tested this change on a 1.4ZC
 kernel and the panics no longer occur.  Thanks for looking into this.

 	-- Gregory McGarry <g.mcgarry@ieee.org>
State-Changed-From-To: feedback->closed 
State-Changed-By: chs 
State-Changed-When: Tue Jun 13 20:03:32 PDT 2000 
State-Changed-Why:  
fixed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.