Re: [PATCH] x86/ptrace: Remove questionable TS_COMPAT usage in ptrace

From: Pedro Alves
Date: Mon Jun 20 2016 - 06:29:19 EST


On 06/19/2016 11:09 PM, Andy Lutomirski wrote:
>
> The latter bit is a mess and is probably broken on current kernels for
> 64-bit gdb attached to a 32-bit process. (Is it? All of this stuff
> is a bit of a pain to test.)

The testcase at:

https://sourceware.org/ml/gdb/2014-05/msg00004.html

still fails for me on Fedora 23 with git master gdb.

Nevermind the misleading URL, that's a kernel patch.

$ gcc -g -m32 interrupt.c -o interrupt.32
...
(gdb) r
Starting program: /home/pedro/tmp/interrupt.32
talk to me baby
^C
Program received signal SIGINT, Interrupt.
0xf7fd9d49 in __kernel_vsyscall ()
(gdb) p func1()
$1 = 4
(gdb) c
Continuing.
Unknown error 512
[Inferior 1 (process 20252) exited with code 01]
(gdb)

That was a 64-bit gdb.

Note it doesn't fail with fedora 23's gdb, because of a
fedora-local workaround.

Thanks,
Pedro Alves