Bug 10771 - Crash when using "layout next" without running process
Summary: Crash when using "layout next" without running process
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: tui (show other bugs)
Version: 7.0
: P2 minor
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 11392 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-13 17:51 UTC by vz-gdb
Modified: 2010-03-22 13:23 UTC (History)
3 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vz-gdb 2009-10-13 17:51:27 UTC
Using gdb 7.0-debian (from unstable) I stumbled upon the following bug: if you
run "gdb -tui any-program-with-debug-info" and immediately enter "layout next"
in the gdb window it crashes with:

(gdb) layout next
/tmp/buildd/gdb-7.0/gdb/gdbarch.c:1428: internal-error: gdbarch_addr_bit:
Assertion `gdbarch != NULL' failed.

This is, of course, easy to work around (layout works fine when running the
program) but should probably be easy to fix as well so I wanted to report it in
case it can be useful. Please let me know if you have any trouble reproducing
this and I'll try to provide more information.

Thanks!
Comment 1 Andrew West 2010-02-27 12:36:09 UTC
I'm seeing this as well in the latest Ubuntu, which I believe uses the same
package as debian.

Steps to reproduce;
1) Compile simple program ( debugging info isn't necessary ), e.g.;

echo -e "#include <stdio.h>\nint main( int argc, char** argv )\n{\nprintf(
\"testing\\\n\" );\n};" | g++ -xc++ -o testing -

2) Run gdb with the resulting program.

gdb ./testing

3) Switch TUI layout

layout split

Result:

/build/buildd/gdb-7.0/gdb/gdbarch.c:1428: internal-error: gdbarch_addr_bit:
Assertion `gdbarch != NULL' failed.
A problem internal to GDB has been detected,


I tried with yesterdays cvs snapshot and this produced the same results.
Comment 2 Tom Tromey 2010-03-17 18:29:11 UTC
*** Bug 11392 has been marked as a duplicate of this bug. ***
Comment 3 Daniel Jacobowitz 2010-03-22 13:23:27 UTC
This will be fixed in GDB 7.2:

2010-03-20  Daniel Jacobowitz  <dan@codesourcery.com>

        * tui/tui-disasm.c (tui_get_begin_asm_address): Default to
        get_current_arch.
        * tui/tui-layout.c (extract_display_start_addr): Likewise.

It's also fixed in the Debian packages of GDB 7.1.
Comment 4 Daniel Jacobowitz 2010-03-22 13:23:44 UTC
Really marking as fixed.