linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* amd64 :: SIGABRT in malloc()
@ 2006-03-16 10:28 B S Srinidhi
  2006-03-16 10:38 ` Mihai Dontu
  2006-03-16 10:55 ` Glynn Clements
  0 siblings, 2 replies; 6+ messages in thread
From: B S Srinidhi @ 2006-03-16 10:28 UTC (permalink / raw)
  To: linux-c-programming

Hi,

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? How can I debug this
problem? And why is malloc() calling free()? 

Any help or pointers would be of great help.

Srinidhi.
-- 
ASCII ribbon campaign ( )         B S Srinidhi
 - against HTML email  X          http://srinidhi.deeproot.co.in
             & vCards / \         DeepRoot Linux


^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: amd64 :: SIGABRT in malloc()
@ 2006-03-16 10:53 krishna.vamsi
  0 siblings, 0 replies; 6+ messages in thread
From: krishna.vamsi @ 2006-03-16 10:53 UTC (permalink / raw)
  To: srinidhi-c, linux-c-programming

Is it failing while allocating or while trying to use the allocated
memory ??

Because if it fails it is supposed to return NULL,  

The kind of error usually signifies the heap corruption(from the man of
malloc), can u tell us wht is the value of MALLOC_CHECK_ environment
variable value, please set it to 1 and run the program again.. 

-Vamsi

-----Original Message-----
From: linux-c-programming-owner@vger.kernel.org
[mailto:linux-c-programming-owner@vger.kernel.org] On Behalf Of B S
Srinidhi
Sent: Thursday, March 16, 2006 3:59 PM
To: linux-c-programming@vger.kernel.org
Subject: amd64 :: SIGABRT in malloc()


Hi,

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? How can I debug this
problem? And why is malloc() calling free()? 

Any help or pointers would be of great help.

Srinidhi.
-- 
ASCII ribbon campaign ( )         B S Srinidhi
 - against HTML email  X          http://srinidhi.deeproot.co.in
             & vCards / \         DeepRoot Linux

-
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in the body of a message to
majordomo@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-03-17  6:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2006-03-16 10:53 krishna.vamsi

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).