06-03-2006
The problem in not in free. You get this error when your code has altered (overwritten) an object pointer. This usually happens when you overflow an array.
libstd++ uses libc calls because C++ is compiled to use a lot of C primitives.
I think your problem manifests itself at mim.cpp line 49. (In other words, you overwrote memory prior to that line and when free was executed it the pointer it was trying to free actually referenced invalid memory ) Try using either valgrind or electric fence to isolate your problem.
8 More Discussions You Might Find Interesting
1. Programming
I ran degugger in C++ and the followings are the message I got:
Program received signal SIGABRT, Aborted.
0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) info s
#0 0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x002e97f5 in raise () from /lib/tls/libc.so.6... (1 Reply)
Discussion started by: napapanbkk
1 Replies
2. Programming
Here is my initiating code:
#define NUM 20
static struct tab {
int count;
int use;
} tab;
int curtab = 0;
int tab_create(int tab_count)
{
curtab++;
tab.use = 1;
tab.count = tab_count;
kprintf("here!");
return curtab;
} (2 Replies)
Discussion started by: micmac700
2 Replies
3. AIX
Hello,
One of our customer is getting segmentation fault when he runs his shell script which invokes our executable on AIX 6.1.
On AIX 5.3, there were no issues.
Here is the truss output.
811242: __loadx(0x0A040000, 0xF0D3A26C, 0x00000000, 0x00000009, 0x00000000) = 0xF026E884... (0 Replies)
Discussion started by: erra_krishna
0 Replies
4. Programming
i am executing following program
int main()
{ char str;
FILE * fp;
int i=0; ... (4 Replies)
Discussion started by: bhavesh.sapra
4 Replies
5. Programming
I am making a command line program in C using XCode. When running the program, it initially does what it is supposed to do (asks me for a file path). However, when I type in a valid and existing file path, it gives me the following error:
Program received signal: “EXC_BAD_ACCESS”.... (6 Replies)
Discussion started by: mdonova33
6 Replies
6. Programming
Im using gdb and when a user disconnects from my server I receive a message
Program received signal SIGABRT, Aborted.
0x7ffe0304 in ?? ()
I was hoping someone here might have a explination for this message in gdb (26 Replies)
Discussion started by: Errigour
26 Replies
7. Programming
Hello everybody,
I've been working on a program on my Linux box, after finished the code, i compile it with gcc -Wall option, so i can see what's wrong or unused.
The Walll output shows nothing, so there are no loose ends on the program.
I run the program on my system, and it works PERFECTLY.... (5 Replies)
Discussion started by: Zykl0n-B
5 Replies
8. Programming
I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this :
i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Discussion started by: pooyair
6 Replies
LEARN ABOUT ULTRIX
pfm_cleanup
pfm_cleanup(3ncs) pfm_cleanup(3ncs)
Name
pfm_cleanup - establish a clean-up handler
Syntax
#include <idl/c/base.h>
#include <idl/c/pfm.h>
status_$t pfm_$cleanup(cleanup_record)
pfm_$cleanup_rec *cleanup_record;
Arguments
cleanup_record A record of the context when is called. A program should treat this as an opaque data structure and not try to alter
or copy its contents. It is needed by and to restore the context of the calling process at the clean-up handler entry
point.
Description
The routine establishes a clean-up handler that is executed when a fault occurs. A clean-up handler is a piece of code executed before a
program exits when a signal is received by the process. The clean-up handler begins where is called; the routine registers an entry point
with the system where program execution resumes when a fault occurs. When a fault occurs, execution resumes after the most recent call to
There can be more than one clean-up handler in a program. Multiple clean-up handlers are executed consecutively on a last-in/first-out
basis, starting with the most recently established handler and ending with the first clean-up handler. The system provides a default
clean-up handler established at program invocation. The default clean-up handler is always called last, just before a program exits, and
releases any system resources still held, before returning control to the process that invoked the program.
Diagnostics
When called to establish a clean-up handler, returns the status pfm_$cleanup_set to indicate the clean-up handler was successfully estab-
lished. When the clean-up handler is entered in response to a fault signal, effectively returns the value of the fault that triggered the
handler.
This section lists status codes for errors returned by this routine in
pfm_$bad_rls_order Attempted to release a clean-up handler out of order.
pfm_$cleanup_not_found
There is no pending clean-up handler.
pfm_$cleanup_set A clean-up handler was established successfully.
pfm_$cleanup_set_signaledl
Attempted to use pfm_$cleanup_set as a signal.
pfm_$invalid_cleanup_rec
Passed an invalid clean-up record to a routine.
pfm_$no_space Cannot allocate storage for a clean-up handler. Clean-up handler code runs with asynchronous faults inhibited. When
returns something other than pfm_$cleanup_set indicating that a fault has occurred, there are four possible ways to
leave the clean-up code:
o The program can call to start the next clean-up handler with a different fault signal.
o The program can call to start the next clean-up handler with the same fault signal.
o The program can continue with the code following the clean-up handler. It should generally call to reenable
asynchronous faults. Execution continues from the end of the clean-up handler code; it does not resume where
the fault signal was received.
o The program can reestablish the handler by calling before proceeding.
Files
See Also
intro(3ncs), pfm_signal(3ncs)
pfm_cleanup(3ncs)