LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-17-2005, 11:51 AM   #1
easykillsoft
LQ Newbie
 
Registered: Jun 2005
Distribution: Open SuSE 10
Posts: 23

Rep: Reputation: 15
calloc failures


Hi, I've been having an odd experience lately with a program I code for a Linux architecture. When allocating memory via the calloc function it for some reason seems to randomly fail when calloc calls mallopt. Most often when I view the core dump it shows in the backtrack the call to the calloc function in lib.libc.so.6 then two or three calls to the mallopt function in lib.libc.so.6 and occassionally it'll then show abort() raise() kill() calls and I'm not sure why. It happens randomly and I was wondering if anyone could shed some light on the situtation. Also the Glibc is version 2.3.4 not sure if that helps or not...
 
Old 11-18-2005, 10:14 PM   #2
winsnomore
Member
 
Registered: May 2004
Location: USA
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315

Rep: Reputation: 31
check your code .. it's not system that's random .. something in your code is causing it.
good practice to print errno after system calls.
 
Old 11-19-2005, 06:02 PM   #3
easykillsoft
LQ Newbie
 
Registered: Jun 2005
Distribution: Open SuSE 10
Posts: 23

Original Poster
Rep: Reputation: 15
fixed it

It truly was random, I modified the code so that instead of using calloc it uses malloc and modified the macro so it was stuck in a for loop until it got a valid chunk of memory and the program hasn't locked up from it and it hasn't crashed since. Either way the whole thing is odd since that code hadn't changed for 6 years before it started doing it.
 
  


Reply



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
calloc returns weird address? mvorlov Programming 2 11-09-2005 07:55 AM
malloc .vs. calloc thelonius Programming 5 10-28-2005 04:50 PM
C-Program: calloc() and free() using in while xxfunkxx Programming 10 12-06-2004 09:04 PM
what is the point of calloc? Berhanie Programming 8 07-17-2004 01:21 PM
Detecting failures ph33r Linux - Networking 1 05-15-2002 02:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:48 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