delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/11/22:22:19

From: "Chad Rabbitt" <chad AT rabbitt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: sigsegv on delete []
Date: 11 Jan 2000 21:17:43 EST
Organization: Concentric Internet Services
Message-ID: <85go87$hht@chronicle.concentric.net>
References: <85ehsn$p0p AT chronicle DOT concentric DOT net>
NNTP-Posting-Host: ts002d01.lon-co.concentric.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Lines: 46
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I just found a sigsegv on another delete [] statement.  This delete is in my
my main() function and is a very simple array delete of a simple char array
used for temporary storage.  almost exactly the same sigsegv occurs for this
very different area of code.  The traceback is similar:

   0x.....  _free+somenumber
   0x.....  ___builtin_vec_delete+somenumber, line 0 of new2.cc
   0x.....  _main+somenumber, line xx of main.cpp
   etc...

what is causing sigsegv's on a delete [] statement?
any feedback would be appreciated.

Chad


Chad Rabbitt <chad AT rabbitt DOT com> wrote in message
news:85ehsn$p0p AT chronicle DOT concentric DOT net...
i am wondering if anyone might have any ideas on a sigsegv that occurs on a
delete []?  after looking around, it seems i either overran the array at
some point and then when it gets deleted the problem shows up, or i delete
the same array more than once.  unfortunately, my co-worker and i can not
find either of these problems in my code.  i also used gdb and saw no data
being modified before or after the array, except for the 'in-use' bit by the
memory manager.  other notes, the delete [] statement is located in a class
destructor with three other delete [] statement before it.  the destructor
works correctly at least one time, usually more than 3 times, depending on
the computer i run the program on.  also, if i remove the delete statement
altogether, the program sigsegv's upon exiting the destructor, but before
returning to the calling statement.  i don't have the traceback in front of
me, but it generally goes:

   0x.....  _free+somenumber
   0x.....  ___builtin_vec_delete+somenumber, line 0 of new2.cc
   0x.....  _$_9destructorname+somenumber, line 50 of classfile.cpp
   etc...

curious if anyone might have some ideas.  i've also tried taking all the
code that accesses the array out, and i still get a sigsegv?  thanks,

Chad





- Raw text -


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