Bug 1181478 - ptrace_singlestep breaks hardware watchpoints
ptrace_singlestep breaks hardware watchpoints
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel
Current
x86-64 Other
: P5 - None : Normal (vote)
: ---
Assigned To: openSUSE Kernel Bugs
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-01-27 16:30 UTC by Tom de Vries
Modified: 2022-02-11 12:13 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2021-01-27 16:30:18 UTC
[ Filed here upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=27188 ]

Compile this ( https://sourceware.org/git?p=binutils-gdb.git;a=blob_plain;f=gdb/testsuite/gdb.base/gdb11531.c;hb=HEAD )
...
$ gcc src/gdb/testsuite/gdb.base/gdb11531.c -g
...

And run this debug session:
...
$ gdb -batch a.out \
  -ex start \
  -ex "watch myrec.x" \
  -ex step
Temporary breakpoint 1 at 0x4010fa: file gdb11531.c, line 34.

Temporary breakpoint 1, main () at gdb11531.c:34
34        myrec.x = 5;
Hardware watchpoint 2: myrec.x
35        myrec.y = 3.4;
...

The hardware watchpoint doesn't trigger.  This problem occurs on factory, not on leap 15.2.  

This is not related to debug info.  When replacing next with continue (such that we use ptrace_cont instead of ptrace_singlestep), the hardware watchpoint triggers. Also, when we disable hardware watchpoints using "set can-use-hw-watchpoints 0" the watchpoint triggers.

So, the problem seems to be related to hardware watchpoints and ptrace_singlestep.
Comment 1 Tom de Vries 2021-01-27 16:33:40 UTC
Boris, I suspect this is a kernel PR.  Reproduces on HW.  I got both tw and leap 15.2 installed on the same laptop, and problem only reproduces on tw.

Could you take a look?
Comment 3 Miroslav Beneš 2022-02-11 12:13:31 UTC
Closing, because TW is far by v5.11.