All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glynn Clements <glynn@gclements.plus.com>
To: B S Srinidhi <srinidhi-c@deeproot.co.in>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: amd64 :: SIGABRT in malloc()
Date: Thu, 16 Mar 2006 10:55:57 +0000	[thread overview]
Message-ID: <17433.17469.719361.117297@cerise.gclements.plus.com> (raw)
In-Reply-To: <1142504931.4517.26.camel@avirat>


B S Srinidhi wrote:

> I'm new to this list, but I've searched the archives (a little bit) to
> find a solution to my problem and haven't found anything.
> 
> I've an application running on an amd64 machine. This app crashes while
> allocating memory of size 300:
> 
>         suffix = malloc(sizeof(char) * 300);
> 
> When run under GDB, I get the following bt:
> 
> *** glibc detected *** malloc(): memory corruption: 0x00000000005343f0 ***
> 
> Program received signal SIGABRT, Aborted.
> 0x0000002a96214de0 in raise () from /lib/libc.so.6
> (gdb) where
> #0  0x0000002a96214de0 in raise () from /lib/libc.so.6
> #1  0x0000002a96216290 in abort () from /lib/libc.so.6
> #2  0x0000002a9624b06e in __fsetlocking () from /lib/libc.so.6
> #3  0x0000002a962518fa in free () from /lib/libc.so.6
> #4  0x0000002a96252d4b in malloc () from /lib/libc.so.6
> <snipped>
> 
> Any ideas as to why this could be happening? 

The heap has been corrupted, e.g. due to a buffer overrun.

> 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
Info file regarding the use of mprobe(). Another possibility is
Electric Fence (libefence).

> And why is malloc() calling free()? 

I don't know about that. It may just indicate incomplete debugging
information in libc.

-- 
Glynn Clements <glynn@gclements.plus.com>

  parent reply	other threads:[~2006-03-16 10:55 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 [this message]
2006-03-17  6:14   ` B S Srinidhi
  -- 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=17433.17469.719361.117297@cerise.gclements.plus.com \
    --to=glynn@gclements.plus.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=srinidhi-c@deeproot.co.in \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.