public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17206] New: Assertion `pc_in_thread_step_range (pc, tp)' failed.
@ 2014-07-27 19:14 tilkax at gmail dot com
  2014-07-27 19:18 ` [Bug gdb/17206] " xdje42 at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tilkax at gmail dot com @ 2014-07-27 19:14 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17206
           Summary: Assertion `pc_in_thread_step_range (pc, tp)' failed.
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: tilkax at gmail dot com

After a SIGSEGV, I accidentally typed 'u' (until) instead of 'up' and got this: 

$ echo 'int main(){return*(int*)0;}'|gcc -xc - && gdb -ex r a.out
Program received signal SIGSEGV, Segmentation fault.
(gdb) u
infrun.c:1948: internal-error: resume: Assertion `pc_in_thread_step_range (pc,
tp)' failed.

(output shortened)

GDB 7.7.1 on Arch Linux x86_64 testing.

-- 
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/17206] Assertion `pc_in_thread_step_range (pc, tp)' failed.
  2014-07-27 19:14 [Bug gdb/17206] New: Assertion `pc_in_thread_step_range (pc, tp)' failed tilkax at gmail dot com
@ 2014-07-27 19:18 ` xdje42 at gmail dot com
  2014-07-28  6:19 ` qiyao at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: xdje42 at gmail dot com @ 2014-07-27 19:18 UTC (permalink / raw)
  To: gdb-prs

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

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xdje42 at gmail dot com

--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
Repro'd with 7.8 branch as of today.

It didn't repro with 7.6.1-46.fc19

-- 
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/17206] Assertion `pc_in_thread_step_range (pc, tp)' failed.
  2014-07-27 19:14 [Bug gdb/17206] New: Assertion `pc_in_thread_step_range (pc, tp)' failed tilkax at gmail dot com
  2014-07-27 19:18 ` [Bug gdb/17206] " xdje42 at gmail dot com
@ 2014-07-28  6:19 ` qiyao at gcc dot gnu.org
  2014-07-29  4:05 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: qiyao at gcc dot gnu.org @ 2014-07-28  6:19 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qiyao at gcc dot gnu.org

--- Comment #2 from Yao Qi <qiyao at gcc dot gnu.org> ---
The reproducer can be simpler,

$ cat 2.c 
int
main(void)
{
  return 0;
}

$ gcc 2.c -o 2.exe

(gdb) b main
Breakpoint 1 at 0x8048403
(gdb) run
Starting program: /home/yao/Source/gnu/gdb/build-git/2.exe 

Breakpoint 1, 0x08048403 in main ()
(gdb) until 
0x08048408 in main ()
(gdb) until
../../../git/gdb/infrun.c:1992: internal-error: resume: Assertion
`pc_in_thread_step_range (pc, tp)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

I have a patch which is being regression tested.  I'll post it once the
regression test is finished.

-- 
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/17206] Assertion `pc_in_thread_step_range (pc, tp)' failed.
  2014-07-27 19:14 [Bug gdb/17206] New: Assertion `pc_in_thread_step_range (pc, tp)' failed tilkax at gmail dot com
  2014-07-27 19:18 ` [Bug gdb/17206] " xdje42 at gmail dot com
  2014-07-28  6:19 ` qiyao at gcc dot gnu.org
@ 2014-07-29  4:05 ` cvs-commit at gcc dot gnu.org
  2014-07-29  6:36 ` cvs-commit at gcc dot gnu.org
  2014-07-29  6:42 ` qiyao at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-07-29  4:05 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  7e09a22367934a6d53f79d8b01135832b80ab246 (commit)
      from  7ebdbe9292e4b696740b021938369adb1484da27 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7e09a22367934a6d53f79d8b01135832b80ab246

commit 7e09a22367934a6d53f79d8b01135832b80ab246
Author: Yao Qi <yao@codesourcery.com>
Date:   Mon Jul 28 13:44:57 2014 +0800

    Fix PR 17206

    As reported in PR 17206, an internal error is triggered when command
    until is executed.  In infcmd.c:until_next_command, step_range_end is
    set to 'pc',

      if (!func)
        {
          struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc
(pc);

          if (msymbol.minsym == NULL)
        error (_("Execution is not within a known function."));

          tp->control.step_range_start = BMSYMBOL_VALUE_ADDRESS (msymbol);
          tp->control.step_range_end = pc;
        }

    and later in infrun.c:resume, the assert below is triggered in PR
    17206.

      if (tp->control.may_range_step)
        {
          /* If we're resuming a thread with the PC out of the step
         range, then we're doing some nested/finer run control
         operation, like stepping the thread out of the dynamic
         linker or the displaced stepping scratch pad.  We
         shouldn't have allowed a range step then.  */
          gdb_assert (pc_in_thread_step_range (pc, tp));
        }

    In until_next_command, we set step range to [XXX, pc), so pc isn't
    within the range.  pc_in_thread_step_range returns false and the
    assert is triggered.  AFAICS, the range we want in until_next_command
    is [XXX, pc] instead of [XXX, pc), because we want to program step
    until greater than pc.  This patch is to set step_range_end to
    'pc + 1'.  Running until-nodebug.exp with unpatched GDB will get the
    following fail,

    FAIL: gdb.base/until-nodebug.exp: until 2 (GDB internal error)

    and the fail goes away when the fix is applied.

    gdb:

    2014-07-29  Yao Qi  <yao@codesourcery.com>

        PR gdb/17206
        * infcmd.c (until_next_command): Set step_range_end to PC + 1.

    gdb/testsuite:

    2014-07-29  Yao Qi  <yao@codesourcery.com>

        PR gdb/17206
        * gdb.base/until-nodebug.exp: New.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                                      |    5 ++++
 gdb/infcmd.c                                       |    4 ++-
 gdb/testsuite/ChangeLog                            |    5 ++++
 .../{source-execution.exp => until-nodebug.exp}    |   24 +++++++++++--------
 4 files changed, 27 insertions(+), 11 deletions(-)
 copy gdb/testsuite/gdb.base/{source-execution.exp => until-nodebug.exp} (60%)

