Bug 142387 - gdb segv's when loading a kernel module if debuginfo is around
gdb segv's when loading a kernel module if debuginfo is around
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb (Show other bugs)
4.0
powerpc Linux
medium Severity medium
: ---
: ---
Assigned To: Elena Zannoni
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-09 09:25 EST by David Howells
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-09 12:04:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Howells 2004-12-09 09:25:58 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux) (KHTML, like Gecko)

Description of problem:
I've got the latest ppc64 gdb that I can find () installed on
pseries.cambridge.redhat.com:

  pseries>rpm -q gdb
  gdb-6.1post-1.20040607.62

If I try to load the jbd kernel module from the Beta2 kernel whilst having the
matching debuginfo also installed gdb crashes:

  pseries>gdb /lib/modules/2.6.9-1.648_EL/kernel/fs/jbd/jbd.ko 
  GNU gdb Red Hat Linux (6.1post-1.20040607.62rh)
  Copyright 2004 Free Software Foundation, Inc.
  GDB is free software, covered by the GNU General Public License, and you are
  welcome to change it and/or distribute copies of it under certain conditions.
  Type "show copying" to see the conditions.
  There is absolutely no warranty for GDB.  Type "show warranty" for details.
  This GDB was configured as "ppc64-redhat-linux-gnu"...Segmentation fault

The kernel I'm targetting with gdb is 2.6.9-1.648_EL.

You should be able to just log in to pseries.cambridge and have a look for
yourself if you wish.

