This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Workaround a FreeBSD ptrace() bug with clearing thread events.
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: John Baldwin <jhb at freebsd dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 2 Mar 2018 19:31:49 +0000
- Subject: Re: [PATCH] Workaround a FreeBSD ptrace() bug with clearing thread events.
- Authentication-results: sourceware.org; auth=none
- References: <20180224000935.43344-1-jhb@FreeBSD.org> <alpine.DEB.2.00.1803020009130.10166@tp.orcam.me.uk> <1908872.BAzsX71dkG@ralph.baldwin.cx>
On Fri, 2 Mar 2018, John Baldwin wrote:
> > Hmm, doesn't it have to be a run-time check then? Otherwise you're
> > basing your decision on the host system GDB has been built for and not one
> > it will be run on, which I suppose does not necessarily have to be of the
> > same version. Or am I missing anything here?
>
> FreeBSD generally does not support forwards-compatability for binaries (newer
> binary on older kernel), only backwards-compatability (older binary on newer
> kernel). In this case, using the workaround is also fine on a fixed kernel,
> so it doesn't hurt if GDB is compiled on an older system (thus using the
> workaround) and then run under a newer kernel.
Fair enough.
Is the one-way compatibility enforced though, by a system library runtime
or the kernel somehow, by refusing to run a binary built for a kernel that
is newer than one currently in charge of the system? Otherwise the rule
would be quite fragile and error prone, asking for extra care to be taken
by the user.
Maciej