delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/13/08:30:02

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <3C6A67A3.72C5DF79@yahoo.com>
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Malloc/free DJGPP code
Lines: 43
Date: Wed, 13 Feb 2002 13:17:57 GMT
NNTP-Posting-Host: 12.90.176.73
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1013606277 12.90.176.73 (Wed, 13 Feb 2002 13:17:57 GMT)
NNTP-Posting-Date: Wed, 13 Feb 2002 13:17:57 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Is there a known incompatibility between printfs and malloc?

[1] c:\c\hashlib>*gcc -W -Wall -O2 -gstabs+ -Dinline= -c malloc.c

[1] c:\c\hashlib>gcc -o hshtestp.exe hashtest.o cokusMT.o
hashlib.o malloc.o

[1] c:\c\hashlib>timerun hshtestp 4 30000
Timer 3 on:  7:57:19
Exiting due to signal SIGSEGV
Stack Fault at eip=00005d18
eax=00000123 ebx=00000123 ecx=00000073 edx=000033bb esi=d8b00000
edi=0000bea0
ebp=00000013 esp=00000003 program=<??UNKNOWN??>
cs: sel=00af  base=83386000  limit=0023ffff
ds: sel=00b7  base=83386000  limit=0023ffff
es: sel=00b7  base=83386000  limit=0023ffff
fs: sel=0087  base=0000b600  limit=0000ffff
gs: sel=00c7  base=00000000  limit=0010ffff
ss: sel=00b7  base=83386000  limit=0023ffff
App stack: [00091910..00011910]  Exceptn stack:
[00011870..0000f930]

Call frame traceback EIPs:
  0x00005d18
Timer 3 off:  7:57:20  Elapsed: 0:00:00.50

Maybe there are initializing calls to malloc before conditions for
printf are setup? This arose when attempting to enable some of the
malloc debug statements, which required adding #include <stdio.h>
to it.  In the above, the main program sign-on has not occurred.

I initially thought it might have to do with the -pg switch, so I
removed that as above, and the crash still occurred.

If this is a "don't do that" situation, how can we get malloc
debug printouts?

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   (Remove "XXXX" from reply address. yahoo works unmodified)
   mailto:uce AT ftc DOT gov  (for spambots to harvest)

- Raw text -


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