-- 
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/17206] Assertion `pc_in_thread_step_range (pc, tp)' failed.
  2014-07-27 19:14 [Bug gdb/17206] New: Assertion `pc_in_thread_step_range (pc, tp)' failed tilkax at gmail dot com
                   ` (2 preceding siblings ...)
  2014-07-29  4:05 ` cvs-commit at gcc dot gnu.org
@ 2014-07-29  6:36 ` cvs-commit at gcc dot gnu.org
  2014-07-29  6:42 ` qiyao at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-07-29  6:36 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, gdb-7.8-branch has been updated
       via  f7f4b7afaa717a83e9eaf157a8870c99978f2942 (commit)
      from  c201aa9323dc01f782d1db2607aa9e69d6bf90df (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit f7f4b7afaa717a83e9eaf157a8870c99978f2942
Author: Yao Qi <yao@codesourcery.com>
Date:   Mon Jul 28 13:44:57 2014 +0800

    Fix PR 17206

    As reported in PR 17206, an internal error is triggered when command
    until is executed.  In infcmd.c:until_next_command, step_range_end is
    set to 'pc',

      if (!func)
        {
          struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc
(pc);

          if (msymbol.minsym == NULL)
        error (_("Execution is not within a known function."));

          tp->control.step_range_start = BMSYMBOL_VALUE_ADDRESS (msymbol);
          tp->control.step_range_end = pc;
        }

    and later in infrun.c:resume, the assert below is triggered in PR
    17206.

      if (tp->control.may_range_step)
        {
          /* If we're resuming a thread with the PC out of the step
         range, then we're doing some nested/finer run control
         operation, like stepping the thread out of the dynamic
         linker or the displaced stepping scratch pad.  We
         shouldn't have allowed a range step then.  */
          gdb_assert (pc_in_thread_step_range (pc, tp));
        }

    In until_next_command, we set step range to [XXX, pc), so pc isn't
    within the range.  pc_in_thread_step_range returns false and the
    assert is triggered.  AFAICS, the range we want in until_next_command
    is [XXX, pc] instead of [XXX, pc), because we want to program step
    until greater than pc.  This patch is to set step_range_end to
    'pc + 1'.  Running until-nodebug.exp with unpatched GDB will get the
    following fail,

    FAIL: gdb.base/until-nodebug.exp: until 2 (GDB internal error)

    and the fail goes away when the fix is applied.

    gdb:

    2014-07-29  Yao Qi  <yao@codesourcery.com>

        PR gdb/17206
        * infcmd.c (until_next_command): Set step_range_end to PC + 1.

    gdb/testsuite:

    2014-07-29  Yao Qi  <yao@codesourcery.com>

        PR gdb/17206
        * gdb.base/until-nodebug.exp: New.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                                      |    5 ++++
 gdb/infcmd.c                                       |    4 ++-
 gdb/testsuite/ChangeLog                            |    5 ++++
 .../{source-execution.exp => until-nodebug.exp}    |   24 +++++++++++--------
 4 files changed, 27 insertions(+), 11 deletions(-)
 copy gdb/testsuite/gdb.base/{source-execution.exp => until-nodebug.exp} (60%)

-- 
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/17206] Assertion `pc_in_thread_step_range (pc, tp)' failed.
  2014-07-27 19:14 [Bug gdb/17206] New: Assertion `pc_in_thread_step_range (pc, tp)' failed tilkax at gmail dot com
                   ` (3 preceding siblings ...)
  2014-07-29  6:36 ` cvs-commit at gcc dot gnu.org
@ 2014-07-29  6:42 ` qiyao at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: qiyao at gcc dot gnu.org @ 2014-07-29  6:42 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |7.8

--- Comment #5 from Yao Qi <qiyao at gcc dot gnu.org> ---
Patch is pushed in.  Close it.

-- 
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:[~2014-07-29  6:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-27 19:14 [Bug gdb/17206] New: Assertion `pc_in_thread_step_range (pc, tp)' failed tilkax at gmail dot com
2014-07-27 19:18 ` [Bug gdb/17206] " xdje42 at gmail dot com
2014-07-28  6:19 ` qiyao at gcc dot gnu.org
2014-07-29  4:05 ` cvs-commit at gcc dot gnu.org
2014-07-29  6:36 ` cvs-commit at gcc dot gnu.org
2014-07-29  6:42 ` qiyao at gcc dot gnu.org

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).