From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oln040092009010.outbound.protection.outlook.com ([40.92.9.10] helo=NAM04-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iayZ0-0007Ot-Ir for linux-um@lists.infradead.org; Sat, 30 Nov 2019 08:57:16 +0000 From: James McMechan Subject: Re: I get 5.4 fail to start Date: Sat, 30 Nov 2019 08:57:10 +0000 Message-ID: References: <973c61bb-d1c4-a3ef-fec4-d492fa513d15@cambridgegreys.com>, In-Reply-To: Content-Language: en-US MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Anton Ivanov , linux-um Hello, I believe that 1) already seems correct Unless the C compiler has decided on another longtime usage as being undefi= ned and optimizing the short circuit evaluation away if "WIFEXITED(status)" is false the body of the if statement should be exec= uted immediately without testing "WEXITSTATUS(status) !=3D exitcode" at all. if "WIFEXITED(status)" is true only then will the "WEXITSTATUS(status) !=3D= exitcode" test be executed and the body of the if statement executed if tr= ue I am unclear what your changed version would do differently, the short circ= uit rules prevented having to repeat the body of the if statement or use a = goto or messy evaluation. rewriting it using the && short circuit test should look something like this if (WIFEXITED(status) && (WEXITSTATUS(status) !=3D exitcode)) || !WIFEXITED= (status)) ) At least I think so, Jim McMechan From: linux-um on behalf of Anton Iv= anov Sent: Friday, November 29, 2019 12:47 AM To: linux-um Subject: Re: I get 5.4 fail to start =A0 On 28/11/2019 17:27, Anton Ivanov wrote: > Hi all, > = > I get 5.4 fail to start. 5.4 gives: > = > Checking that ptrace can change system call numbers...check_ptrace : = > child exited with exitcode 6, while expecting 0; status 0x67f > Aborted > = > And stops right at the very start. > = > I do not recall anything there changing in the 5.2 - 5.4 timeframe so = > this is weird. > = > Ideas? > = Two problems: 1. The code in stop_ptraced_child is wrong if (!WIFEXITED(status) || (WEXITSTATUS(status) !=3D exitcode)) This is incorrect - you can use the WEXITSTATUS(status) macro only if = WIFEXITED(status) has returned true. 2. The second problem is that for whatever reason after going to 5.4 = that stopped returning true. No idea what's happening there. After I fix (1), I get everything to work as intended. I am going to play a bit with a patch which addresses (1) and submit it = if I am happy with it. If anyone has any ideas about (2) - please shout. -- = Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/ _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um