Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4393527rwd; Sun, 4 Jun 2023 04:36:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zPKLTauf7o853z2+7+ZS2uoUWxJOF3XabTHDDjIqZ+kcABnQ0Wd6+Z6MrUrqoVx2rd8Kf X-Received: by 2002:a17:902:d4c2:b0:1ac:8ad0:1707 with SMTP id o2-20020a170902d4c200b001ac8ad01707mr3735410plg.1.1685878597749; Sun, 04 Jun 2023 04:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685878597; cv=none; d=google.com; s=arc-20160816; b=xeEycZSKoV9Q4GHLTdr2QdIfrPZthHI5ng/LvvgIlRlSrIQRUY42R5kIxKvbElZHaV lxazadVr6SoxykAZ5rE7EVEf7HnjHmBS2aJqDh+RQ37QFG/IW0bO8yqx60QpceHe/H81 uU7hfZiKL3scZN3z0rHDnMMvMA0of51oiZkiTAEd5RsyLCkN4YEePA6ZFdgvndbHJLId YSJwkLh2CwG0SFRiKnMDF1uw5utk0ooEK+LMHm4mWTInAzK8PLOIgcooq54k/Y2KC+yc vuEJrr9/8VkKHm0xUDxqwgQ43cXoehurYcKLdS5MHiaxLcbAma4K2R7y7ol0firZfvx5 /tSw== 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:date; bh=rr3yDFiKnU5jgO1DasvRLpGMe8svhCOJtyRQHiLzqfg=; b=oyfHwg64zF36cUZtLeXcHScAC8u8R4VQedTq8Ine/MV5P/y5OftWFM+vJepTzOv1fk InZqBJiTYB67/XwGEl1Ev6LyV1L8hbMf4+OXCCff0LiQwqxTtntSX0MaO343wN8lwJfI oW0uqgbZ/XKNbN+Q5lp9Iof2cmZtJ5bGeHMC2JYaDp+wTnUD0QiDSoOvRYfEol0Sdf1V MAFdMTwvJEdQoTEeFDUebV/5xiKaIf1gyaEm4otwqL19NE/pDMNg8EP5oGP6FiJlKSaQ 6tJHbKd4DkA77qzoetlaOYwqMMZjFYRRVtomL/q7aC7ZNwJODaVr0yvnDzwtxV0IMi4V 6kYQ== 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 w21-20020a170902a71500b00192d6fb649dsi3825877plq.242.2023.06.04.04.36.23; Sun, 04 Jun 2023 04:36:37 -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 S230147AbjFDLFz (ORCPT + 99 others); Sun, 4 Jun 2023 07:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjFDLFx (ORCPT ); Sun, 4 Jun 2023 07:05:53 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1B54CE; Sun, 4 Jun 2023 04:05:51 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 354B5Ij4001769; Sun, 4 Jun 2023 13:05:18 +0200 Date: Sun, 4 Jun 2023 13:05:18 +0200 From: Willy Tarreau To: Zhangjin Wu Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de 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=-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 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. Thanks, Willy