How to use core file?


 
Thread Tools Search this Thread
Top Forums Programming How to use core file?
# 1  
Old 03-28-2008
Data 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.

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

Quote:
gdb
and then

Quote:
core core
here's the outcome

Quote:
This GDB was configured as "mips-sgi-irix6.5".

(gdb) core core
Core was generated by `wmkdep'.
Program terminated with signal 11, Segmentation fault.
warning: wrong size gregset struct in core file
warning: wrong size gregset struct in core file
#0 0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
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
# 2  
Old 03-28-2008
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.



Quote:
Originally Posted by lakeat
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
# 3  
Old 03-28-2008
Thank you, Vinod,

Okay, here's what I got now.

Quote:
onyx-bridge 12% ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 524288
memory(kbytes) 29096416
coredump(blocks) unlimited
nofiles(descriptors) 2500
vmemory(kbytes) unlimited
concurrency(threads) 1024
onyx-bridge 13% blockMesh
Segmentation fault (core dumped)
onyx-bridge 14% gdb
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix6.5".
(gdb) core core
Core was generated by `blockMesh'.
Program terminated with signal 11, Segmentation fault.
warning: wrong size gregset struct in core file
warning: wrong size gregset struct in core file
#0 0x00000000 in ?? ()
(gdb) q
onyx-bridge 15% ls
blockMesh core extrudeMesh
onyx-bridge 16% rm core
onyx-bridge 17% gdb -e blockMesh -c core
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix6.5".
/disk4/usr/people/student3/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/mesh/generation/core: No such file or directory.
(gdb) q
onyx-bridge 18% blockMesh
Illegal instruction (core dumped)
onyx-bridge 19% ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 524288
memory(kbytes) 29096416
coredump(blocks) unlimited
nofiles(descriptors) 2500
vmemory(kbytes) unlimited
concurrency(threads) 1024
onyx-bridge 20% gdb -e blockMesh -c core
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix6.5".

warning: shared library handler failed to enable breakpoint
Core was generated by `blockMesh'.
Program terminated with signal 4, Illegal instruction.
You can't do that without a process to debug.
(gdb) bt
You can't do that without a process to debug.
(gdb) core core
warning: shared library handler failed to enable breakpoint
Core was generated by `blockMesh'.
Program terminated with signal 4, Illegal instruction.
You can't do that without a process to debug.
(gdb) q
onyx-bridge 21% gdb blockMesh core
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix6.5"...
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libmeshTools.so...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libmeshTools.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libtriSurface.so...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libtriSurface.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/liblagrangian.so...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/liblagrangian.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libfiniteVolume.so...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libfiniteVolume.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libPstream.so...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libPstream.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libdynamicMesh.so...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libdynamicMesh.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libOpenFOAM.so...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libOpenFOAM.so
Reading symbols from /usr/lib32/libfpe.so...done.
Loaded symbols for /usr/lib32/libfpe.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libstdc++.so.6...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libstdc++.so.6
Reading symbols from /usr/lib32/libm.so...done.
Loaded symbols for /usr/lib32/libm.so
Reading symbols from /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libgcc_s.so.1...done.
Loaded symbols for /disk4/usr/people/student3/OpenFOAM/sgiN32/gcc-4.2.1/lib32/libgcc_s.so.1
Reading symbols from /usr/lib32/libc.so.1...done.
Loaded symbols for /usr/lib32/libc.so.1
Reading symbols from /usr/lib32/libz.so...done.
Loaded symbols for /usr/lib32/libz.so
You can't do that without a process to debug.
(gdb) bt
You can't do that without a process to debug.

Regards,
Daniel
# 4  
Old 03-28-2008
Quote:
Originally Posted by lakeat
Thank you, Vinod,

Okay, here's what I got now.




Regards,
Daniel
What makes me frustrated, I couldn't see anything useful.
SmilieSmilie

Daniel
# 5  
Old 03-28-2008
Look in your code in
Code:
warning: shared library handler failed to enable breakpoint
Core was generated by `blockMesh'.
Program terminated with signal 4, Illegal instruction.

# 6  
Old 03-29-2008
Quote:
Originally Posted by V3l0
Look in your code in
Code:
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
# 7  
Old 03-30-2008
> 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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Core File Generation

Hi I am using Linux and I am using Java as well as C++ services running on it. The ulimit -c is set to around 400Mb. Whenever any of the service fails they produce a core file.(Actual size of core could be greater than 400Mb). Whenever my Java service fails I get a core file of size 400Mb... (3 Replies)
Discussion started by: Raj999
3 Replies

2. UNIX for Advanced & Expert Users

Help in Core File

Hi I am using Linux and I have Java as well as C++ services running on it. The ulimit -c is set to around 400Mb. Whenever any of the service fails they produce a core file.(Actual size of core could be greater than 400Mb). Whenever my Java service fails I get a core file of size 400Mb... (1 Reply)
Discussion started by: Raj999
1 Replies

3. HP-UX

Core file location

Hi, Regarding core dump on HP-UX. more /etc/rc.config.d/savecrash #!/sbin/sh # @(#) $Revision: 80.1 $ # Savecrash configuration # # # SAVECRASH: Set to 0 to disable saving system crash dumps. SAVECRASH=1 # SAVECRASH_DIR:Directory name for system crash dumps. Note: the... (2 Replies)
Discussion started by: mohtashims
2 Replies

4. Homework & Coursework Questions

how to delete core file (file created due to apps crashed)

1. The problem statement, all variables and given/known data: When looking for corefiles, include any file with core in its name. (Some UNIX/Linux systems add the PID of the process that created the core to reduce the chances of overwriting an already existing core file that might be needed. The... (6 Replies)
Discussion started by: s3270226
6 Replies

5. HP-UX

disassembling core file

hi, using core file ( stripped version of binary) i'm able to get backtrace. but i'm unable to figure out the root cause by looking at the code. core file has been generated by SEGV. i'm able to disassemble the functions but i do not know how to interpret it. pls suggest. thanks, (2 Replies)
Discussion started by: satish@123
2 Replies

6. UNIX for Dummies Questions & Answers

difference between Dual-core & Core-to-duo

Can anybody tell What is the exact difference between a Dual-core processor and a Core-to-duo processor ?Advance thanks to all my friends. (1 Reply)
Discussion started by: Ajith kumar.G
1 Replies

7. Programming

How to use a core dump file

Hi All, May be it is a stupid question, but, I would like to know what is the advantage using a core dump file at the moment of debugging using gdb. I know a core dump has information about the state of the application when it crashed, but, what is the difference between debugging using the... (2 Replies)
Discussion started by: lagigliaivan
2 Replies

8. Solaris

core file

hello all, I have same core like below: lsav@GINTINGsmsc1/var/opt/GINTING/cores/SLF $ pstack core core 'core' of 26799: /opt/GINTING/bin/SLF -poolSize 520000 pstack: warning: librtld_db failed to initialize; symbols from shared libraries will not be available ----------------- lwp# 1 ... (1 Reply)
Discussion started by: fredginting
1 Replies

9. Solaris

core file

Hi friends, Can core file be deleted if there is no need for any one to use it for debugging ? What should be the setting for a person who has root access to the solaris system ? thanks in advance Veera (2 Replies)
Discussion started by: sveera
2 Replies

10. UNIX for Dummies Questions & Answers

core file analysis

Hi folks, I'm hoping someone would be charitable enough to give me a quick explanation of adb usage for analyzing core files...or point me in the right direction. A search here revealed scant results and web searches are providing me with ambiguous information. Running Solaris. Thanks,... (1 Reply)
Discussion started by: kristy
1 Replies
Login or Register to Ask a Question