delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/30/15:39:37

Message-ID: <19990630193945.13176.rocketmail@web601.yahoomail.com>
Date: Wed, 30 Jun 1999 12:39:45 -0700 (PDT)
From: Mohamed Saad <bazramit AT yahoo DOT com>
Subject: malloc causing GPF?????????????
To: djgpp AT delorie DOT com
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Hi all,
   thanx a lot for replying to my previous mail! Hope
u r all fine and perfectly OKAY!

  hmmm... I am having a seriour problem! :(
   
I am writing a program. Today, when it was running, it
suddenly exited with a GPF! when i used Symify to know
the cause of the problem, it showed that malloc was
the function at top of stack!!!!! (i.e. It was the one
being executed!)... I was very perplexed! I dunno how
to begin debugging!! I don't even know the cause of
the problem!

I returned back to the line calling malloc. It was a
very simple line!! something like that... (not the
exact code! but malloc was really the 2nd line in the
function)
void new_node()
{
   node_pointer mynode;
   mynode=(node_pointer) malloc(sizeof(struct node));
   etc etc etc!
}
So, i guess there is no problem regarding the size
being requested! (the struct is just 70 bytes or so!)

Now, I need some answers to get going!! :)

i) Could the problem be in MY OWN code? How? Why did
the GPF occur in malloc itself?? What kind of bugs can
cause this GPF? how can I know the cause of the
problem?

ii) Did a similar problem occur to anyone? did he know
the cause of it? if so, would u please tell me how did
it happen?

iii) Could the problem be in malloc itself?? My
program calls malloc() and free() TONS of
times!!(about 800 times, and may  be larger!). Is
there a problem regarding malloc and free when called
a LOT of times? If this is the cause, what is the
solution? I have some replacements for malloc. but i
want to know HOW to compile the libraries? (The only C
compiler i have is DJGPP)

Thanx in advance... Looking forward to hearing from u.
C u soon.

With lots of luv,
  Mohamed El Dawy

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

- Raw text -


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