Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4769444rwd; Sun, 4 Jun 2023 12:24:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68d/vwqNC3TspKvUevj5+4sFYhfXHAxg5ztgbo8uye61io7Vm62rYurq51UReLBjkeWzIr X-Received: by 2002:a17:902:6509:b0:1af:bbfd:1c07 with SMTP id b9-20020a170902650900b001afbbfd1c07mr5548664plk.57.1685906646512; Sun, 04 Jun 2023 12:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685906646; cv=none; d=google.com; s=arc-20160816; b=tmLN0qX70feTxd+ZRarddC3kIUFJSTLUAs20DzLyXCKsEfeGKLl6gu4ZVG4boHr5iB xQlTEfit1YvJURyQNYPWtcjQpu+aTAkmZhwMF4uCBPEnfioSc1uBkbHDBnnMgLhQakB+ r/06q21JWEh6QdiZE6KYoy5Rdh9DT5fwWm2dhxtKskiVxi0uUwpJ1m6QyeJmHzPMGe71 MmBsBMY7ErHECyk31HSF92kJMtAUXZgRMY2u2esaBxnAoqfsKuPZsRKRHUo3H9tQ2a4o GVp6F1R5JSPFQp3r17Coi8CR83YA/uhS6y0PYWQ5N3XkCMZQiAZL90Rbx+OaOIgbmINK qn/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3J20tGaF4S0ARIFKbH8ZfA+C76wGymk2+jmH+AslNVA=; b=OJrguMCC3kwIYdN3ex3O2qAIYquZIBAR8GNIIhqtfJLuQK9Dpf6WF1XZtgBsagoJg+ 9qb6E8gqu+7ltAZ0D4K/filK5HWYmU35DB+pIkI5pVlNv2rKii0afewZk8L6ekrIIJil cHljTlT8rUBGZ2QCt7CG0hN91d8qzXuyZs5Mm+Fw2YHA+RZRgT15y4jc0hhq/1xIzJIN 1LxAriAfFdqzo/kUA365qy52DpUsr/Kchgb09Wid1NF+eOeXjq9dgCCfMrduhhvsJmi7 iSFrYWEkVi3YkwFMsxvXO1qX7bTOWVDlmg20uK5uXU78Bxtf1ckk/baKRXkPQgwzXGj7 uK0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170902b28600b001adc3a1b3fasi4191078plr.282.2023.06.04.12.23.50; Sun, 04 Jun 2023 12:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232158AbjFDTOt (ORCPT + 99 others); Sun, 4 Jun 2023 15:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbjFDTOs (ORCPT ); Sun, 4 Jun 2023 15:14:48 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7BAFA4; Sun, 4 Jun 2023 12:14:42 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 354JETSX003679; Sun, 4 Jun 2023 21:14:29 +0200 Date: Sun, 4 Jun 2023 21:14:29 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 0/4] selftests/nolibc: add user-space 'efault' handler Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 04, 2023 at 09:07:25PM +0200, Thomas Wei?schuh wrote: > On 2023-06-04 13:05:18+0200, Willy Tarreau wrote: > > Hi Zhangjin, > > > > On Tue, May 30, 2023 at 06:47:38PM +0800, Zhangjin Wu wrote: > > > Hi, Willy, Thomas > > > > > > This is not really for merge, but only let it work as a demo code to > > > test whether it is possible to restore the next test when there is a bad > > > pointer access in user-space [1]. > > > > > > Besides, a new 'run' command is added to 'NOLIBC_TEST' environment > > > variable or arguments to control the running iterations, this may be > > > used to test the reentrancy issues, but no failures found currently ;-) > > > > Since the tests we're running are essentially API tests, I'm having > > a hard time seeing in which case it can be useful to repeat the tests. > > I'm not necessarily against doing it, I'm used to repeating tests for > > example in anything sensitive to timing or race conditions, it's just > > that here I'm not seeing the benefit. And the fact you found no failure > > is rather satisfying because the opposite would have surprised me. > > > > Regarding the efault handler, I don't think it's a good idea until we > > have signal+longjmp support in nolibc. Because running different tests > > with different libcs kind of defeats the purpose of the test in the > > first place. The reason why I wanted nolibc-test to be portable to at > > least one other libc is to help the developer figure if a failure is in > > the nolibc syscall they're implementing or in the test itself. Here if > > we start to say that some parts cannot be tested similarly, the benefit > > disappears. > > > > I mentioned previously that I'm not particularly impatient to work on > > signals and longjmp. But in parallel I understand how this can make the > > life of some developers easier and even allow to widen the spectrum of > > some tests. Thus, maybe in the end it could be beneficial to make progress > > on this front and support these. We should make sure that this doesn't > > inflate the code base however. I guess I'd be fine with ignoring libc- > > based restarts on EINTR, alt stacks and so on and keeping this minimal > > (i.e. catch a segfault/bus error/sigill in a test program, or a Ctrl-C > > in a tiny shell). > > > > Just let us know if you think that's something you could be interested > > in exploring. There might be differences between architectures, I have > > not checked. > > If the goal is to handle hard errors like segfaults more gracefully, > would it not be easier to run each testcase in a subprocess? > > Then we can just check if the child exited successfully. > > It should also be completely architecture agnostic. Could be, indeed. However it would complexify a bit strace debugging, but yeah that might be something to think about. Willy