Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp571377rdb; Fri, 26 Jan 2024 04:35:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdjYesOvz1D9j9SlDYbqsckcGNb9+tEX0CDV3NCYDy6mTa185Q0F60a4JtzUhhOoI0Bxmf X-Received: by 2002:a17:90a:c482:b0:28c:a9d0:33ff with SMTP id j2-20020a17090ac48200b0028ca9d033ffmr649075pjt.62.1706272555952; Fri, 26 Jan 2024 04:35:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706272555; cv=pass; d=google.com; s=arc-20160816; b=NlD6DUid5V4XXGSnoymsumSfegrngyAVIlNSZYTR2FoiySsgidhnDiWsnYTq7zJEDE d+SFUrLtqZwt1W89st/3GgQRP1kVnq7BaVbIN3t98qzyTWNpW3N3mXUxJkuyYUGHBmR8 GQPnENsQA7GjlENKQGWBRhZ2djVpmVReilooE9LjqK9ZnvccDEKJsD7BgM4jNEk3kivQ D+oGkUgFa/UWNV8Nm5ny1XPsus4pPxyg1XiFDwr6PeZW5MjBWk/CMUtjA6wuwMpbJBEv ig2Hyz7tThOLL3mfTOA8MOcLuct4Ucn83vfOXk/65c7AgPa5NOL8B2h25jRJtUFwF6pM Fb4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=tBqGlsEjn/kPiobf5SqqLqz5w2BRrTChAdCUzax6B/E=; fh=d0s91grMllKngfhn+YxT93AYihF2Oz/MvSJ5uY0YF4w=; b=Wb8yLGOqWF8pLg0ZRmfk5LcL+PUKObBQpa1H2mydwP2v+cmTG+3UfaaU3IvmmGC2RM KODfvEJPooCbjjSF4htp7HFZhBKol2Q7HNWq89qFovI9QDAXzO6614LdT7O79ucaF9EK py6DF45/dL/sAJpFpZQpss5MkLxMwu+W0eZ1aTvO1ukAmoBGiKnKmz/6BnqzNeAGYgOM EyBmHNOiBpOIWHYVW5hRc2rlYMhsyIHRpHGK/AAHI/ug+1L+i2kJekDB4GLj8P3QSPPS 7gwqU3ThzpV0j2Qcj/jx3y6NSBl0BlTWe4EUV4e/5yWoyxLZFYoSjS7mKiHnBMCqxqY2 h8gQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=bQ41PCyR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="Vg+MLw/n"; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-40096-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40096-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id iz21-20020a17090ae79500b002900e52586fsi1105818pjb.20.2024.01.26.04.35.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 04:35:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40096-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=bQ41PCyR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="Vg+MLw/n"; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-40096-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40096-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DA001289D42 for ; Fri, 26 Jan 2024 12:34:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D1B61B5B1; Fri, 26 Jan 2024 12:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="bQ41PCyR"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Vg+MLw/n" Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 461271A726; Fri, 26 Jan 2024 12:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706272443; cv=none; b=heJMWgx4kWAk+tGTFcbeWPOcCWFSqsV/0TFaOpncMoQ4/XMPFvD44vcEHRMxMMh2YuGoGaq8BH7VJNiBB18dbfBLR6VRYUEaRZ4W3ytRNm8sOfrsYnuofwZxf50y40KtTv6EimvXrpy7FGxkJva/Js2HNtFBVdDPlwpyH/kK36Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706272443; c=relaxed/simple; bh=eFCWO1k8iWqR03mo4ZOrZ2bxtb9pRwS+IvtSVw+zg4o=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=nzhOA+zPHQNiOVoXFf6pFpGoqy07tQ9qxnRM6I3E5Yu3f+0JZcj3xoIHliZi8A9BtQgqLXv6bkSovIDnTfE8E/JSU6klPW8KuLNgeC+yrONeEaYsEC47Ob8HViFLqh9gBmWlMiPyr9T2Tka90CDQf3mtDBMhB4Ko6N+aANFLypA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com; spf=pass smtp.mailfrom=flygoat.com; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b=bQ41PCyR; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Vg+MLw/n; arc=none smtp.client-ip=64.147.123.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D91663200B35; Fri, 26 Jan 2024 07:33:59 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute3.internal (MEProxy); Fri, 26 Jan 2024 07:34:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1706272439; x=1706358839; bh=tBqGlsEjn/kPiobf5SqqLqz5w2BRrTChAdCUzax6B/E=; b= bQ41PCyRqkTGfAY3EcGz/E4+tr5J5nJYZVOYbWZvdqVmy2vPyGrY02Q9K3pLeLUW T4vI6n9ZC5ZZH2182wRzHoGH1DeZnWkmODohOMjnub5KDWfXiB4hv18qm+timODL 7xYN2FJtsJL9sc/Y6B2b8G8rLqBvQsY1aRWvgpsP6aMcHw2tIWC1rpVPa26QZ4qR GGISiUJlUEltf1mGiL7RjvvHpSFSLGadQKjHaxSMLzTsOkGXqrgVVjcPyr3FGmST xLRGZGRF/gbXcfJUdY4D6tN0RehqT9ZYtlX3L9kpUpDKnisFutWSw2ykcyeZVpQX GIpQXOxIi7jrClXsb2S03A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1706272439; x= 1706358839; bh=tBqGlsEjn/kPiobf5SqqLqz5w2BRrTChAdCUzax6B/E=; b=V g+MLw/nPlLUnBcqi1A/jOsI9bXUZptHc+C3yWTx4RJ9N0ueSTvvQrgiM52AUuNIf Rb6q/sSg5bcfpSCxFN2KlEEM0FRcnzUOtoDnLfKjdQbvf7WpusKKwLsiF00aBenC hftxxF8Up878nl8Abw2JizzSb3GGeTrtUpDkEchklIwf/CJ9o1E0WENdpLbZux8D paVzl956Hq4EC5uidnJlH0H5ERI4xTnYGqi+uGwCTCVSi0MPnMLOlkj0OGKELnNf Hq2xM9KlMOyrvg3419cwaRSEICs9kgTnS7LSAPQB5HSqkUpS+3ufsAbRXb4+JdLh ZVTaKXGabwSax0Py+GmCQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeljedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdfl ihgrgihunhcujggrnhhgfdcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtoh hmqeenucggtffrrghtthgvrhhnpeelteevjeekfedvgedvleeuueeukeegleelledujeek ffekvefhueffffefkedvueenucffohhmrghinhepshhouhhrtggvfigrrhgvrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgig uhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DA8D536A0076; Fri, 26 Jan 2024 07:33:58 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-119-ga8b98d1bd8-fm-20240108.001-ga8b98d1b Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <4b715c9f-6a9e-4496-8810-670080cb715a@app.fastmail.com> In-Reply-To: <75e9fd7b08562ad9b456a5bdaacb7cc220311cc9.camel@xry111.site> References: <75e9fd7b08562ad9b456a5bdaacb7cc220311cc9.camel@xry111.site> Date: Fri, 26 Jan 2024 12:33:38 +0000 From: "Jiaxun Yang" To: "Xi Ruoyao" , "linux-mips@vger.kernel.org" Cc: linux-kernel@vger.kernel.org, "Thomas Bogendoerfer" , libc-alpha@sourceware.org, regressions@lists.linux.dev Subject: Re: Strange EFAULT on mips64el returned by syscall when another thread is forking Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable =E5=9C=A82024=E5=B9=B41=E6=9C=8824=E6=97=A5=E4=B8=80=E6=9C=88 =E4=B8=8A=E5= =8D=8810:42=EF=BC=8CXi Ruoyao=E5=86=99=E9=81=93=EF=BC=9A > Hi, > > When I'm testing Glibc master branch for upcoming 2.39 release, I > noticed an alarming test failure on mips64el: So apparently it should be tracked as a regression. #regzbot ^introduced 4bce37a68ff884e821a02a731897a8119e0c37b7 Should we revert it for now? Thanks - Jiaxun > > FAIL: stdlib/tst-arc4random-thread > > I've gathered some info about it and pasted my findings into > https://sourceware.org/glibc/wiki/Testing/Tests/stdlib/tst-arc4random-= thread. > > Finally I was able to reduce the test case into: > > #include > #include > #include > #include > #include > > void * > test_thread (void *) > { > char buf[16] =3D {}; > int fd =3D open("/dev/zero", O_RDONLY); > while (1) > { > ssize_t ret =3D read (fd, buf, 7); > if (ret =3D=3D -1 && errno =3D=3D EFAULT) > abort (); > } > } > > void * > fork_thread (void *) > { > while (1) > { > if (!fork ()) > _exit (0); > } > } > > int > main (void) > { > pthread_t test_th; > pthread_t fork_th; > > pthread_create (&test_th, NULL, test_thread, NULL); > pthread_create (&fork_th, NULL, fork_thread, NULL); > pthread_join (test_th, NULL); > pthread_join (fork_th, NULL); > } > > When running this on the mainline kernel (revision 6.8.0-rc1+- > g7ed2632ec7d72e926b9e8bcc9ad1bb0cd37274bf) it fails in milliseconds.=20 > Some "interesting" aspects: > > 1. This is related to the size parameter passed to read (). When it's > less than 8 it fails, but when it's 8 or greater there is no failure. > 2. This is not related to if "buf" is initialized or not. > > Now I'm suspecting this might be a kernel bug. Any pointer to further > triage? > > --=20 > Xi Ruoyao > School of Aerospace Science and Technology, Xidian University --=20 - Jiaxun