Bug 827600 - GDB hardware watchpoints not working on Fedora 17
Summary: GDB hardware watchpoints not working on Fedora 17
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 17
Hardware: ppc64
OS: All
unspecified
high
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-01 20:20 UTC by IBM Bug Proxy
Modified: 2012-06-30 21:49 UTC (History)
8 users (show)

Fixed In Version: gdb-7.4.50.20120120-48.fc17
Clone Of:
Environment:
Last Closed: 2012-06-06 19:33:49 UTC
Type: ---
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 82151 0 None None None 2012-06-01 20:20:37 UTC

Description IBM Bug Proxy 2012-06-01 20:20:37 UTC
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 20:20:55 UTC
Created attachment 588574 [details]
disable ptrace BookE interface for PowerPC server processors

Comment 2 Fedora Update System 2012-06-02 14:01:45 UTC
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 14:05:06 UTC
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>
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-03 00:01:45 UTC
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 13:46:54 UTC
------- Comment From emachado.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 13:10:52 UTC
------- Comment From emachado.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 13:14:44 UTC
(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 14:01:14 UTC
------- Comment From emachado.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 16:11:28 UTC
here's the f17 build: 
http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=87031

Comment 10 IBM Bug Proxy 2012-06-06 19:30:43 UTC
------- Comment From emachado.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 07:52:48 UTC
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 21:49:13 UTC
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.