Installing the gdb-debuginfo too, and running this gdb under another gdb
shows:

  Program received signal SIGSEGV, Segmentation fault.
  read_unsigned_leb128 (abfd=0x0, 
      buf=0x8039c792e1 <Address 0x8039c792e1 out of bounds>, 
      bytes_read_ptr=0x1ffffffe2e4)
      at ../../gdb+dejagnu-20040607/gdb/dwarf2read.c:5529
  5529          byte = bfd_get_8 (abfd, (bfd_byte *) buf);
  (gdb) bt
  #0  read_unsigned_leb128 (abfd=0x0, 
      buf=0x8039c792e1 <Address 0x8039c792e1 out of bounds>, 
      bytes_read_ptr=0x1ffffffe2e4)
      at ../../gdb+dejagnu-20040607/gdb/dwarf2read.c:5529
  #1  0x0000000010156bc4 in peek_die_abbrev (info_ptr=0x0, 
      bytes_read=0x1ffffffe2e4, cu=0x1ffffffe0b0)
      at ../../gdb+dejagnu-20040607/gdb/dwarf2read.c:1904
  #2  0x000000001015d674 in dwarf2_build_psymtabs (objfile=0x105fd600, 
      mainline=274970816) at ../../gdb+dejagnu-20040607/gdb/dwarf2read.c:4705
  #3  0x000000001015134c in elf_symfile_read (objfile=0x105fd600, mainline=0)
      at ../../gdb+dejagnu-20040607/gdb/elfread.c:581
  #4  0x00000000100f9ea8 in syms_from_objfile (objfile=0x105fd600, 
      addrs=0x105e2dd0, offsets=0x2f, num_offsets=0, mainline=0, verbo=274754280)
      at ../../gdb+dejagnu-20040607/gdb/symfile.c:715
  #5  0x00000000100fbae4 in symbol_file_add_with_addrs_or_offsets (
      abfd=0x105d0a90, from_tty=0, addrs=0x0, offsets=0x0, num_offsets=0, 
      mainline=0, flags=0) at ../../gdb+dejagnu-20040607/gdb/symfile.c:835
  #6  0x4402242410535528 in ?? ()
  #7  0x00000000100fbcc0 in symbol_file_add_with_addrs_or_offsets (
      abfd=0x105ccfe0, from_tty=0, addrs=0x105c91c0, offsets=0x0, num_offsets=0, 
      mainline=1, flags=0) at ../../gdb+dejagnu-20040607/gdb/symfile.c:870
  #8  0x440004241051e610 in ?? ()
  #9  0x00000000100fc8cc in symbol_file_add_main_1 (args=0x0, 
      from_tty=969380577, flags=-8016)
      at ../../gdb+dejagnu-20040607/gdb/symfile.c:964
  #10 0x0000000010063790 in do_captured_command (data=0x0)
      at ../../gdb+dejagnu-20040607/gdb/top.c:554
  #11 0x00000000100636c8 in do_catch_errors (uiout=0x0, data=0x8039c792e1)
      at ../../gdb+dejagnu-20040607/gdb/top.c:524
  #12 0x0000000010063514 in catcher (
      func=@0x104f64d8: 0x1006369c <do_catch_errors>, func_uiout=0x1058f420, 
      func_args=0x1ffffffec60, func_val=0x1ffffffec50, 
      func_caught=0x1ffffffec54, errstring=0x3 <Address 0x3 out of bounds>, 
      gdberrmsg=0x0, mask=6) at ../../gdb+dejagnu-20040607/gdb/top.c:431
  #13 0x000000001006372c in catch_errors (func=0, func_args=0x8039c792e1, 
      errstring=0x3 <Address 0x3 out of bounds>, mask=0)
      at ../../gdb+dejagnu-20040607/gdb/top.c:536
  #14 0x00000000100637f0 in catch_command_errors (command=0, 
      arg=0x8039c792e1 <Address 0x8039c792e1 out of bounds>, from_tty=-7452, 
      mask=40210939) at ../../gdb+dejagnu-20040607/gdb/top.c:574
  #15 0x000000001005d9bc in captured_main (data=0x1ffffffee50)
      at ../../gdb+dejagnu-20040607/gdb/main.c:665
  #16 0x00000000100636c8 in do_catch_errors (uiout=0x0, data=0x8039c792e1)
      at ../../gdb+dejagnu-20040607/gdb/top.c:524
  #17 0x0000000010063514 in catcher (
  ---Type <return> to continue, or q <return> to quit---
      func=@0x104f64d8: 0x1006369c <do_catch_errors>, func_uiout=0x10486bb0, 
      func_args=0x1fffffff3e0, func_val=0x1fffffff3d0, 
      func_caught=0x1fffffff3d4, errstring=0x3 <Address 0x3 out of bounds>, 
      gdberrmsg=0x0, mask=6) at ../../gdb+dejagnu-20040607/gdb/top.c:431
  #18 0x000000001006372c in catch_errors (func=0, func_args=0x8039c792e1, 
      errstring=0x3 <Address 0x3 out of bounds>, mask=0)
      at ../../gdb+dejagnu-20040607/gdb/top.c:536
  #19 0x000000001005e39c in gdb_main (args=0x8039c792e1)
      at ../../gdb+dejagnu-20040607/gdb/main.c:815
  #20 0x000000001005d15c in main (argc=0, argv=0x8039c792e1)
      at ../../gdb+dejagnu-20040607/gdb/gdb.c:35
  (gdb) The program is running.  Exit anyway? (y or n) y


Note that the problem also occurs with gdb-6.1post-1.20040607.8.


Version-Release number of selected component (if applicable):
gdb-6.1post-1.20040607.62

How reproducible:
Always

Steps to Reproduce:
1. Install kernel and matching debuginfo
2. Load kernel module into gdb

  

Actual Results:  gdb segfaulted

Expected Results:  gdb should've given me a prompt (or an error).

Additional info:
Comment 1 Jeff Johnston 2004-12-09 12:04:52 EST
This problem should go away in the next release of the kernel.  
The version of gcc used to build the 648_EL kernel
produced invalid debuginfo.  This causes gdb to fail on multiple
platforms when it ended up following a bad offset in the debug info.

The following is taken from bugzilla 141523 which this bug is a duplicate
of.

"I re-tested all of the other associated bugzillas (141526, 141529,
 141530, 141532, 141534), and found that the gdb/kernel-module problems
 all disappear with the upgrade of gcc-3.4.2-6.fc3 to gcc-3.4.3-6EL4,
 which happened somewhere between kernel releases 2.6.9-1.648_EL and
 2.6.9-1.860_EL."

Note You need to log in before you can comment on or make changes to this bug.