How to use core file?

Hi experts,

A good day to you all.

With debug option, I compiled a big program called OpenFOAM (Written mainly in c++) on IRIX.
after it is finished, I got a SEGV when I executed it.

I noticed that the core file is quite a big block (800M)!
However, I can get very little information from it. I did:

and then

here's the outcome

what shall I do now?
what does it mean by saying "wrong size gregset struct in core file", is it fatal?
How can I use core file?

Thank you.

Daniel

Hi Daniel,

Use executable file also while analyzing the core file.

e.g.
gdb -e OpenFOAM -c core

This should give you better insight as i have noticed with my code.

Regards,
Vinod.

Thank you, Vinod,

Okay, here's what I got now.

Regards,
Daniel

What makes me frustrated, I couldn't see anything useful.
:confused::frowning:

Daniel

Look in your code in

warning: shared library handler failed to enable breakpoint
Core was generated by `blockMesh'.
Program terminated with signal 4, Illegal instruction.

In fact, there's no problem at all under any linux system, I can use it very well under OpenSUSE, Fedora, or Ubuntu.
No offence V3l0, I mean the answer is not an easy one to have and blockMesh is above reproach.

On sgi-Irix6.5, after a core dump, I was adviced to perform a "strace", but I got the following information:

ERROR: tracer already exists

what shall I do now?

I am justing wandering, dear experts, what is the best way to locate the problem, to diagnose the diseases?

Daniel

> gdb blockMesh core
and then when gdb did load the libraries and core file:
(gdb) bt

this should give you the backtrace when the programm died.
i'm not sure why it didn't work for you.

Alternatively you can start the program directly in gdb and issue bt after the prog died.

> gdb blockMesh
(gdb) run

Thank you all, and thank you Lazzar, I appreciate it.

what you adviced I have tried before, it is something like this

And I dont know what do these warning and error really mean!

And another question, is there a subforum for sgi-IRIX under this forum?

Daniel

maybe you could try with dbx instead gdb if it is installed.
in dbx you type 'where' instead of 'bt' to get the backtrace.

MySQL Bugs: #25344: Segmentation violation when try to run the perror utility
the above link shows a case where gdb didn't work, but dbx showed a useful backtrace on irix.

Thank you Lazzar, that helps.
With dbx I have found a little bit more information than gdb.
However, I am still very frustrated, for the dbx show me as if something wrong with a *.C file, however, there's no problem at all when I compile it under any linux, that is to say, it shouldn't have to be the problem.

So, I doubt whether dbx have given me the right information!!!

CFD codes is extremely huge! I will keep on looking.

Best Regards,
Daniel