Solved

abort (core dumped)

Posted on 2004-08-31
8
488 Views
Last Modified: 2010-04-17
Hello,

So I have a c++ program that I'm running on Redhat 8  
I would run it for about 15 to 20 minutes, and suddenly I would get this weird pthread error and crash
Then I tried running it on Redhat 9, and the pthread error disappeared but it would still crash after the same amount of time
I also added -pthread when I compiled (i.e. g++ -o -w -pthread ) and so I don't get the pthread error anymore when running on Redhat 8 but it still crashes after the same amount of time

I have absolutely no idea what this could be
Is it a pthread issue afterall?
Or something to do with my code?
I'm also using vtk and fltk with it

Is there any way of getting any clues?  Is there something along with the core file that it dumps that I can get clues with as to why it crashed???
Thank you very much!

lostbits...
0
Comment
Question by:lost_bits1110
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:cookre
Comment Utility
Not knowing what it's doing makes it kind of difficult to comment.

Perhaps if you were to put in a log file to track execution you could close in on where it's failing, then back-track to the ultimate cause.
0
 

Author Comment

by:lost_bits1110
Comment Utility
Hi, thanks for ur input,
but what kind of logfile would I put (..and how..??)

It doesnt really matter what I do or even if the program is doing nothing for 20 minutes.. it just ALWAYS crashes after just aobut 20 minutes

and i really have no clue
it must be one of the libraries or some compatibility issue or maybe even the pthread thing

I just dont know
and I wish I'd get an error message at least to help

So what kind of log file/ (log software?) would u expect I use for this kind of probelm..?
0
 
LVL 22

Expert Comment

by:cookre
Comment Utility
You create your own logfile.

Make a subroutine called, say, LogIt(char * msg)

Whenever it's called, open a text file for append, write the current date/time and msg to that file, then close it
(The open/write/close prevents the loss of any buffered data at crash time.

Call LogIt at various places throughout the program.  When the program creashes, look at the log file to see where and what the program had been doing.
0
 
LVL 23

Expert Comment

by:brettmjohnson
Comment Utility
Why don't you debug it?  Compile with -g switch, run it under gdb, and it will break
into the debugger at the point of failure.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:lost_bits1110
Comment Utility
Hello,

Okay so I ran my program using gdb and had top -d1 opened at the same time as well

It appears that the 'SIZE' , 'RSS', and "%MEMORY" values just keep increasing as the program continues to run, which means I havne't deallocated something..? Or maybe it keeps creating new threads or something as its running, I'm not sure what exactly
For example

  PID    USER     PRI  NI  SIZE    RSS      SHARE      STAT   %CPU        %MEM   TIME    
 25055    me         18     0    369M   302M      11108      R            99.9            19.9         1:53        
then some time later...
---
 25055    me         17     0    736M   652M      11036      R            99.9             43.1        6:38
---
some more time later...
 25055    me         20     0   1320M   908M      10720      R            99.9             60.1       14:10

Then eventually it crashes and I get:
Program received signal SIGABRT, Aborted.
[Switching to Thread 16384 (LWP 25055)]
0x42028851 in kill () from /lib/i686/libc.so.6

Does this mean anything to anyone..?
Thanks!
0
 
LVL 22

Accepted Solution

by:
cookre earned 100 total points
Comment Utility
I assume from your consternation that your code doesn't do any explicit memory allocations orforks.

Could you be opening lots of files without closing them?
Dynamic array expansions?
Re-creating an object without disposing of previous, uneeded instances?
0
 
LVL 23

Expert Comment

by:brettmjohnson
Comment Utility
Consider using a debugging malloc library to help you identify your memory leak:

http://dmalloc.com
0
 

Author Comment

by:lost_bits1110
Comment Utility
ok it turns out that i was continuously allocating something by mistake
thanks for all ur help!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now