abort (core dumped)

Posted on 2004-08-31
Last Modified: 2010-04-17

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!

Question by:lost_bits1110
  • 3
  • 3
  • 2
LVL 22

Expert Comment

ID: 11947866
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.

Author Comment

ID: 11948122
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..?
LVL 22

Expert Comment

ID: 11948292
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.
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

LVL 23

Expert Comment

ID: 11948829
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.


Author Comment

ID: 11963669

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/

Does this mean anything to anyone..?
LVL 22

Accepted Solution

cookre earned 100 total points
ID: 11964020
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?
LVL 23

Expert Comment

ID: 11964397
Consider using a debugging malloc library to help you identify your memory leak:

Author Comment

ID: 12018910
ok it turns out that i was continuously allocating something by mistake
thanks for all ur help!

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 104
Specific format 21 198
How to obtain Administrator permission when you are the Administrator 6 78
draw a Christmas tree by using a nested loop? 26 63
This is an explanation of a simple data model to help parse a JSON feed
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.

832 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