examining Linux core file?
John Baldwin
jhb at freebsd.org
Wed Apr 18 17:19:45 UTC 2018
On Sunday, January 14, 2018 07:57:01 AM Chuck Tuffli wrote:
> 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.
Try gdb from ports.
--
John Baldwin
More information about the freebsd-hackers
mailing list