From owner-freebsd-current Mon Oct 14 15: 2:38 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5780837B404 for ; Mon, 14 Oct 2002 15:02:37 -0700 (PDT) Received: from walton.kettenis.dyndns.org (a169250.upc-a.chello.nl [62.163.169.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id 305BB43E42 for ; Mon, 14 Oct 2002 15:02:36 -0700 (PDT) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.5/8.12.5) with ESMTP id g9EM2ZA1000511 for ; Tue, 15 Oct 2002 00:02:35 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6/8.12.6) with ESMTP id g9EM2ZjW004142 for ; Tue, 15 Oct 2002 00:02:35 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6/8.12.6/Submit) id g9EM2Zt2004139; Tue, 15 Oct 2002 00:02:35 +0200 (CEST) Date: Tue, 15 Oct 2002 00:02:35 +0200 (CEST) From: Mark Kettenis Message-Id: <200210142202.g9EM2Zt2004139@elgar.kettenis.dyndns.org> To: freebsd-current@freebsd.org Subject: [PATCH] Fix PT_IO ptrace(2) request Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The new PT_IO ptrace(2) request doesn't work, since it doesn't release a lock. Since PT_IO is similar to PT_READ_D/PT_WRITE_D, I copied the PROC_UNLOCK from there and inserted in the same location. Patch, against version 1.103 of sys_process.c, attached. This patch is also available as: http://members.chello.nl/~m.m.kettenis/FreeBSD/5-current/pt_io.patch. A bug report was filed using send-pr. It has ID kern/44065. Mark P.S. GDB will soon use this request for its data transfers if it is available. Really helps with large data transfers :-). Would be great if this problem would be fixed first though. We don't want GDB crashing the kernel, don't we ;-). --- /usr/src/sys/kern/sys_process.c.orig Wed Sep 11 10:13:54 2002 +++ /usr/src/sys/kern/sys_process.c Mon Oct 14 23:22:01 2002 @@ -647,6 +647,7 @@ kern_ptrace(struct thread *td, int req, return (error); case PT_IO: + PROC_UNLOCK(p); piod = addr; iov.iov_base = piod->piod_addr; iov.iov_len = piod->piod_len; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message