Bug in stepping using sigaction ?

jv at ens dot fr julien.vanegue at ens.fr
Tue Apr 3 02:52:55 UTC 2007


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


More information about the freebsd-bugs mailing list