Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jan 2018 07:57:01 -0800
From:      Chuck Tuffli <chuck@tuffli.net>
To:        freebsd-hackers@freebsd.org
Subject:   examining Linux core file?
Message-ID:  <CAM0tzX1GNvO%2BKWTi5=08C=uyeH3BKtWY=01RKXoM79t%2BzwR9Tg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
If a Linux application running under the Linux emulation  (a.k.a.
Linuxulator) core dumps, is it possible to examine the resulting core
file? lldb didn't seem to like it:

# file mremap05.core
mremap05.core: ELF 64-bit LSB core file x86-64, version 1 (FreeBSD),
FreeBSD-style, from 'ases/bin/mremap05'
# lldb -c mremap05.core testcases/bin/mremap05
(lldb) target create "testcases/bin/mremap05" --core "mremap05.core"
error: Unable to find process plug-in for core file
'/compat/linux/opt/ltp/mremap05.core'
(lldb) bt
error: invalid process

FreeBSD's gdb seems to recognize this is as Linux, but doesn't know
where to go from there:
# /usr/libexec/gdb -q ./testcases/bin/mremap05 mremap05.core

warning: A handler for the OS ABI "GNU/Linux" is not built into this
configuration
of GDB.  Attempting to continue with the default i386:x86-64 settings.

Dwarf Error: wrong version in compilation unit header (is 4, should be
2) [in module /compat/linux/opt/ltp/testcases/bin/mremap05]

warning: core file may not match specified executable file.
Core was generated by `./testcases/bin/mremap05'.
Program terminated with signal 11, Segmentation fault.
#0  0x0040eb01 in ?? ()
(gdb) bt
#0  0x0040eb01 in ?? ()
Cannot access memory at address 0xdbea00

The gdb from CentOS, on the other hand, seems to think this is a FreeBSD core:
# gdb -q ./testcases/bin/mremap05 mremap05.core
Reading symbols from /opt/ltp/testcases/bin/mremap05...done.

warning: A handler for the OS ABI "FreeBSD ELF" is not built into this
configuration
of GDB.  Attempting to continue with the default i386:x86-64 settings.

"/opt/ltp/mremap05.core": no core file handler recognizes format

Are there any other approaches to  consider? TIA.

--chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM0tzX1GNvO%2BKWTi5=08C=uyeH3BKtWY=01RKXoM79t%2BzwR9Tg>