Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4772724rwd; Sun, 4 Jun 2023 12:29:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7QT/7d0RtbtPwXK3h9UYNXl3lQwdk1RYf1qHRbYN/jvLFFloCtA1ZSmP95Me3UWZ6myQAr X-Received: by 2002:a17:90a:f40e:b0:256:82c0:8120 with SMTP id ch14-20020a17090af40e00b0025682c08120mr2990784pjb.13.1685906999246; Sun, 04 Jun 2023 12:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685906999; cv=none; d=google.com; s=arc-20160816; b=N/HHz7CH1DJ5kS9ae7LOGCQe3Dfplh1AN5qr+HvT+nckEmJ24SIQAQh6PXimZkMcMd Vxt2XJQMTpTXXNvaVAlqPpUCm1vd+OxBL5L2LFc39Z7Zo1TkiUcxNo/GziO7xZoM56zI fR/2JElyYRlXIvM/H/1rb+YYljv2ei2sFiFzOWr284Jwx2krQmuagDHL1K89NL+JMZij 48Ne3cp2DggfYk7d0fGokhUQFbOUTPfbqypSaiZaIktaSUlXF6D5+MJisql6p+zNPj5q tdB8UA2PhnnNAwnqiDFcDCLRDoQ+wwaM/RoRejI+dzIOLjrtZw4qXCxs/31LLRvr4HhN aPXQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=zDm9gvgWbdk8yWIgsd1f4DY+aqapdIAVHq2uCyGXgWg=; b=J5PoTqF9cgMCxY922XmRPDvXY5fu06gGuk6DUnVKkIXJWkFozGJdp3oqw3rKLpNfyn 4HjgjIIJjEVRqN68z+In3+DpI3nnNZvWg1qoOn/8kC2hY0tILNneupr0DRMgGH4wvh8E zX+Pcx9YLMoAfi7P0ehkEd5849n/3miyeKnLYSHsXMV1pPuY1LmdFRW3WWqv+B0hn7Ej 0oyC7Mbn2G5Pn8XO3aHN/vH3ep2tYPxCoQlU1CjUKnGiFXo1Y/C2IloCvkTTVVnkCjb5 QTBISQ9UKM/0yJAyjvSSO2fRMN8Q7lhsuDjHeTh2mkd+EYYXvtWnJxkOREAHzKgIjgMO g4fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=Sa7eVeip; 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 m9-20020a654389000000b0051f7686dfb7si4463601pgp.189.2023.06.04.12.29.25; Sun, 04 Jun 2023 12:29:59 -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; dkim=pass header.i=@t-8ch.de header.s=mail header.b=Sa7eVeip; 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 S231701AbjFDTH3 (ORCPT + 99 others); Sun, 4 Jun 2023 15:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbjFDTH2 (ORCPT ); Sun, 4 Jun 2023 15:07:28 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21072A4; Sun, 4 Jun 2023 12:07:27 -0700 (PDT) Date: Sun, 4 Jun 2023 21:07:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1685905645; bh=tVL6rua96sFgrYX+hG+hECHYZwYEGKbaivsDiNvbYyc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Sa7eVeipLe2kCWP0XMt2fU3wqRXYQ5/Xf+VesjJK5KPZMG3Loir696DyY/gMAmOVq R+P2+Yz/Gasv1bgoR+57TyuWfQi1YbWHUluQsgyiQvOnS69jUgmzuURcr+laWblmRz BAR3FOS5k0JdfPSZr2hDYzPc/bTRqq2h1/5idb74= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Willy Tarreau 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=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,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 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. Thomas