From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130527 invoked by alias); 2 Mar 2018 22:48:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 130504 invoked by uid 89); 2 Mar 2018 22:48:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=charge, among X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Mar 2018 22:48:41 +0000 Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id DF57B10A8BA; Fri, 2 Mar 2018 17:48:39 -0500 (EST) From: John Baldwin To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Workaround a FreeBSD ptrace() bug with clearing thread events. Date: Fri, 02 Mar 2018 22:48:00 -0000 Message-ID: <2023036.DDCG60uWOK@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <20180224000935.43344-1-jhb@FreeBSD.org> <1908872.BAzsX71dkG@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00078.txt.bz2 On Friday, March 02, 2018 07:31:49 PM Maciej W. Rozycki wrote: > 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. It is enforced in some ways but not others. Kernel modules do depend on a version number in such a way that attempting to load a newer kernel module on an older kernel will fail. However, the general policy of only supporting one-way compatibility is well-known among the FreeBSD userbase (for example, the instructions for upgrading a system from source require booting into a new kernel before installing the matching userland binaries). -- John Baldwin