Bug 12109 - gdb when asked for backtrace produces python traceback
Summary: gdb when asked for backtrace produces python traceback
Status: RESOLVED DUPLICATE of bug 11324
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: 7.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-11 08:16 UTC by Jan Kratochvil
Modified: 2010-10-14 15:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2010-10-11 08:16:24 UTC
by Michal Hlavinka:

I've opened coredump with gdb, asked it for backtrace, but during the backtrace
there is printed also some python Traceback despite that application does not
use python at all, so I guess this is caused by gdb itself.

(gdb) bt
#0  0x000000329e431a7a in g_hash_table_lookup_node (hash_table=Traceback (most
recent call last):
  File "/usr/share/glib-2.0/gdb/glib.py", line 152, in pretty_printer_lookup
    return GHashPrinter(val)
  File "/usr/share/glib-2.0/gdb/glib.py", line 119, in __init__
    if self.val != 0 and string_hash != None and self.val["hash_func"] ==
string_hash:
RuntimeError: Cannot access memory at address 0x5cd00007273
0x5cd00007253, key=0x416ef6) at ghash.c:312
#1  g_hash_table_lookup (hash_table=Traceback (most recent call last):
  File "/usr/share/glib-2.0/gdb/glib.py", line 152, in pretty_printer_lookup
    return GHashPrinter(val)
  File "/usr/share/glib-2.0/gdb/glib.py", line 119, in __init__
    if self.val != 0 and string_hash != None and self.val["hash_func"] ==
string_hash:
RuntimeError: Cannot access memory at address 0x5cd00007273
0x5cd00007253, key=0x416ef6) at ghash.c:901
#2  0x0000000000409998 in cb_util_line_chart_refresh_control (pm=0x1718c00) at
gapcmon.c:1622


I think it should be printed as <corrupted> or something. It was quite odd when
I've faced it for first time, hard to tell what was happening. Sometimes I'm
sending backtraces to upstreams that knows that there is something like Linux
out there and sometimes they have "basic" questions about gdb output, I guess
they won't understand what is that traceback doing there. Also don't forget
there are other tools using gdb as backend. For example kdbg which shows just
"hash_table = Traceback" and that's all. This should be reported the same way
as <value optimized out> for example as <structure corrupted>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Downstream Bug: https://bugzilla.redhat.com/show_bug.cgi?id=640985

Maybe to suppress Python output during `bt' but display it later for:
(gdb) print hash_table
?

Also why is Python pretty printer applied at all when it gets output just as:

#0  g_hash_table_lookup (hash_table=0x123f5e0 = {...}, key=0x7fffb2ca8830) at ghash.c:895
Comment 1 Tom Tromey 2010-10-14 15:10:25 UTC
Dup.

> Maybe to suppress Python output during `bt' but display it later for:
> (gdb) print hash_table
> ?

Yeah, that seems reasonable.

> Also why is Python pretty printer applied at all when it gets output just as:

> #0  g_hash_table_lookup (hash_table=0x123f5e0 = {...}, key=0x7fffb2ca8830) at ghash.c:895

The printer might change the abbreviated output, if it has a to_string method.

*** This bug has been marked as a duplicate of bug 11324 ***