delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/21/12:52:52

Message-ID: <3F1C15A3.3000302@psy.kuleuven.ac.be>
Date: Mon, 21 Jul 2003 18:32:35 +0200
From: Peter Claessens <peter DOT claessens AT psy DOT kuleuven DOT ac DOT be>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: nl-BE,en
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT elta DOT co DOT il>, djgpp AT delorie DOT com
Subject: Re: malloc/free blues
References: <3F156434 DOT 3000508 AT psy DOT kuleuven DOT ac DOT be> <uu19m75gm DOT fsf AT elta DOT co DOT il> <3F159AC9 DOT 4010402 AT student DOT kuleuven DOT ac DOT be> <3405-Thu17Jul2003062928+0300-eliz AT elta DOT co DOT il> <3F16A565 DOT F77DA70E AT psy DOT kuleuven DOT ac DOT be> <9003-Thu17Jul2003180038+0300-eliz AT elta DOT co DOT il> <3F1BE5F0 DOT 3030906 AT psy DOT kuleuven DOT ac DOT be> <7458-Mon21Jul2003182532+0300-eliz AT elta DOT co DOT il>
In-Reply-To: <7458-Mon21Jul2003182532+0300-eliz@elta.co.il>
X-Virus-Scanned: by KULeuven Antivirus Cluster

Here the results for the runs with the DEBUG flag set to 1.

I get many conversion warnings at compilation time. I guess most 
warnings are ok except for this:
"malloc.c:353: warning: unknown conversion type character `,' in format
malloc.c:353: warning: unsigned int format, pointer arg (arg 6)
malloc.c:353: warning: too many arguments for format"
I just added an 'x' after %08x->%08 to get rid of this.

C:\src\dots2002>dotread -cl
Exiting due to signal SIGSEGV
Page fault at eip=000bd61d, error=0006
eax=000000af ebx=000bd724 ecx=00000010 edx=00001757 esi=000bd724 
edi=031c17dc
ebp=00000fbc esp=00000fbc program=<**UNKNOWN**>
cs: sel=00a7  base=84830000  limit=03242fff
ds: sel=00af  base=84830000  limit=03242fff
es: sel=00af  base=84830000  limit=03242fff
fs: sel=0087  base=00015ee0  limit=0000ffff
gs: sel=00bf  base=00000000  limit=0010ffff
ss: sel=03cb  invalid
App stack: [03243000..031c3000]  Exceptn stack: [00168718..001667d8]

Call frame traceback EIPs:
  0x000bd61d

Notice the bizarre 'program' value. This is the same run under GDB:

Program received signal SIGSEGV, Segmentation fault.
0x000ca7e1 in _doprnt ()
(gdb) backtrace
#0  0x000ca7e1 in _doprnt ()
Cannot access memory at address 0x804

Under plain dos I had (leaving out trailing zeroes):
a GPF at eip=bd63f; flags=3016
eax=0 ebx=123 ecx=4000 edx=0 esi=16 edi=8fc ebp=d esp=1684d8
cs=a7 ds=af es=af fs=8f gs=bf ss=af error=0000
!
Running gdb under plain dos resulted in the same segmentation fault 
crash as above, with the same address.

This is what I got under plain dos with the DEBUG flag set to 0:

General Protection Fault at eip=00003548
eax=6d657270 ebx=00239ae0 ecx=002398e0 edx=00000048 esi=001e6980 
edi=00239ad4
ebp=001e68e8 esp=001e68d0 program=C:\SRC\DOTS2002\DOTREAD.EXE
cs: sel=00a7  base=10000000  limit=0058ffff
ds: sel=00af  base=10000000  limit=0058ffff
es: sel=00af  base=10000000  limit=0058ffff
fs: sel=00bf  base=00000000  limit=0010ffff
gs: sel=00bf  base=00000000  limit=0010ffff
ss: sel=00af  base=10000000  limit=0058ffff
App stack: [001e79d4..001679d4]  Exceptn stack: [00167918..001659d8]
 
Call frame traceback EIPs:
  0x00003548 merge(BLOCK*, BLOCK*, BLOCK*)+118, file 
c:/src/dots2002/malloc.c, l
  0x00001b01 .debug_line+22, file c:/src/dots2002/malloc.c, line 318
  0x000d3e11 operator delete(void*)+21, file fnmatch.c
  0x000fe3c8 std::string::_Rep::_M_destroy..+40, file fnmatch.c
  0x000fc1bb std::string::~string()+59, file fnmatch.c
  0x0004e050 readvar(std::string, std::st..+778, file c:/src/d..ig.cpp, 
line 162
  0x000610e2 exprun(std::string, std::s..+43154, file c:/src/d..xp.cpp, 
line 731
  0x000357c9 experiment_cmd()+1021, file c:/src/dots2002/irpreter.cpp, 
line 1006
  0x00026d11 .debug_line+1513, file c:/src/dots2002/irpreter.cpp, line 211
  0x00025d19 .debug_line+283, file c:/src/dots2002/irpreter.cpp, line 97
  0x0002562a cl()+250, file c:/src/dots2002/irface.cpp, line 74

The last 2 times I ran the prog in plain dos under gdb, it froze. Ctrl+c 
didn't solve anything, I had to reboot.

Do you think it would be a good or a bad idea to try the malloc_debug 
functions in the nmalloc package that I found under the alpha 
distribution info for djdev?

Sorry that I channel all this material through the djgpp mailing list. I 
have some problems posting on the newsgroup. (Seems I didn't sacrifice 
enough to the gods of the digital age huh.)

Thanks,
P

Eli Zaretskii wrote:

>>Date: Mon, 21 Jul 2003 15:09:04 +0200
>>From: Peter Claessens <peter DOT claessens AT psy DOT kuleuven DOT ac DOT be>
>>    
>>
>>I thought it would be a good idea to set the #DEBUG preprocessor symbol 
>>in that file to 1. Apparently it wasn't.  I get the ugliest crashes at 
>>startup of the program, apparently based on a segmentation fault (at 
>>least that's what GDB says) in the beginning of the program, before any 
>>output is sent to the screen, resulting in blue screens etc in win98. I 
>>guess the debugging code isn't meant to run under windows? Or is it 
>>really indicating something about my program being very wrong?
>>    
>>
>
>The latter, I guess.  Can you post a SYMIFY'ed traceback of such a
>crash?  Also, what happens if you boot into plain DOS (by holding F8
>or F2 during startup), and then run your program? does it crash, and
>if so, what gets printed when it does?
>
>(To run a DJGPP program on plain DOS, you will need to make sure you
>have CWSDPMI installed.)
>  
>

- Raw text -


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