NetBSD Problem Report #699
From gnats Wed Jan 4 18:15:45 1995
Received: from mail.torfree.net (danforth.torfree.net [199.71.188.17]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with SMTP id SAA01333 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Wed, 4 Jan 1995 18:15:39 -0800
Message-Id: <199501050208.VAA00444@qpoint.torfree.net>
Date: Wed, 4 Jan 1995 21:08:05 -0500
From: David Jones <dej@qpoint.torfree.net>
Reply-To: dej@qpoint.torfree.net
To: gnats-bugs@sun-lamp.cs.berkeley.edu%mail.torfree.net
Subject: uninialized variable in procfs causes ptrace to fail
X-Send-Pr-Version: 3.2
>Number: 699
>Category: kern
>Synopsis: uninialized variable in procfs causes ptrace to fail
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jan 04 18:20:03 +0000 1995
>Closed-Date: Mon Jan 16 09:20:05 +0000 1995
>Last-Modified:
>Originator: David Jones
>Release:
>Organization:
" "
>Environment:
System: NetBSD qpoint 1.0A NetBSD 1.0A (QPOINT) #7: Wed Jan 4 20:50:05 EST 1995 dej@qpoint:/local/src/sys.941230/arch/amiga/compile/QPOINT amiga
>Description:
GDB cannot read/write the process address space when tracing a process.
It gets "no such process". This error is intermittent.
GDB will refuse to single-step the process further.
>How-To-Repeat:
Simply use GDB to single-step a process. If your system is susceptible to
the bug, then you will get a "no such process" error message.
>Fix:
GDB uses ptrace to read the process address space. ptrace uses procfs to
do its work. procfs_rwmem() uses the VM system to map the desired page
into kernel space, from which uiomove() can fetch the required data.
However, the kva variable is uninitialized. Depending on what's on
the stack, vm_map_find() may fail.
The problem can be fixed by applying the following patch:
*** procfs_mem.c Wed Jan 4 20:54:05 1995
--- /local/src/sys.941204/miscfs/procfs/procfs_mem.c Wed Jun 29 06:29:57 1994
***************
*** 158,168 ****
}
/* Find space in kernel_map for the page we're interested in */
! if (!error) {
! kva = 0;
error = vm_map_find(kernel_map, object, off, &kva,
PAGE_SIZE, 1);
- }
if (!error) {
/*
--- 158,166 ----
}
/* Find space in kernel_map for the page we're interested in */
! if (!error)
error = vm_map_find(kernel_map, object, off, &kva,
PAGE_SIZE, 1);
if (!error) {
/*
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mycroft
State-Changed-When: Mon Jan 16 01:20:05 PST 1995
State-Changed-Why:
This was fixed on Jan. 5, but the PR was not closed.
>Unformatted:
(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.