From: <uday@veritas.com>
To: gcc-help@gcc.gnu.org
Subject: MALLOC_CHECK_ use
Date: Tue, 25 Apr 2000 07:00:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.21.0004251917440.2685-100000@arya.vxindia.veritas.com> (raw)
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
reply other threads:[~2000-04-25 7:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.21.0004251917440.2685-100000@arya.vxindia.veritas.com \
--to=uday@veritas.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).