public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18002] New: gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed.
@ 2015-02-20 12:14 qiyao at gcc dot gnu.org
  2015-02-20 12:41 ` [Bug gdb/18002] " qiyao at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: qiyao at gcc dot gnu.org @ 2015-02-20 12:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18002

            Bug ID: 18002
           Summary: gdb/infrun.c:2114: internal-error: resume: Assertion
                    `tp->control.step_resume_breakpoint->loc->permanent'
                    failed.
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: qiyao at gcc dot gnu.org

I see the internal error below in gdb.base/bp-permanent.exp in
aarch64-linux-gnu target.

(gdb) PASS: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0:
stepi signal with handler: stop at permanent breakpoint
queue-signal SIGUSR1^M
(gdb) PASS: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0:
stepi signal with handler: queue-signal SIGUSR1
stepi^M
gdb/infrun.c:2114: internal-error: resume: Assertion
`tp->control.step_resume_breakpoint->loc->permanent' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL: gdb.base/bp-permanent.exp:
always_inserted=off, sw_watchpoint=0: stepi signal with handler: single-step to
handler (GDB internal error)
Resyncing due to internal error.

Further analysis is needed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/18002] gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed.
  2015-02-20 12:14 [Bug gdb/18002] New: gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed qiyao at gcc dot gnu.org
@ 2015-02-20 12:41 ` qiyao at gcc dot gnu.org
  2015-03-05 21:44 ` palves at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: qiyao at gcc dot gnu.org @ 2015-02-20 12:41 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18002

Yao Qi <qiyao at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |aarch64-linux-gnu

--- Comment #1 from Yao Qi <qiyao at gcc dot gnu.org> ---
This internal error is only shown on remote/cross testing.  In the native
testing (without gdbserver), the internal error goes away:

(gdb) PASS: gdb.base/bp-permanent.exp: always_inserted=on, sw_watchpoint=1:
stepi signal with handler: stop at permanent breakpoint
queue-signal SIGUSR1^M
(gdb) PASS: gdb.base/bp-permanent.exp: always_inserted=on, sw_watchpoint=1:
stepi signal with handler: queue-signal SIGUSR1
stepi^M
47        NOP; /* after permanent bp */^M
(gdb) FAIL: gdb.base/bp-permanent.exp: always_inserted=on, sw_watchpoint=1:
stepi signal with handler: single-step to handler

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/18002] gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed.
  2015-02-20 12:14 [Bug gdb/18002] New: gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed qiyao at gcc dot gnu.org
  2015-02-20 12:41 ` [Bug gdb/18002] " qiyao at gcc dot gnu.org
@ 2015-03-05 21:44 ` palves at redhat dot com
  2015-03-05 23:41 ` palves at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2015-03-05 21:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18002

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com
           Assignee|unassigned at sourceware dot org   |palves at redhat dot com

--- Comment #2 from Pedro Alves <palves at redhat dot com> ---
The ppc64 buildbots are showing this as well.  I've got a patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/18002] gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed.
  2015-02-20 12:14 [Bug gdb/18002] New: gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed qiyao at gcc dot gnu.org
  2015-02-20 12:41 ` [Bug gdb/18002] " qiyao at gcc dot gnu.org
  2015-03-05 21:44 ` palves at redhat dot com
@ 2015-03-05 23:41 ` palves at redhat dot com
  2015-03-05 23:44 ` cvs-commit at gcc dot gnu.org
  2015-03-06 15:29 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2015-03-05 23:41 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18002

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
Mine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/18002] gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed.
  2015-02-20 12:14 [Bug gdb/18002] New: gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed qiyao at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-05 23:41 ` palves at redhat dot com
@ 2015-03-05 23:44 ` cvs-commit at gcc dot gnu.org
  2015-03-06 15:29 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-05 23:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18002

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=68901c4d439ebceecab927932c17ea1504747c02

commit 68901c4d439ebceecab927932c17ea1504747c02
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Mar 5 23:39:45 2015 +0000

    PR gdb/18002: Fix reinsert of a permanent breakpoints

    When we find out that a breakpoint is set on top of a program
    breakpoint, we mark it as "permanent".  E.g.,:

    ...
      if (bp_loc_is_permanent (loc))
        {
          loc->inserted = 1;
          loc->permanent = 1;
        }
    ...

    Note we didn't fill in the breakpoint's shadow (shadow_len remains 0).

    In case the target claims support for evaluating breakpoint
    conditions, GDB sometimes reinserts breakpoints that are already
    inserted (to update the conditions on the target side).  Since GDB
    doesn't know whether the target supports evaluating conditions _of_
    software breakpoints (vs hardware breakpoints, etc.) until it actually
    tries it, if the target doesn't actually support z0 breakpoints, GDB
    ends up reinserting a GDB-managed software/memory breakpoint
    (mem-break.c).

    And that is the case that is buggy: breakpoints that are marked
    inserted contribute their shadows (if any) to the memory returned by
    target_read_memory, to mask out breakpoints.  Permanent breakpoints
    are always marked as inserted.  So if the permanent breakpoint doesn't
    have a shadow yet in its shadow buffer, but we set shadow_len before
    calling target_read_memory, then the still clear shadow_contents
    buffer will be used by the breakpoint masking code...  And then from
    there on, the permanent breakpoint has a broken shadow buffer, and
    thus any memory read out of that address will read bogus code, and
    many random bad things fall out from that.

    The fix is just to set shadow_len at the same time shadow_contents is
    set, not one before and another after...

    Fixes all gdb.base/bp-permanent.exp FAILs on PPC64 GNU/Linux gdbserver
    and probably any other gdbserver port that doesn't do z0 breakpoints.

    gdb/ChangeLog:
    2015-03-05  Pedro Alves  <palves@redhat.com>

        PR gdb/18002
        * mem-break.c (default_memory_insert_breakpoint): Set shadow_len
        after reading the breakpoint's shadow memory.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug gdb/18002] gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed.
  2015-02-20 12:14 [Bug gdb/18002] New: gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed qiyao at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-03-05 23:44 ` cvs-commit at gcc dot gnu.org
@ 2015-03-06 15:29 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2015-03-06 15:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18002

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Pedro Alves <palves at redhat dot com> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-05 23:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 12:14 [Bug gdb/18002] New: gdb/infrun.c:2114: internal-error: resume: Assertion `tp->control.step_resume_breakpoint->loc->permanent' failed qiyao at gcc dot gnu.org
2015-02-20 12:41 ` [Bug gdb/18002] " qiyao at gcc dot gnu.org
2015-03-05 21:44 ` palves at redhat dot com
2015-03-05 23:41 ` palves at redhat dot com
2015-03-05 23:44 ` cvs-commit at gcc dot gnu.org
2015-03-06 15:29 ` palves at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).