From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 19:36:46 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 278D01065673 for ; Thu, 29 Apr 2010 19:36:46 +0000 (UTC) (envelope-from tomtinn@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id B74788FC19 for ; Thu, 29 Apr 2010 19:36:45 +0000 (UTC) Received: by wyb36 with SMTP id 36so601765wyb.13 for ; Thu, 29 Apr 2010 12:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=n7qeP9o9dhv/znf6sJTWHKXfmGg6hHlWUwGsrD2o/xc=; b=g1fPN9Uj2qIW8WmcdFQp6Pj/P9tQii9Xr5bMBjPSKFYFaIK/M8y0nK/bbxi6NsU4vx xaePaQ1zXJ54dOm739AViov67Qe1KnAHPSSdHMcewANv7fIWLv08qUKZZT54Xnqw58L6 VoTKrw4uok8HGmZtRtOdAqurEgI+UZjzFqrfk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ZiRvITkLnNpytf5dc8oeDy7WK3xzoHNJDzgbfl7MeNk7hwSITMoZDl79zrS+VM5YGW H/+6DA3XpxsB+DK+ORrDPxw2kTCJ7xqllccJHoKCxHIz47gRETc+qQtKO0kBnDmP1+gN rAqvvz2nHkn9O2d0yQxL1PMIUZtf/AjL8hkBo= MIME-Version: 1.0 Received: by 10.216.90.208 with SMTP id e58mr5011007wef.57.1272567977797; Thu, 29 Apr 2010 12:06:17 -0700 (PDT) Received: by 10.216.166.16 with HTTP; Thu, 29 Apr 2010 12:06:17 -0700 (PDT) Date: Thu, 29 Apr 2010 19:06:17 +0000 Message-ID: From: Gunnar Hinriksson To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Ptrace segfault X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 19:36:46 -0000 Hello Im having a little problem using ptrace on my system. If I use ptrace to attach to another process the child process segfaults once I detach. For example using this simple program. #include #include #include #include #include int main(int argc, char *argv[]) { int pid = atoi(argv[1]); ptrace(PT_ATTACH, pid, 0, 0); wait(NULL); ptrace(PT_DETACH, pid, 0, 0); return 0; } Am I using ptrace incorrectly or is there perhaps a bug in ptrace that causes the child to always segfault ? With Regards Gunnar FreeBSD knut 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Apr 27 04:36:16 UTC 2010 gunnar@knut:/usr/obj/usr/src/sys/GENERIC amd64