From owner-freebsd-hackers@freebsd.org Wed Apr 18 17:19:44 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBF80F9BD16 for ; Wed, 18 Apr 2018 17:19:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7970785D24 for ; Wed, 18 Apr 2018 17:19:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1D69410AFD3; Wed, 18 Apr 2018 13:19:43 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Cc: Chuck Tuffli Subject: Re: examining Linux core file? Date: Wed, 18 Apr 2018 09:24:11 -0700 Message-ID: <2717167.3JnP6E4tFK@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 18 Apr 2018 13:19:43 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 17:19:45 -0000 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