Red Hat Bugzilla – Bug 10465
i386 debug status register not updated as viewed using ptrace
Last modified: 2016-11-24 10:00:09 EST
I am using ptrace to set hardware watchpoints on
linux86. RH5.x, RH6.x.
When a hardware watchpoint fires, a bit is set
in the debug status register to flag this. These
registers are only available to level 0 processes,
so you have to use the ptrace interface.
I wrote a very simple debugger that, using ptrace,
successfully sets any sort of hardware watchpoint/breakpoint
and traps/faults in the coresponding situation
under RH 5.x . Most importantly, the debug
status register (as viewed by ptrace) accurately
reports which break/watch point fired.
Under RH6.x, the hw watch/breakpoints traps as expected,
but the status register does not report which watch/breakpoint
fires. The value of the status register is always zero.
I am using the same code.
Since the debug registers are not available at user level,
and since this is a loss of information (I can't think
of a workaround), I gave this high severity.
PS. I would be *very happy* to send code. The test debugger is
very very simple. I wrote it to learn by. Underlying
this question is a full production debugger however.
Created attachment 166 [details]
This program will illustrate the bug if executed on RH6.x
Created attachment 167 [details]
Sorry about that. ( " )
Created attachment 168 [details]
OK, here is the source then.
Created attachment 169 [details]
The main program.
Created attachment 170 [details]
hardware watchpont module.
Created attachment 171 [details]
Created attachment 173 [details]
Created attachment 174 [details]
show how to modify main.c
Created attachment 176 [details]
RH6.x doesnt work. same code
assign to jakub
ptrace is a simple wrapper around the syscalls. The data is passed to the
caller exactly the way the kernel provides them. If anything is at fault it's
Can you reproduce the problem with RHL9? If yes, can you attach an updated test
No reply in almost 6 months. Reopen in case there is a problem.