LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-25-2006, 09:40 AM   #1
topworld
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Rep: Reputation: 15
Error::*** glibc detected *** realloc():


Hi all,
i have implemented one c prog, in which i have taken 2 char pointers, and assigned them memory through malloc.Then after through some code , tht memory gets filled..

Now prob is..
at the end if i m trying to apply realloc() or free() on tht pointer, for assigned memory, its giving me following error:

for realloc()
*** glibc detected *** realloc(): invalid next size: 0x09b25a48 ***
Aborted

if i use free() , i get similar error

So wht does this error indicate ? and
how to solve it?

Reply frm u will be more than welcome..

Thank you
 
Old 04-25-2006, 12:57 PM   #2
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Sounds like a fence-post error, i.e. you write past the end of the allocated memory. Probably you either miscalculated the sizes for malloc/realloc, or a condition for a loop (in which you write to the memory) is wrong.

Last edited by addy86; 04-25-2006 at 12:58 PM.
 
Old 04-26-2006, 02:54 AM   #3
topworld
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by addy86
Sounds like a fence-post error, i.e. you write past the end of the allocated memory. Probably you either miscalculated the sizes for malloc/realloc, or a condition for a loop (in which you write to the memory) is wrong.
Thank you
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
*** glibc detected *** malloc() / free()/ double RohanShrivastav Programming 12 10-01-2012 11:08 AM
glibc detected? TurtleFace Programming 2 11-19-2005 01:35 PM
glibc detected ; memory corruption pingu Linux - Software 3 10-12-2005 02:29 AM
Open Office user install error: *** glibc detected *** double free or corruption: 0xb r_jensen11 Linux - General 6 01-16-2005 07:08 AM
Wine error: "glibc detected ... invlaid pointer" resaguk Slackware 2 11-08-2004 10:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration