Bug 827600 - GDB hardware watchpoints not working on Fedora 17
GDB hardware watchpoints not working on Fedora 17
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
17
ppc64 All
unspecified Severity high
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-01 16:20 EDT by IBM Bug Proxy
Modified: 2012-06-30 17:49 EDT (History)
8 users (show)

See Also:
Fixed In Version: gdb-7.4.50.20120120-48.fc17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-06 15:33:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
disable ptrace BookE interface for PowerPC server processors (1.35 KB, text/plain)
2012-06-01 16:20 EDT, IBM Bug Proxy
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
IBM Linux Technology Center 82151 None None None 2012-06-01 16:20:37 EDT

  None (edit)
Description IBM Bug Proxy 2012-06-01 16:20:37 EDT
Hardware watchpoints are not working on gdb from Fedora 17 (gdb-7.4.50.20120120-42.fc17.ppc64). The watchpoints are inserted but they don't get hit. This can be verified by running some of the watchpoints-related testcases from the GDB testsuite:

$ make check-gdb RUNTESTFLAGS="gdb.base/watchpoints.exp"
...
                === gdb tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../../../gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running ../../../gdb/testsuite/gdb.base/watchpoints.exp ...
FAIL: gdb.base/watchpoints.exp: watchpoint hit, first time
FAIL: gdb.base/watchpoints.exp: watchpoint hit, first time
FAIL: gdb.base/watchpoints.exp: Watchpoint hit count is 1
FAIL: gdb.base/watchpoints.exp: watchpoint ival1 hit, second time
FAIL: gdb.base/watchpoints.exp: Watchpoint ival1 hit count is 2
FAIL: gdb.base/watchpoints.exp: watchpoint hit, second time
FAIL: gdb.base/watchpoints.exp: Watchpoint hit count is 2
FAIL: gdb.base/watchpoints.exp: watchpoint ival1 hit, third time
FAIL: gdb.base/watchpoints.exp: Watchpoint ival1 hit count is 3
FAIL: gdb.base/watchpoints.exp: watchpoint hit, third time (the program exited)
FAIL: gdb.base/watchpoints.exp: Watchpoint hit count is 3
FAIL: gdb.base/watchpoints.exp: watchpoint hit, fourth time (the program is no longer running)
FAIL: gdb.base/watchpoints.exp: Watchpoint hit count is 4
FAIL: gdb.base/watchpoints.exp: watchpoint hit, fifth time (the program is no longer running)

                === gdb Summary ===

# of expected passes            1
# of unexpected failures        14

==

This bug happens due to a problem in the new ptrace BookE interface for PowerPC reported as available on recent versions of the kernel but still unusable on server processors.

This patch fixes the this issue by checking if the ptrace BookE interface is functional, verifying the available 'features' retrieved from a ptrace PPC_PTRACE_GETHWDBGINFO call. If the new interface is not usable, gdb adopts the old ptrace mechanism (using PTRACE_SET_DEBUGREG) to set watchpoints. This change reduces the number of unexpected failures on the gdb testsuite from 258 to 136.

The patch was recently included on upstream gdb:

http://sourceware.org/ml/gdb-patches/2012-05/msg01107.html

I've tested this patch against gdb testsuite from the F17 src package (gdb-7.4.50.20120120-42.fc17) and it fixes this problem, reducing the number of failures from 258 to 136.

Thanks.
Comment 1 IBM Bug Proxy 2012-06-01 16:20:55 EDT
Created attachment 588574 [details]
disable ptrace BookE interface for PowerPC server processors
Comment 2 Fedora Update System 2012-06-02 10:01:45 EDT
gdb-7.4.50.20120120-48.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gdb-7.4.50.20120120-48.fc17
Comment 3 Jan Kratochvil 2012-06-02 10:05:06 EDT
I do not know why Fedora PPC has latest build gdb-7.4.50.20120120-42.fc17
when Fedora x86* already had gdb-7.4.50.20120120-47.fc17.

If there is an issue with new PPC build you should probably contact
Karsten Hopp <karsten@redhat.com>
as he is initiator of all the recent PPC Fedora GDB builds:
http://ppc.koji.fedoraproject.org/koji/packageinfo?packageID=1888
Comment 4 Fedora Update System 2012-06-02 20:01:45 EDT
Package gdb-7.4.50.20120120-48.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gdb-7.4.50.20120120-48.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-8816/gdb-7.4.50.20120120-48.fc17
then log in and leave karma (feedback).
Comment 5 IBM Bug Proxy 2012-06-04 09:46:54 EDT
------- Comment From emachado@br.ibm.com 2012-06-04 13:18 EDT-------
(In reply to comment #10)
> Package gdb-7.4.50.20120120-48.fc17:
> * should fix your issue,
> * was pushed to the Fedora 17 testing repository,
> * should be available at your local mirror within two days.
> Update it with:
> # su -c 'yum update --enablerepo=updates-testing gdb-7.4.50.20120120-48.fc17'
> as soon as you are able to.

Thanks for your support, but it looks like gdb-7.4.50.20120120-48.fc17 is not available yet for ppc:

$ su -c 'yum update --enablerepo=updates-testing gdb-7.4.50.20120120-48.fc17'
Password:
Loaded plugins: auto-update-debuginfo, presto
No Match for argument: gdb-7.4.50.20120120-48.fc17
No package gdb-7.4.50.20120120-48.fc17 available.
No Packages marked for Update
Comment 6 IBM Bug Proxy 2012-06-06 09:10:52 EDT
------- Comment From emachado@br.ibm.com 2012-06-06 13:01 EDT-------
I had the chance to test this issue with gdb-7.4.50.20120603-2.fc18 (from http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=86661) and confirm that the patch was included fixing the problems with hw watchpoints.

Thanks Red Hat for your support.
Comment 7 Jan Kratochvil 2012-06-06 09:14:44 EDT
(In reply to comment #6)
> I had the chance to test this issue with gdb-7.4.50.20120603-2.fc18 (from
> http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=86661) and confirm
> that the patch was included fixing the problems with hw watchpoints.

But this is .fc18 build, it will never get to Fedora 17.
If it is enough then sure no backport was needed.
The backport is present in gdb-7.4.50.20120120-48.fc17, just there is no ppc build for it (yet).
Comment 8 IBM Bug Proxy 2012-06-06 10:01:14 EDT
------- Comment From emachado@br.ibm.com 2012-06-06 13:59 EDT-------
(In reply to comment #13)
> But this is .fc18 build, it will never get to Fedora 17.
> If it is enough then sure no backport was needed.
> The backport is present in gdb-7.4.50.20120120-48.fc17, just there is no ppc
> build for it (yet).

It'd be good to have it working on Fedora 17.
Would it be possible to have this fix backported to the next ppc build for F17?
Comment 9 Karsten Hopp 2012-06-06 12:11:28 EDT
here's the f17 build: 
http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=87031
Comment 10 IBM Bug Proxy 2012-06-06 15:30:43 EDT
------- Comment From emachado@br.ibm.com 2012-06-06 19:28 EDT-------
(In reply to comment #15)
> here's the f17 build:
> http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=87031

Thanks for the build, Karsten.
I've verified this new release (48.fc17) and it has the patch included, fixing the hw watchpoint issues. Thus, I'm closing this bugzilla as fixed on F17. Thanks.
Comment 11 Fedora Update System 2012-06-14 03:52:48 EDT
gdb-7.4.50.20120120-49.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gdb-7.4.50.20120120-49.fc17
Comment 12 Fedora Update System 2012-06-30 17:49:13 EDT
gdb-7.4.50.20120120-49.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.