This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4] Implement 'catch syscall' for gdbserver


On 03/29/2016 11:12 AM, Josh Stone wrote:
> On 03/29/2016 07:26 AM, Yao Qi wrote:
>> Hi Josh,
>> This commit causes some fails on s39x, and ppc, as shown in buildbot.  I
>> saw them in aarch64 test as well.  Could you take a look?
>>
>> https://sourceware.org/ml/gdb-testers/2016-q1/msg01544.html
>> https://sourceware.org/ml/gdb-testers/2016-q1/msg01601.html
> 
> Hmm.  That new test is meant to make sure that the syscall entry/return
> state is not lost across an execve.  In the failure I knew, the execve
> return was interpreted as an additional syscall entry.  But in the cases
> you've shown, it didn't catch syscall return from execve at all!
> 
> I will investigate more...

So, it seems those architectures don't preserve their original syscall
numbers across an execve.

$ gdb -ex 'catch syscall execve' -ex 'run' -ex 'catch syscall' \
  -ex 'continue' --args sh -c /bin/true

PPC64 and Aarch64 both read their syscall numbers from registers, and
here they both get 0 ("restart_syscall" and "io_setup" respectively).
S390X tries to decode it from the SVC instruction at PC-2, which will
definitely fail after an execve -- gdb reports syscall -1.

So when the catchpoint is only for execve, they continue past this one
since the number doesn't look like execve.

The good news is that all three do call it a syscall *return*, which was
the main point of this particular test.  If there's no objection, I can
try to update the test to work more like my command above, matching any
syscall at all on the return side of execve.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]