Core dump files for native applications

Core dump files for native applications

How do you attach the idbc_mic debugger to a core file that was produced by a Phi native application crashing?

TIA.

 

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

I do not know whether that’s possible with idbc_mic yet. What I have tried has not worked so far and I’m awaiting advice from the debugger team.
 
I was able to do so using gdb fairly easily (w/MPSS 2.1.6720-13) following some advice from this Debugger overview under Native Debugging on the Intel® Xeon Phi™ Coprocessor with GDB*.
 
My system lacks local user accounts on the card so I have to operate under a sudo su shell. Here's what I had to do:
 
1. Transfer the gdb/gdbserver from the host on the card
 
root# scp /usr/linux-k1om-4.7/linux-k1om/usr/bin/gdbserver root@mic0:/usr/bin
gdbserver                                     100%  272KB 271.8KB/s   00:00
 
root# scp /usr/linux-k1om-4.7/linux-k1om/usr/bin/gdb root@mic0:/usr/bin
gdb                                           100% 5019KB   4.9MB/s   00:00
 
2.  Run the test case to create the core file
 
I have a small test case (a.out) with a self-inflicted failure to dump core that was previously transferred into /tmp on the card.
 
You probably already know the core file limit is set to zero by default on the card, so after ssh’ing to the card, increase the limit and run the executable to create the core file:
 
root# ssh mic0
[root@mic0 /tmp]# cd /tmp
[root@mic0 /tmp]# ulimit -c unlimited
[root@mic0 /tmp]# ./a.out
ind
2 4 6 8 10 12 14 8
A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
C
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Segmentation fault (core dumped)
 
3. Start the debugger on the card via ssh and load the executable/core file
 
root#  ssh -t mic0 /usr/bin/gdb
GNU gdb (GDB) 7.5-1.3.187
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-k1om-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
 
 
(gdb) cd /tmp
Working directory /tmp.
 
(gdb) !ls
a.out      coi_procs  core
 
(gdb) file a.out
Reading symbols from /tmp/a.out...done.
 
(gdb) core-file core
[New LWP 192341]
warning: Can't read pathname for load map: Input/output error.
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000400657 in f (A=0x7fff89a01f40, index=0x7fff89a01ec4) at s.c:23
23      s.c: No such file or directory.
 
(gdb) bt
#0  0x0000000000400657 in f (A=0x7fff89a01f40, index=0x7fff89a01ec4) at s.c:23
#1  0x00000000004008f1 in main (argc=1, argv=0x7fff89a02468) at s.c:57
 
(gdb) quit

 

I do not have a method for using idbc_mic but the Debugger team advised on another alternative that is even easier.

You can use GDB on the host as follows:  gdb-mic –c <path to core file>

Where the corefile can be copied to the host or the card filesystem mounted somehow to the host.

For the case I provided earlier, this was as easy as pulling the core file back to the host into the same location as a.out and running: gdb-mic -c core

$ gdb-mic -c core
No symbol table is loaded.  Use the "file" command.
GNU gdb (GDB) 7.5-1.0.160
Copyright (C) 2012 Free Software Foundation, Inc; (C) 2013 Intel Corp.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For information about how to find Technical Support, Product Updates,          
 
User Forums, FAQs, tips and tricks, and other support information, please visit:
<http://www.intel.com/software/products/support/>.
[New LWP 212673]
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000400657 in ?? ()
 
(gdb) file a.out
Reading symbols from /tmp/a.out...done.
 
(gdb) bt
#0  0x0000000000400657 in f (A=0x7fff3ad48b40, index=0x7fff3ad48ac4) at s.c:23
#1  0x00000000004008f1 in main (argc=1, argv=0x7fff3ad49068) at s.c:57
 
(gdb) quit
 

Leave a Comment

Please sign in to add a comment. Not a member? Join today