Package: gdbserver
Version: 10.1-2
Severity: important
Tags: patch fixed-upstream
Forwarded: 
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=037e8112b9794a633248e5aa5943f3be273e0a20

When testing an i386 (-m32) program on an x86_64 host using gdbserver,
the program under test crashes with a segmentation fault.

Steps to reproduce:

$ cat > test.c
int main (void) { return 0; }
$ gcc -m32 -otest32 test.c
$ gdbserver localhost:12345 ./test32

and in another terminal

$ gdb -batch -q -ex "target remote localhost:12345" -ex continue

Expected result: test32 runs to completion

Actual result:

Program received signal SIGSEGV, Segmentation fault.
0xf7ddf3f7 in __ctype_init () from target:/lib/i386-linux-gnu/libc.so.6

This seems to be a known bug, fixed in
<https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=037e8112b9794a633248e5aa5943f3be273e0a20>,
as applied in e.g. Arch Linux's version of gdb 10.2. I'm waiting for a
backport of that change to compile locally so I can try it.

Thanks,
    smcv

-- System Information:
Debian Release: 11.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-security'), (500, 
'stable-updates'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 
'testing'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-7-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gdbserver depends on:
ii  libc6       2.31-12
ii  libgcc-s1   10.2.1-6
ii  libstdc++6  10.2.1-6

gdbserver recommends no packages.

gdbserver suggests no packages.

-- no debconf information

Reply via email to