Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jan 2015 17:00:18 +0100
From:      Roman Naumann <roman.naumann@fu-berlin.de>
To:        freebsd-questions@freebsd.org
Subject:   GDB SIGSEGV with 32 binaries on 10.1-amd64
Message-ID:  <20150105160018.GA30902@bulldozer.local>

next in thread | raw e-mail | index | archive | help
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 ?? ()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150105160018.GA30902>