public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/14100] New: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.
@ 2012-05-12 17:46 ppluzhnikov at google dot com
  2012-08-02 13:39 ` [Bug gdb/14100] " tromey at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ppluzhnikov at google dot com @ 2012-05-12 17:46 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=14100

             Bug #: 14100
           Summary: internal-error: frame_cleanup_after_sniffer: Assertion
                    `frame->prologue_cache == NULL' failed.
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: ppluzhnikov@google.com
    Classification: Unclassified


Using current HEAD, interrupting a long backtrace results in:

...
#25217 0x0000000000400574 in foo (i=9711) at t.c:1
#25218 0x0000000000400574 in foo (i=9710) at t.c:1
^C../../src/gdb/frame.c:2396: internal-error: frame_cleanup_after_sniffer:
Assertion `frame->prologue_cache == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Aborted (core dumped)


Google ref: b/6486017

Repro steps:

cat t.c
int foo(int i) { char buf[200];  return foo(i + 1) + buf[199]; }
main() { return foo(0); }

gcc -g t.c && gdb ./a.out
GNU gdb (GDB) 7.4.50.20120512-cvs
...

(gdb) run
Starting program: /tmp/a.out 

Program received signal SIGSEGV, Segmentation fault.
0x000000000040054f in foo (i=<error reading variable: Cannot access memory at
address 0x7fffff7fefcc>) at t.c:1
1    int foo(int i) { char buf[200];  return foo(i + 1) + buf[199]; }

(gdb) bt    # Hit ^C after a while
...
#25218 0x0000000000400574 in foo (i=9710) at t.c:1
^C../../src/gdb/frame.c:2396: internal-error: frame_cleanup_after_sniffer:
Assertion `frame->prologue_cache == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Aborted (core dumped)


Core was generated by `gdb64-cvs ./a.out'.
Program terminated with signal 6, Aborted.
#0  0x00007f06e115fa75 in *__GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007f06e115fa75 in *__GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f06e11635c0 in *__GI_abort () at abort.c:92
#2  0x0000000000655126 in dump_core () at ../../src/gdb/utils.c:687
#3  0x0000000000656b7a in internal_vproblem (problem=0xc55350, file=<optimized
out>, line=<optimized out>, fmt=<optimized out>, ap=<optimized out>) at
../../src/gdb/utils.c:855
#4  0x0000000000656d49 in internal_verror (file=<optimized out>,
line=<optimized out>, fmt=<optimized out>, ap=0x7fff8b32b138) at
../../src/gdb/utils.c:870
#5  0x0000000000656de1 in internal_error (file=0x6896 <Address 0x6896 out of
bounds>, line=26774, string=0x6 <Address 0x6 out of bounds>) at
../../src/gdb/utils.c:880
#6  0x00000000006595ce in frame_cleanup_after_sniffer (arg=<optimized out>) at
../../src/gdb/frame.c:2396
#7  0x0000000000542966 in do_my_cleanups (pmy_chain=0xc50888,
old_chain=0x8841e0) at ../../src/gdb/cleanups.c:155
#8  0x000000000059bd21 in throw_exception (exception=...) at
../../src/gdb/exceptions.c:227
#9  0x000000000059bced in exceptions_state_mc (action=<optimized out>) at
../../src/gdb/exceptions.c:197
#10 0x000000000065d855 in frame_unwind_find_by_frame (this_frame=<optimized
out>, this_cache=<optimized out>) at ../../src/gdb/frame-unwind.c:110
#11 0x00000000006597c1 in get_frame_type (frame=0x92761b0) at
../../src/gdb/frame.c:2226
#12 0x0000000000597498 in print_frame_info (frame=0x92761b0, print_level=1,
print_what=LOCATION, print_args=1) at ../../src/gdb/stack.c:767
#13 0x0000000000597b56 in backtrace_command_1 (count_exp=<optimized out>,
show_locals=0, from_tty=1) at ../../src/gdb/stack.c:1728
#14 0x0000000000597e83 in backtrace_command (arg=0x0, from_tty=<optimized out>)
at ../../src/gdb/stack.c:1804
#15 0x0000000000652a33 in execute_command (p=0x250e9a2 "", from_tty=1) at
../../src/gdb/top.c:484
#16 0x00000000005a4438 in command_handler (command=0x250e9a0 "bt") at
../../src/gdb/event-top.c:435
#17 0x00000000005a4eec in command_line_handler (rl=<optimized out>) at
../../src/gdb/event-top.c:636
#18 0x0000000000694d7b in rl_callback_read_char () at
../../src/readline/callback.c:220
#19 0x00000000005a44a9 in rl_callback_read_char_wrapper (client_data=0x6896) at
../../src/gdb/event-top.c:169
#20 0x00000000005a2dd8 in process_event () at ../../src/gdb/event-loop.c:401
#21 0x00000000005a417a in gdb_do_one_event () at ../../src/gdb/event-loop.c:465
#22 0x00000000005a41e5 in start_event_loop () at ../../src/gdb/event-loop.c:490
#23 0x000000000059d583 in captured_command_loop (data=0x6896) at
../../src/gdb/main.c:226
#24 0x000000000059c0eb in catch_errors (func=<optimized out>,
func_args=<optimized out>, errstring=<optimized out>, mask=<optimized out>) at
../../src/gdb/exceptions.c:546
#25 0x000000000059e296 in captured_main (data=<optimized out>) at
../../src/gdb/main.c:1001
#26 0x000000000059c0eb in catch_errors (func=<optimized out>,
func_args=<optimized out>, errstring=<optimized out>, mask=<optimized out>) at
../../src/gdb/exceptions.c:546
#27 0x000000000059d544 in gdb_main (args=0x6896) at ../../src/gdb/main.c:1010
#28 0x000000000046fd3e in main (argc=<optimized out>, argv=0x6896) at
../../src/gdb/gdb.c:34

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/14100] internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.
  2012-05-12 17:46 [Bug gdb/14100] New: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed ppluzhnikov at google dot com
@ 2012-08-02 13:39 ` tromey at redhat dot com
  2012-08-02 15:02 ` tromey at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2012-08-02 13:39 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=14100

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kevin.pouget at gmail dot
                   |                            |com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2012-08-02 13:37:49 UTC ---
*** Bug 14391 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/14100] internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.
  2012-05-12 17:46 [Bug gdb/14100] New: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed ppluzhnikov at google dot com
  2012-08-02 13:39 ` [Bug gdb/14100] " tromey at redhat dot com
@ 2012-08-02 15:02 ` tromey at redhat dot com
  2012-08-05 19:52 ` jan.kratochvil at redhat dot com
  2012-08-06 19:23 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2012-08-02 15:02 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=14100

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com

--- Comment #2 from Tom Tromey <tromey at redhat dot com> 2012-08-02 15:02:14 UTC ---
It was surprisingly hard to find out where the exception
is originally thrown.  I had to resort to some crazy hacks.

There are two possible problems.

One is that maybe this is just a bad assert.
Perhaps instead this cleanup should just clear the prologue_cache field.
This would make sense because it is hard to predict what code paths
might call QUIT.

Another is that dwarf2_frame_cache could assign to *this_cache
at the end of its processing, rather than at the beginning.

What is happening is that dwarf2_frame_cache sets *this_cache.
Then it does some more work; including eventually calling target_read,
which calls QUIT.  If the C-c arrives at exactly the right moment,
it triggers the failure.

#1  0x000000000074315e in target_read (ops=0x3b84890, 
    object=TARGET_OBJECT_STACK_MEMORY, annex=0x0, buf=0x3e89fc0 "", 
    offset=140737479962640, len=8) at ../../archer/gdb/target.c:2027
#2  0x0000000000742a9e in target_read_stack (memaddr=140737479962640, myaddr=
    0x3e89fc0 "", len=8) at ../../archer/gdb/target.c:1785
#3  0x000000000079e592 in read_stack (memaddr=140737479962640, myaddr=
    0x3e89fc0 "", len=8) at ../../archer/gdb/corefile.c:233
#4  0x00000000006bf20e in read_value_memory (val=0x3e42c00, 
    embedded_offset=0, stack=1, memaddr=140737479962640, buffer=0x3e89fc0 "", 
    length=8) at ../../archer/gdb/valops.c:1140
#5  0x00000000006bec15 in value_fetch_lazy (val=0x3e42c00)
    at ../../archer/gdb/valops.c:1022
#6  0x00000000006aed06 in value_entirely_available (value=0x3e42c00)
    at ../../archer/gdb/value.c:348
#7  0x0000000000818e29 in frame_register_unwind (frame=0x3bf7ec0, regnum=6, 
    optimizedp=0x7fffffb7517c, unavailablep=0x7fffffb75178, lvalp=
    0x7fffffb75168, addrp=0x7fffffb75170, realnump=0x7fffffb7516c, bufferp=
    0x7fffffb751c0 "ʠ\370\003\006") at ../../archer/gdb/frame.c:863
#8  0x00000000008190b3 in frame_unwind_register (frame=0x3bf7ec0, regnum=6, 
    buf=0x7fffffb751c0 "ʠ\370\003\006") at ../../archer/gdb/frame.c:912
#9  0x000000000081912d in get_frame_register (frame=0x3bf8d10, regnum=6, buf=
    0x7fffffb751c0 "ʠ\370\003\006") at ../../archer/gdb/frame.c:926
#10 0x00000000007ab399 in read_reg (baton=0x3bf8d10, reg=6)
    at ../../archer/gdb/dwarf2-frame.c:299
#11 0x00000000007ad205 in dwarf2_frame_cache (this_frame=0x3bf8d10, 
    this_cache=0x3bf8d28) at ../../archer/gdb/dwarf2-frame.c:1090

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/14100] internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.
  2012-05-12 17:46 [Bug gdb/14100] New: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed ppluzhnikov at google dot com
  2012-08-02 13:39 ` [Bug gdb/14100] " tromey at redhat dot com
  2012-08-02 15:02 ` tromey at redhat dot com
@ 2012-08-05 19:52 ` jan.kratochvil at redhat dot com
  2012-08-06 19:23 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-08-05 19:52 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=14100

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2012-08-05 19:51:56 UTC ---
Re: RFC: one approach to fixing PR 14100
http://sourceware.org/ml/gdb-patches/2012-08/msg00117.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/14100] internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed.
  2012-05-12 17:46 [Bug gdb/14100] New: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2012-08-05 19:52 ` jan.kratochvil at redhat dot com
@ 2012-08-06 19:23 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2012-08-06 19:23 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=14100

Tom Tromey <tromey at redhat dot com> changed:

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

--- Comment #4 from Tom Tromey <tromey at redhat dot com> 2012-08-06 19:22:36 UTC ---
Fixed.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2012-08-06 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-12 17:46 [Bug gdb/14100] New: internal-error: frame_cleanup_after_sniffer: Assertion `frame->prologue_cache == NULL' failed ppluzhnikov at google dot com
2012-08-02 13:39 ` [Bug gdb/14100] " tromey at redhat dot com
2012-08-02 15:02 ` tromey at redhat dot com
2012-08-05 19:52 ` jan.kratochvil at redhat dot com
2012-08-06 19:23 ` tromey 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).