From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by sourceware.org (Postfix) with ESMTPS id 94B9D3858D39 for ; Tue, 9 Nov 2021 12:53:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 94B9D3858D39 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tonyk) with ESMTPSA id C89B91F44B34 Message-ID: <51bbfe74-33f6-bb92-3ce8-a22e4185820b@collabora.com> Date: Tue, 9 Nov 2021 09:52:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v2 20/22] selftests: futex: Test sys_futex_waitv() timeout Content-Language: en-US To: Vasily Gorbik Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , linux-kernel@vger.kernel.org, Steven Rostedt , Sebastian Andrzej Siewior , kernel@collabora.com, krisman@collabora.com, linux-api@vger.kernel.org, libc-alpha@sourceware.org, mtk.manpages@gmail.com, Davidlohr Bueso , Arnd Bergmann References: <20210923171111.300673-1-andrealmeid@collabora.com> <20210923171111.300673-21-andrealmeid@collabora.com> From: =?UTF-8?Q?Andr=c3=a9_Almeida?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 12:53:09 -0000 Hi Vasily, Às 08:18 de 09/11/21, Vasily Gorbik escreveu: > On Thu, Sep 23, 2021 at 02:11:09PM -0300, André Almeida wrote: >> Test if the futex_waitv timeout is working as expected, using the >> supported clockid options. > >> + /* futex_waitv with CLOCK_MONOTONIC */ >> + if (futex_get_abs_timeout(CLOCK_MONOTONIC, &to, timeout_ns)) >> + return RET_FAIL; >> + res = futex_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC); >> + test_timeout(res, &ret, "futex_waitv monotonic", ETIMEDOUT); >> + >> + /* futex_waitv with CLOCK_REALTIME */ >> + if (futex_get_abs_timeout(CLOCK_REALTIME, &to, timeout_ns)) >> + return RET_FAIL; >> + res = futex_waitv(&waitv, 1, 0, &to, CLOCK_REALTIME); >> + test_timeout(res, &ret, "futex_waitv realtime", ETIMEDOUT); > > Hi André, > > when built with -m32 and run as compat this two futex_waitv calls hang > on x86 and s390 (noticed while wiring up futex_waitv). The rest of the > futex selftests pass. This suggests some common compat issue? Any ideas? The issue is that futex_waitv() only accepts struct timespec that uses 64bit members. When using -m32, glibc will give you a 32bit timespec, thus the timeout won't wort. Someday glibc will provide 64bit timespec to 32bit userspace, given that this is affected by y2038 bug. In previous submissions I added a workaround for that in the selftest[0]. Search for "Y2038 section for 32-bit applications" in that link. I'll submit something like that for futex_waitv() timeout test. [0] https://lore.kernel.org/lkml/20210709001328.329716-6-andrealmeid@collabora.com/