delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/25/08:31:22

Date: Tue, 25 Aug 1998 15:27:26 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Mike Rusch <ruschtmm AT newnorth DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: keyword "new" causes SIGSEV
In-Reply-To: <35E1C842.45EFF366@newnorth.net>
Message-ID: <Pine.SUN.3.91.980825152707.7520j-100000@is>
MIME-Version: 1.0

On Mon, 24 Aug 1998, Mike Rusch wrote:

> When I run the program and get to a point where reptfmtcpy is used (in
> function formatnew(), I get a SIGSEV:
> 
>   0x0000c8d0   _malloc+192

First, please never censor the traceback that is printed at the point
of crash; always post it in its entirety.  The part that you omitted
(the register dump, selectors, etc.) includes important information
that tells a lot to those who know how to read it.

And second, crashes at _malloc+192 usually mean that some part of your
program writes past the end of an allocated buffer, like if you
allocate 20-byte buffer and copy a 20-character string into it.  I
suggest to look for such code in your program.

> From the traceback it almost looks like "new" calls
> malloc, but this seems strange to me since new is supposed to be a
> keyword, and supposedly more efficient than malloc.

`new' calls `malloc' internally.  But I don't think the problem is
with `malloc', most probably your code is doing something bad.

- Raw text -


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