From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 3 02:52:55 2007 Return-Path: X-Original-To: freebsd-bugs@freebsd.org Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC74016A403 for ; Tue, 3 Apr 2007 02:52:55 +0000 (UTC) (envelope-from julien.vanegue@ens.fr) Received: from Smtp.neuf.fr (sp604001mt.neufgp.fr [84.96.92.60]) by mx1.freebsd.org (Postfix) with ESMTP id 8732313C468 for ; Tue, 3 Apr 2007 02:52:55 +0000 (UTC) (envelope-from julien.vanegue@ens.fr) Received: from [192.168.1.2] ([86.71.58.32]) by sp604001mt.gpm.neuf.ld (Sun Java System Messaging Server 6.2-5.05 (built Feb 16 2006)) with ESMTP id <0JFW006Q8FW09BU0@sp604001mt.gpm.neuf.ld> for freebsd-bugs@freebsd.org; Tue, 03 Apr 2007 03:52:48 +0200 (CEST) Date: Tue, 03 Apr 2007 03:52:50 +0200 From: jv at ens dot fr To: freebsd-bugs@freebsd.org Message-id: <4611B372.2030103@ens.fr> Organization: Ecole Normale Superieure MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Thunderbird 1.5.0.7 (X11/20060921) Subject: Bug in stepping using sigaction ? X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vanegue@ens.fr List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2007 02:52:55 -0000 Hello all, I noticed what seems to be a bug in sigaction() when trying to use it from inside a process for single-stepping without using an external debugger (by setting the step bit in mc_eflags of the mcontext structure) The problem : $eip/$pc is not incremented automatically in the mcontext structure (mc_eip). As expected, a signal is received by the process at each instruction, but without a program counter incrementing, resulting in an infinite loop on the same instruction forever. My reference for the sigaction() behavior is the one of the Linux kernel, where stepping from inside the process is no problem. Linux does increment the program counter automatically as requested. I am using Freebsd 6.2-PRERELEASE on a x86 machine I have not investigated in the kernel source Is this a bug in freebsd or should the user increment himself the mc_eip flag of the mcontext structure while stepping ? (which Im not sure would result in a correct behavior) Regards Julien Vanegue