From owner-freebsd-questions@FreeBSD.ORG Mon Jan 5 16:06:07 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEFE7861 for ; Mon, 5 Jan 2015 16:06:07 +0000 (UTC) Received: from mail.hemio.de (mail.hemio.de [176.9.40.240]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91D7D2743 for ; Mon, 5 Jan 2015 16:06:07 +0000 (UTC) Received: from bulldozer.local (p4FC24BC4.dip0.t-ipconnect.de [79.194.75.196]) by mail.hemio.de (Postfix) with ESMTPSA id AD1E01BC for ; Mon, 5 Jan 2015 17:00:20 +0100 (CET) Date: Mon, 5 Jan 2015 17:00:18 +0100 From: Roman Naumann To: freebsd-questions@freebsd.org Subject: GDB SIGSEGV with 32 binaries on 10.1-amd64 Message-ID: <20150105160018.GA30902@bulldozer.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2015 16:06:07 -0000 Hi, I noticed the GNU Debugger (GDB) seems to be unable to debug 32 bit binaries on the FreeBSD amd64 platform. A simple example gives a SIGSEGV when running the binaries in GDB, as shown below. GDB 7.8 shows a warning. GDB 6.1 just reports the signal. There exists a /libexec/ld-elf32.so.1, but I cannot figure out how to make gdb use it. Maybe it will not fix the issue even if gdb uses this library. Ideas and hints much appreciated. Best regards, Roman -- checked so far: -> /usr/lib32 exists -> recompile gdb7 from ports instead of using pkg -- system: FreeBSD bulldozer.local 10.1-RELEASE FreeBSD 10.1-RELEASE #3 r275043M: Tue Nov 25 16:52:35 CET 2014 namor@bulldozer.local:/usr/obj/usr/src/sys/GENERIC amd64 -- how to reproduce: [namor@bulldozer ~]$ cat test2.c int main() { return 0; } [namor@bulldozer ~]$ gcc -m32 -o test2 test2.c [namor@bulldozer ~]$ gdb test2 [namor@bulldozer ~]$ gdb78 test2 GNU gdb (GDB) 7.8 [GDB v7.8 for FreeBSD] (...) (gdb) run Starting program: /grave/home/namor/test2 warning: `/libexec/ld-elf.so.1': Shared library architecture i386:x86-64 is not compatible with target architecture i386. warning: `/libexec/ld-elf.so.1': Shared library architecture i386:x86-64 is not compatible with target architecture i386. Program received signal SIGSEGV, Segmentation fault. 0x000004e3 in ?? ()