From: B S Srinidhi <srinidhi-c@deeproot.co.in>
To: linux-c-programming@vger.kernel.org
Subject: Re: amd64 :: SIGABRT in malloc()
Date: Fri, 17 Mar 2006 11:44:23 +0530 [thread overview]
Message-ID: <1142576064.3744.19.camel@avirat> (raw)
In-Reply-To: <17433.17469.719361.117297@cerise.gclements.plus.com>
Hi,
On Thu, 2006-03-16 at 10:55 +0000, Glynn Clements wrote:
> The heap has been corrupted, e.g. due to a buffer overrun.
>
Thanks a lot for the tip-off. :) After reading this and a suggestion
from one of my friends, I ran the program in valgrind.
/me still wondering why didn't he think of that earlier.
> > How can I debug this problem?
>
> Tracking down heap corruption can be awkward, as the error won't
> usually occur until some time later. There are some hints in the glibc
You are absolutely right. Such a crash occurs much later the culprit
have left the scene. Policing such a thing is quite difficult.
> Info file regarding the use of mprobe(). Another possibility is
> Electric Fence (libefence).
>
mcheck() and mprobe() didn't help me much (or I didn't know what to
infer from their output :D)
I used valgrind instead, and it pointed out a specific error that caught
my attention:
Address 0x6BE0300 is 0 bytes after a block of size 432 alloc'd
This error was being generated at a place where I was allocating a
structure (much before the actual crash) and without checking the return
value of malloc(), data was written into the structure. Which caused all
the problem.
Now I'm trying to analyze the output of valgrind and doing some more
checks on the code.
Thanks a lot everyone who responded to my post. :D
Srinidhi.
--
ASCII ribbon campaign ( ) B S Srinidhi
- against HTML email X http://srinidhi.deeproot.co.in
& vCards / \ DeepRoot Linux
next prev parent reply other threads:[~2006-03-17 6:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-16 10:28 amd64 :: SIGABRT in malloc() B S Srinidhi
2006-03-16 10:38 ` Mihai Dontu
2006-03-16 10:52 ` B S Srinidhi
2006-03-16 10:55 ` Glynn Clements
2006-03-17 6:14 ` B S Srinidhi [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-03-16 10:53 krishna.vamsi
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=1142576064.3744.19.camel@avirat \
--to=srinidhi-c@deeproot.co.in \
--cc=linux-c-programming@vger.kernel.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 NNTP newsgroup(s).