Solved

abort (core dumped)

Posted on 2004-08-31
8
492 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:cookre
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.
0
 

Author Comment

by:lost_bits1110
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..?
0
 
LVL 22

Expert Comment

by:cookre
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:brettmjohnson
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.

0
 

Author Comment

by:lost_bits1110
ID: 11963669
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
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?
0
 
LVL 23

Expert Comment

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

http://dmalloc.com
0
 

Author Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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.

734 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