Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Apr 2007 03:52:50 +0200
From:      jv at ens dot fr <julien.vanegue@ens.fr>
To:        freebsd-bugs@freebsd.org
Subject:   Bug in stepping using sigaction ?
Message-ID:  <4611B372.2030103@ens.fr>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4611B372.2030103>