NetBSD Problem Report #55502

From www@netbsd.org  Mon Jul 20 15:00:13 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 197351A9213
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 20 Jul 2020 15:00:13 +0000 (UTC)
Message-Id: <20200720150012.2DC841A9217@mollari.NetBSD.org>
Date: Mon, 20 Jul 2020 15:00:12 +0000 (UTC)
From: prlw1@cam.ac.uk
Reply-To: prlw1@cam.ac.uk
To: gnats-bugs@NetBSD.org
Subject: dtrace copyinstr invalid address
X-Send-Pr-Version: www-1.0

>Number:         55502
>Category:       kern
>Synopsis:       dtrace copyinstr invalid address
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 20 15:05:00 +0000 2020
>Closed-Date:    Thu Oct 08 13:36:28 +0000 2020
>Last-Modified:  Thu Oct 08 13:36:28 +0000 2020
>Originator:     Patrick Welche
>Release:        NetBSD-9.99.69/amd64
>Organization:
>Environment:
>Description:
According to "Dynamic Instrumentation of Production Systems" by Cantrill et al.:

DTrace also allows for tracing of data from user pro-
cesses. The copyin() and copyinstr() subroutines
can be used to access data from the current process. For
example, the following script aggregates on the name
(arg0) passed to the open(2) system call:

syscall::open:entry
{
@files[copyinstr(arg0)] = count();
}

By tracing events in both the kernel and user processes,
and combining data from both sources, DTrace provides
the complete view of the system required to understand
systemic problems that span the user/kernel boundary.


Trying this however gives:

# cat open.d
syscall::open:entry
{
        @files[copyinstr(arg0)] = count();
}
# dtrace -s open.d 
dtrace: script 'open.d' matched 1 probe
dtrace: aggregation size lowered to 2m
dtrace: error on enabled probe ID 1 (ID 206: syscall::open:entry): invalid address (0x7f7ff7c0b290) in action #2 at DIF offset 12
: No such file or directory
...
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: prlw1@NetBSD.org
State-Changed-When: Thu, 08 Oct 2020 13:36:28 +0000
State-Changed-Why:
I can no longer reproduce this - must be fixed!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.