delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/09/18:01:40

X-Sender: dlanor AT mail DOT dds DOT nl
Message-Id: <l03130300b3848b7ad037@[145.98.116.77]>
In-Reply-To: <Pine.SUN.3.91.990609113850.11862L-100000@is>
References: <l03130300b383102c9e18@[145.98.116.75]>
Mime-Version: 1.0
Date: Wed, 9 Jun 1999 23:51:59 +0200
To: djgpp AT delorie DOT com
From: Dlanor Blytkerchan <dlanor AT dds DOT nl>
Subject: Re: malloc() problem (resumed)
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

>> In response to the suggestion of running go32-v2 from within the program.
>> I've done that just now. The error is still the same. go32-v2 reports just
>> below 2 MBs of free DPMI memory available, and several MBs of swap space.
>Weird.  Please post the shortest program that exhibits this problem on
>your system, and also the command line you used to compile and link it.
The shortest program that exhibits this error would be the only program
that exhibits this error - as there is only one. It's complete source -
including that of the VGAP libraries it uses, is rather lengthy though, so
I won't post it here. It wouldn't help much anyway: it's exact structure is
irrelevant to solve the problem at hand. I've already posted the part of
the code that causes the problem. In the mean time, I have tried something
else: I've tried using malloc in the simplest form possible:

#include <stdio.h>
#include <stdlib.h>

int main(void) {
  char *prr;

  if ((prr = malloc(34 * 1024)) != NULL) {
    free(prr);
  } // if

  return(0);
} // main()

The weird thing is, though it does the same thing, it does not produce the
error. The only diffirence is the VGAP library being linked in. Removing it
(the library) from the program itself does not remove the error, even
though it does exactly the same as the source above (and I do mean exactly
the same).

>Where did you invoke go32-v2, exactly?  Was that in the same place where
>the offending malloc was returning the NULL pointer, or somewhere else?
In the actual program, go32-v2 is invoked right before the malloc()
statement. I've tried it with and without seporatly invoking CWSDPMI from
the program as a child process - that only makes RHIDE crash, but does not
solve the problem.

I have decided to simply rewrite the program from scratch to what it is
now, testing it at every statement I put in (i.e. I'll comment out
everything and let them back in one by one). Once it starts producing the
error, it will have been localized to the method invoked, which will be
removed until a better one can take it's place.

Greetz!

Dlanor


- Raw text -


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