From: John Baldwin <jhb@FreeBSD.org>
To: Carl Love <cel@us.ibm.com>, Simon Marchi <simark@simark.ca>,
gdb-patches@sourceware.org
Cc: Rogerio Alves <rogealve@br.ibm.com>
Subject: Re: [PATCH] gdb fix for catch-syscall.exp
Date: Mon, 22 Nov 2021 09:01:44 -0800 [thread overview]
Message-ID: <95fbffc3-8d30-6e75-4f52-f6e534a13b20@FreeBSD.org> (raw)
In-Reply-To: <4d51616392553dd308672f65f18909ebf0513fc0.camel@us.ibm.com>
On 11/19/21 4:27 PM, Carl Love via Gdb-patches wrote:
> Simon:
>
> On Thu, 2021-11-18 at 13:10 -0500, Simon Marchi wrote:
>>
>> Hi Carl,
>>
>> This patch causes this failure regression on Ubuntu 20.04, amd64:
>>
>> FAIL: gdb.base/catch-syscall.exp: execve: continue to main
>>
>> From gdb.log:
>>
>> 615 continue^M
>> 616 Continuing.^M
>> 617 process 2022222 is executing new program:
>> /home/smarchi/build/binutils-
>> gdb/gdb/testsuite/outputs/gdb.base/catch-syscall/catch-syscall^M
>> 618 ^M
>> 619 Catchpoint 18 (returned from syscall execve), 0x00007ffff7fd0100
>> in _start () from /lib64/ld-linux-x86-64.so.2^M
>> 620 (gdb) FAIL: gdb.base/catch-syscall.exp: execve: continue to main
>>
>
> Interesting. I understood that the execve call would not return to the
> caller except in the case of an error. Not sure why it behaves
> differently on amd64 versus Power and Intel? Let me take a look and
> see if I can create a fix with a test multiple to cover both cases.
>
> Thanks for letting me know.
Note that the thread/process that calls execve() does still "return"
from the kernel, it just returns to the entry point of the executable
with the contents of the user address space wiped. I'm not quite sure
how Linux treats this, but on FreeBSD at least this "return" is treated
as a successful return from the execve system call. In fact, I think
Linux on at least amd64 reports two events: one for an "execve" event and
one for the system call return event judging by a commit made in FreeBSD
to emulate ptrace() for Linux binaries:
https://cgit.freebsd.org/src/commit/?id=6e66030c4c05331f9b0adf87c31f2f233dd3ae1f
--
John Baldwin
next prev parent reply other threads:[~2021-11-22 17:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 23:30 Carl Love via Gdb-patches
2021-11-18 15:23 ` Tom Tromey
2021-11-18 18:10 ` Simon Marchi
2021-11-20 0:27 ` Carl Love via Gdb-patches
2021-11-22 1:07 ` Simon Marchi via Gdb-patches
2021-11-22 18:16 ` Carl Love via Gdb-patches
2021-11-22 17:01 ` John Baldwin [this message]
2021-11-23 20:34 ` Simon Marchi
2021-11-23 22:34 ` John Baldwin
2021-11-24 17:46 ` Carl Love via Gdb-patches
2021-11-24 17:51 ` John Baldwin
2021-11-24 1:15 ` Carl Love via Gdb-patches
2021-11-24 19:29 ` Simon Marchi
2021-11-29 16:46 ` Carl Love via Gdb-patches
2021-12-02 16:32 ` Ping " Carl Love via Gdb-patches
2021-12-10 18:36 ` Simon Marchi
2021-12-10 19:59 ` [PATCH v2] " Carl Love via Gdb-patches
2021-12-11 0:21 ` Simon Marchi via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95fbffc3-8d30-6e75-4f52-f6e534a13b20@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=cel@us.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=rogealve@br.ibm.com \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox