Re: [PATCH 02/12] gdb: clear inferior displaced stepping state on exec

Simon Marchi
2020-12-01T04:27:16Z

On 2020-11-24 8:28 p.m., Pedro Alves wrote:
>> I tried to write a test where a non-main thread displaced-steps an exec
>> syscall, where things would hang due to the displaced step buffer not
>> getting released. However, due to PR 26754 [1], it is hard to make it
>> stable. So I'm not including a test for this patch. If you have an
>> idea for another way to test this without triggering this bug, I'd like
>> to hear it.
>>
>> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=26754
> I can't think of another way to test this.
>

We can simply put a breakpoint with an always false condition on the
syscall instruction and run from start. The exec will be displaced
stepped while the main thread will run. I can reliably reproduce the
hang this way.

Simon