* MALLOC_CHECK_ use
@ 2000-04-25 7:00 uday
0 siblings, 0 replies; only message in thread
From: uday @ 2000-04-25 7:00 UTC (permalink / raw)
To: gcc-help
HI,
I have trouble using MALLOC_CHECK_ to check invalid memory frees in my
program.
When I don't export this variable my program gives sigsegv. Here is
trace
Program received signal SIGSEGV, Segmentation fault.
0x402e4e79 in chunk_free (ar_ptr=0x40379040, p=0xd99783e8) at
malloc.c:3030
3030 malloc.c: No such file or directory.
(gdb) bt
#0 0x402e4e79 in chunk_free (ar_ptr=0x40379040, p=0xd99783e8) at
malloc.c:3030
#1 0x402e4bfd in chunk_alloc (ar_ptr=0x40379040, nb=16) at malloc.c:2541
#2 0x402e440a in __libc_malloc (bytes=12) at malloc.c:2643
#3 0x805baac in __builtin_new (sz=12) at
../../gcc-2.95.2/gcc/cp/new1.cc:77
#4 0x401b7c49 in TRefObject<WideString>::TRefObject ()
But if I set the value of MALLOC_CHECK_=2, program works just fine !
According to the libc document the program should abort when invalid
memory operation is done.
Why I am doing this is, I suspect the invalid memory operation is done
some time before I received sigsegv. When I set MALLOC_CHECK_=2, I should
get that instance.
I am using sigstl in my program. I am running it on RH6.2 with gcc 2.95.2.
Thanks for the help,
uday
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-04-25 7:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-25 7:00 MALLOC_CHECK_ use uday
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).