[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Weird segfault with library



Daniel Jacobowitz <dan@debian.org> writes:

> Hmm, can you gdb this and show a stack trace?

Oops, I forgot to post that. (I recompiled the old bash with symbols.)
It's not terribly enlightening.

(gdb) where
#0  0x0 in ?? ()
#1  0x8068737 in find_user_command_in_path (name=0xbffffd76 "bash", 
    path_list=0x80b508c "/home/maor/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:
/usr/local/bin", flags=36) at execute_cmd.c:4400
#2  0x8067e51 in _find_user_command_internal (name=0xbffffd76 "bash", flags=36)
    at execute_cmd.c:4070
#3  0x8067e80 in find_user_command_internal (name=0xbffffd76 "bash", flags=36)
    at execute_cmd.c:4090
#4  0x8067d6e in find_user_command (name=0xbffffd76 "bash")
    at execute_cmd.c:4038
#5  0x806923b in get_bash_name () at variables.c:449
#6  0x8068e78 in initialize_shell_variables (env=0xbffffc98, no_functions=0)
    at variables.c:316
#7  0x8055501 in shell_initialize () at shell.c:1241
#8  0x8053d43 in main (argc=1, argv=0xbffffc90, env=0xbffffc98) at shell.c:411
(gdb) up
#1  0x8068737 in find_user_command_in_path (name=0xbffffd76 "bash", 
    path_list=0x80b508c "/home/maor/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/usr/local/bin", flags=36) at execute_cmd.c:4400
4400      stat (".", &dotinfo);
(gdb) p dotinfo
$2 = {st_dev = 18446744073709551615, __pad1 = 65535, st_ino = 4294967295, 
  st_mode = 4294967295, st_nlink = 4294967295, st_uid = 1073786568, 
  st_gid = 0, st_rdev = 6568, __pad2 = 64152, st_size = 134736623, 
  st_blksize = 134974252, st_blocks = 134885653, st_atime = 49, 
  __unused1 = 134974284, st_mtime = -1073743188, __unused2 = 134652531, 
  st_ctime = 134885653, __unused3 = 134966828, __unused4 = 134974284, 
  __unused5 = 3221224132}


Interestingly, running it from the command line produces different
results:

(gdb) femto[~]$ gdb /bin/bash 
GNU gdb 4.17.m68k.objc.threads.hwwp.fpu.gnat
Copyright 1998 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 "i586-pc-linux-gnu"...
######### gdb is working fine as you can see by the next line
readline version 2.2-bash
(gdb) run
Starting program: /bin/bash 

Program received signal SIGSEGV, Segmentation fault.
0x0 in ?? ()
(gdb) where
#0  0x0 in ?? ()
#1  0x809399c in _evalfile (filename=0x80bbe0c "/home/maor/.bashrc", flags=9)
    at evalfile.c:82
#2  0x8093ed5 in maybe_execute_file (fname=0x80a1574 "~/.bashrc", 
    force_noninteractive=1) at evalfile.c:199
#3  0x8054788 in run_startup_files () at shell.c:821
#4  0x8053edd in main (argc=1, argv=0xbffffc90, env=0xbffffc98) at shell.c:470
(gdb) up
#1  0x809399c in _evalfile (filename=0x80bbe0c "/home/maor/.bashrc", flags=9)
    at evalfile.c:82
82        if (fd < 0 || (fstat (fd, &finfo) == -1))
(gdb) p fd
$1 = 5
(gdb) p finfo
$2 = {st_dev = 18446744073709551615, __pad1 = 65535, st_ino = 4294967295, 
  st_mode = 4294967295, st_nlink = 4294967295, st_uid = 4294967295, 
  st_gid = 4294967295, st_rdev = 18446744073709551615, __pad2 = 65535, 
  st_size = -1, st_blksize = 4294967295, st_blocks = 4294967295, 
  st_atime = -1, __unused1 = 4294967295, st_mtime = -1, 
  __unused2 = 4294967295, st_ctime = -1, __unused3 = 4294967295, 
  __unused4 = 3221224324, __unused5 = 134877351}
(gdb) 

So it does consistently crash inside a stat or fstat call.


> Also - I assume the soname has not changed?

Correct.


Guy


Reply to: