www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/09/22/05:54:07

Date: Wed, 22 Sep 1999 09:48:08 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp-workers AT delorie DOT com
Subject: symify crashes (fwd)
Message-ID: <Pine.SUN.3.91.990922094638.27608B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

Regarding the one below (posted to c.o.m.d. the other day): this is
almost certainly a buffer overrun that blows the stack (watch the EBP
value that looks like ASCII text).  The probable villain is the
declaration of the buffer where the symified info is assembled: it is
declared as "char buf[90];".

I understand that there's no limit on the maximum length of a function
name in the COFF debug info, right?

Anyway, the question is what to do when the combined length of the
function name, the source file name and the line number is more than
66, which is what's left of the 80-column line after the EIP address.

I tend to think we should define some reasonable truncation of the
function name and/or the file name, but otherwise leave it at that.  I
thought about fancier solutions, like adding options to show only the
file+line or only the function, or even an option to horizontally
scroll the display using the arrow keys.  However, since the users
won't know in advance about the problem, and by the time they know,
part of the traceback will scroll off the screen, I don't think it's
worth the hassle.  The -o switch should be the stopgap, since when
writing to a file, the line length is not limited.

I would think that it is important to solve these problems, since
people use C++ more and more, and the name-mangling there creates
monstrously-long function names.

Opinions are welcome.  Patches are even more welcome ;-)

---------- Forwarded message ----------
Date: Thu, 16 Sep 1999 20:23:46 +0100
From: Andrew R. Gillett <arg AT whangomatic DOT freeserve DOT co DOT uk>
To: djgpp AT delorie DOT com
Newgroups: comp.os.msdos.djgpp
Subject: symify crashes

The first error is my program crashing:


Shutting down Allegro
Exiting due to signal SIGSEGV
General Protection Fault at eip=0003173a
eax=1c202315 ebx=0082a768 ecx=1c202315 edx=0082a768 esi=0000000a 
edi=00591004
ebp=00124a7c esp=00124a78 program=C:\TOOLS\CODE\DEATH\DEATH.EXE
cs: sel=00a7  base=83b63000  limit=00938fff
ds: sel=00af  base=83b63000  limit=00938fff
es: sel=00af  base=83b63000  limit=00938fff
fs: sel=00af  base=83b63000  limit=00938fff
gs: sel=00bf  base=00000000  limit=ffffffff
ss: sel=00af  base=83b63000  limit=00938fff

Call frame traceback EIPs:
  0x0003173a   
_length__Ct12basic_string3ZcZt18string_char_traits1ZcZt24__defaul
t_alloc_template2b0i0+18, line 133 of death.cpp
  0x00031611   
_c_str__Ct12basic_string3ZcZt18string_char_traits1ZcZt24__default
_alloc_template2b0i0+13, line 306 of death.cpp
  0x000087d7   _play_the_game__Fv+6219, line 2171 of death.cpp
  0x0000514e   _main+10998, line 1148 of death.cpp
  0x00094832   ___crt1_startup+138


So I wrote:

C:\TOOLS\Code\Death>symify death.exe

It prints the debug information, but then:

Exiting due to signal SIGSEGV
General Protection Fault at eip=00001b8b
eax=00000000 ebx=00054140 ecx=00000000 edx=0000044a esi=00000054 
edi=000109de
ebp=3320656e esp=000509b6 program=C:\TOOLS\DJGPP\BIN\SYMIFY.EXE
cs: sel=00a7  base=83b63000  limit=00678fff
ds: sel=00af  base=83b63000  limit=00678fff
es: sel=00af  base=83b63000  limit=00678fff
fs: sel=0087  base=0000a190  limit=0000ffff
gs: sel=00bf  base=00000000  limit=ffffffff
ss: sel=00af  base=83b63000  limit=00678fff

Call frame traceback EIPs:
  0x00001b8b


Also, the debug information for my game points to lines in the source 
code which seem irrelevant - one of them is even blank. (If it's any 
help, the problem I am having is related to vectors)

-- 
Andrew Gillett      http://argnet.fatal-design.com/     ICQ: See homepage

Zygomaticofacialforumen

- Raw text -


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