delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/18/17:09:21

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E00F1DA.6B0D05B5@phekda.freeserve.co.uk>
Date: Wed, 18 Dec 2002 22:08:26 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP newsgroup <djgpp AT delorie DOT com>
Subject: gdb 5.2.1 segfaults while debugging fileutils 4.1
Reply-To: djgpp AT delorie DOT com

Hello.

I seem to be having some trouble debugging fileutils 4.1 with gdb 5.2.1.
Here's the situation:

* fileutils 4.1 and DJGPP CVS both built with -gstabs+3.
* gdb 5.2.1 from binaries on Simtel.NET or gdb 5.2.1 built against DJGPP CVS.

If I load up gdb on cp from fileutils 4.1 ("cd gnu/filutil4.1/src; gdb
cp.exe"), then type "b copy" then TAB, gdb segfaults. The symify message is
below. I press tab to complete for the copy_internal function. If I type "b
copy_internal", the breakpoint is set OK.

(gdb) b copyExiting due to signal SIGSEGV
Page fault at eip=00177586, error=0004
eax=02980063 ebx=02980000 ecx=00000004 edx=00000000 esi=00247552 edi=00001308
ebp=00247458 esp=00247450 program=C:\DJGPP.204\BIN\GDB.EXE
cs: sel=00f7  base=84523000  limit=ffa4ffff
ds: sel=00ff  base=84523000  limit=ffa4ffff
es: sel=00ff  base=84523000  limit=ffa4ffff
fs: sel=00d7  base=0001d310  limit=0000ffff
gs: sel=010f  base=00000000  limit=0010ffff
ss: sel=00ff  base=84523000  limit=ffa4ffff
App stack: [00247d04..001c7d04]  Exceptn stack: [001c7338..001c53f8]

Call frame traceback EIPs:
  0x00177586 _strncmp+22
  0x000682fd _contained_in+93
  0x000685f2 _make_symbol_completion_list+482
  0x00050739 _location_completer+649
  0x0005090b _complete_line+203
  0x00050bd3 _line_completion_function+51
  0x0005033f _readline_line_completion_function+31
  0x0014252f _completion_matches+47
  0x001416b3 _rl_insert_completions+1747
  0x001422e4 _rl_complete_internal+148
  0x0013b1ba __rl_dispatch+170
  0x0013af46 _readline_internal_char+134
  0x00146444 _rl_callback_read_char+20
  0x0003dfba __initialize_language+666
  0x0003e55e _stdin_event_handler+94
  0x0008930c _delete_file_handler+556
  0x00088e54 _find_common_for_function+356
  0x00088ea6 _find_common_for_function+438
  0x0000319f _do_catch_errors+15
  0x000030a0 _throw_exception+464
  0x000031e6 _catch_errors+54
  0x00088ec8 _start_event_loop+24
  0x000017b4 __crt0_init_mcount+78
  0x0000319f _do_catch_errors+15
  0x000030a0 _throw_exception+464
  0x000031e6 _catch_errors+54
  0x000024cb __crt0_init_mcount+3429
  0x0000319f _do_catch_errors+15
  0x000030a0 _throw_exception+464
  0x000031e6 _catch_errors+54
  0x000025e9 _main+41
  0x00174ef7 ___crt1_startup+199
bash-2.04$ symify c:/djgpp.204/bin/gdb.exe

The gdb header was chopped off by the screen scrolling, but it looks like
this:

GNU gdb 5.2.1
Copyright 2002 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 "i386-pc-msdosdjgpp".

If I set the breakpoint using the full name of the function, gdb/the program
crashes a bit later:

bash-2.04$ !gdb
gdb cp.exe
GNU gdb 5.2.1
Copyright 2002 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 "i386-pc-msdosdjgpp"...
(gdb) b copy_internal
Breakpoint 1 at 0x48ec: file copy.c, line 598.
(gdb) r -v a:/loc_reg c://tmp/part-symlink/rem_sl
Starting program: c:/djgpp.204/gnu/filutil4.1/src/cp.exe -v a:/loc_reg
c://tmp/
art-symlink/rem_sl

Breakpoint 1, copy_internal (src_path=0xa7bf8 "c://tmp/part-symlink/rem_sl",
    dst_path=0xa7bf8 "c://tmp/part-symlink/rem_sl", new_dst=0, device=0,
    ancestors=0x0, x=0xa72b8, move_mode=0, copy_into_self=0xa71bc,
    rename_succeeded=0x0) at copy.c:598
598       if (move_mode && rename_succeeded)
(gdb) b lstat
Breakpoint 2 at 0x100ff: file lstat.c, line 900.
(gdb) c
Continuing.

Breakpoint 2, lstat (path=0xa6ef0 "a:/loc_reg", statbuf=0xa70e0) at
lstat.c:900
900       int  e = errno;
(gdb) n
899     {
(gdb)
900       int  e = errno;
(gdb)
904       if (!path || !statbuf)
(gdb)
910       if ((pathlen = strlen (path)) >= MAX_TRUE_NAME)
(gdb)
Exiting due to signal SIGSEGV
Page fault at eip=00064d52, error=0004
eax=0000000a ebx=2e2f2e2e ecx=00000015 edx=0025bee0 esi=002b606c edi=00000403
ebp=002473c8 esp=002473b0 program=C:\djgpp.204\gnu\filutil4.1\src\cp.exe
cs: sel=00f7  base=84523000  limit=ffa4ffff
ds: sel=00ff  base=84523000  limit=ffa4ffff
es: sel=00ff  base=84523000  limit=ffa4ffff
fs: sel=00d7  base=0001d310  limit=0000ffff
gs: sel=010f  base=00000000  limit=0010ffff
ss: sel=00ff  base=84523000  limit=ffa4ffff
App stack: [000a7368..00027368]  Exceptn stack: [000271a8..00025268]

Any ideas?

Thanks, bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019