Crashing gdb with python-prettyprinting

Joachim Protze
2010-07-27T15:35:02Z

Hi,

i am writing on a python-prettyprinter for an quite complex
datastructure. It runs quite stable. But sometimes i get the appended
segfault. I can reproduce it by calling "info locals" and pressing
enter-key. I appended also the contents of the frame_info at the end of
the mail. For some reason at one point the frame_info gets corrupted.
Possibly overwritten by my python extension?

Is it right, that the content of frame_info should not change while the
program is halted and i just call a series of "info locals"?

I'm new in debuging gdb by gdb. Can someone give me a hint, how i can
set a breakpoint in the outer gdb while the inner gdb is running? Or
which way can i check the proper contents of frame_info before the crash?

I also tried to run gdb with duma to find the memory failure, where the
frame_info is overwritten, but with running duma each step and each
function call of gdb gets damn slow.

I dont know, if it is important, but the arch i'm working on is ia64.
I tried gdb-7.1 and yesterdays snapshot: gdb-7.2.50.20100726

Gratefully waiting for your advices,

Joachim

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

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2305843009219149824 (LWP 29330)]
0x40000000000b8a90 in frame_unwind_arch (next_frame=0x21c) at frame.c:2061
2061 if (!next_frame->prev_arch.p)

(gdb) bt
#0 0x40000000000b8a90 in frame_unwind_arch (next_frame=0x21c) at
frame.c:2061
#1 0x40000000000b8a20 in get_frame_arch (this_frame=0x6000000000635220)
at frame.c:2055
#2 0x400000000057c180 in dwarf_expr_read_reg (baton=0x607fffffff16dc28,
dwarf_regnum=12) at dwarf2loc.c:140

[....]

(gdb) p *(struct frame_info *)0x6000000000635220
$1 = {level = 1612, pspace = 0x1, aspace = 0x603fffffffffe060,
prologue_cache = 0x0, unwind = 0x10, prev_arch = {p = 1, arch = 0x14},
prev_pc = {p = 1, value = 24}, prev_func = {addr = 1, p = 28}, this_id =
{p = 1, value = {stack_addr = 528, code_addr = 1, special_addr = 532,
stack_addr_p = 1, code_addr_p = 0, special_addr_p = 0, inline_depth =
0}}, base = 0x218, base_cache = 0x1, next = 0x21c, prev_p = 1, prev =
0x690, stop_reason = UNWIND_NULL_ID}