Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5150532imu; Tue, 29 Jan 2019 13:46:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN4GdThULYn+QUux6XzenaDCKn4sLCt4MerUwHr00RBq8V5CHvDNPTUgOhzBPo+imv0cYunl X-Received: by 2002:a17:902:850c:: with SMTP id bj12mr27218171plb.46.1548798411140; Tue, 29 Jan 2019 13:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548798411; cv=none; d=google.com; s=arc-20160816; b=uCtxf/UzAjKKDbB5ZZAJ+QpuOQlBMlyxpInn6uhki+OkY0BWYwaU9jGJ5cT55bDSXz bNynUzPJgIlrDpq9nzWHqLKKQjcU/w0zCUPpBmbPjTkbIO9APRf3TJL49P130NdECtVL COeX7zvMdqSJlpjACbe/Zh+G3xJWA7eqogBUxeu2QVPemQ3NgT0QXNdAtffmZtRlKhhR HTR/t3BUdW/2DTn3emvBr57kv2zC7/SdF2nqwd+fGMY5hQkvTU2pEq6v51eeYJzReFEf H2ewLblFqgyBu56OQ6h6EaxGKSPr6bBHLTrrri5KX37Qx+O3ECuru7AZsr88ZuHBRKQS 7rMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=DNINTa1dxn2C7hUnBfiJ8uEMmHP7CabpqLX4xQ8OZ5s=; b=C9HDVnN3CTldgIXpIur46OXhmAIlqnUK8fSAxtuTHcNP1NYP65c0nKINtqHNKjqV1d 3TG0OUu1g9Kr5H3RS1mMIdaYcDtOP+67K6SLRGzByF2Du207YLGY6eZA1XTNrv4Z0Ox3 DBusbdBhkmNK9mKKe8WxQrE4lsh8zJ6+NY01ET8U3Pv9haBeT2Mch6hvsDOULH21uM0m uHB+fxkeQvDE6lH3z+Y0Xh7qq4ffSAxJC2gKmFxuHtx1N8tVDFbXtIC0CoBJY8iTc8dh wZPFQ67qGfSuJhl2BCiYm2ZbI0d92geh3WkGIlShGlOS8/fMoKYwnyLWKfQydnlG09ai lxPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si34368143pgj.208.2019.01.29.13.46.35; Tue, 29 Jan 2019 13:46:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729568AbfA2Vp7 (ORCPT + 99 others); Tue, 29 Jan 2019 16:45:59 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:45238 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbfA2Vp7 (ORCPT ); Tue, 29 Jan 2019 16:45:59 -0500 Received: from p5492e0d8.dip0.t-ipconnect.de ([84.146.224.216] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gobCa-0007Ou-ST; Tue, 29 Jan 2019 22:45:53 +0100 Date: Tue, 29 Jan 2019 22:45:52 +0100 (CET) From: Thomas Gleixner To: Sebastian Sewior cc: Heiko Carstens , Peter Zijlstra , Ingo Molnar , Martin Schwidefsky , LKML , linux-s390@vger.kernel.org, Stefan Liebler Subject: Re: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggered In-Reply-To: <20190129171653.ycl64psq2liy5o5c@linutronix.de> Message-ID: References: <20190128134410.GA28485@hirez.programming.kicks-ass.net> <20190128135804.GB28878@hirez.programming.kicks-ass.net> <20190129090108.GA26906@osiris> <20190129102409.GB26906@osiris> <20190129103557.GF28485@hirez.programming.kicks-ass.net> <20190129132303.GE26906@osiris> <20190129151058.GG26906@osiris> <20190129171653.ycl64psq2liy5o5c@linutronix.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1399204439-1548798352=:1950" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1399204439-1548798352=:1950 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Tue, 29 Jan 2019, Sebastian Sewior wrote: > On 2019-01-29 16:10:58 [+0100], Heiko Carstens wrote: > > Finally... the trace output is quite large with 26 MB... Therefore an > > xz compressed attachment. Hope that's ok. > > > > The kernel used was linux-next 20190129 + your patch. > | ld64.so.1-10237 [006] .... 14232.031726: sys_futex(uaddr: 3ff88e80618, op: 7, val: 3ff00000007, utime: 3ff88e7f910, uaddr2: 3ff88e7f910, val3: 3ffc167e8d7) > FUTEX_UNLOCK_PI | SHARED > > | ld64.so.1-10237 [006] .... 14232.031726: sys_futex -> 0x0 > … > | ld64.so.1-10237 [006] .... 14232.051751: sched_process_exit: comm=ld64.so.1 pid=10237 prio=120 > … > | ld64.so.1-10148 [006] .... 14232.061826: sys_futex(uaddr: 3ff88e80618, op: 6, val: 1, utime: 0, uaddr2: 2, val3: 0) > FUTEX_LOCK_PI | SHARED > > | ld64.so.1-10148 [006] .... 14232.061826: sys_futex -> 0xfffffffffffffffd > > So there got to be another task that acquired the lock in userland and > left since the last in kernel-user unlocked it. This might bring more Well, that would mean that this very task did not have a valid robust list, which is very unlikely according to the test case. We might actually stick a trace point into the robust list code as well. > light to it: > > diff --git a/kernel/futex.c b/kernel/futex.c > index 599da35c2768..aaa782a8a115 100644 > --- a/kernel/futex.c > +++ b/kernel/futex.c > @@ -1209,6 +1209,9 @@ static int handle_exit_race(u32 __user *uaddr, u32 uval, > * corrupted or the user space value in *uaddr is simply bogus. > * Give up and tell user space. > */ > + trace_printk("uval2 vs uval %08x vs %08x (%d)\n", uval2, uval, > + tsk ? tsk->pid : -1); > + __WARN(); > return -ESRCH; > } > > @@ -1233,8 +1236,10 @@ static int attach_to_pi_owner(u32 __user *uaddr, u32 uval, union futex_key *key, > if (!pid) > return -EAGAIN; > p = find_get_task_by_vpid(pid); > - if (!p) > + if (!p) { > + trace_printk("Missing pid %d\n", pid); > return handle_exit_race(uaddr, uval, NULL); > + } > > if (unlikely(p->flags & PF_KTHREAD)) { > put_task_struct(p); Yep, that should give us some more clue. > I am not sure, but isn't this the "known" issue where the kernel drops > ESRCH in a valid case and glibc upstream does not recognize it because > it is not a valid /POSIX-defined error code? (I *think* same is true for > -ENOMEM) If it is, the following C snippet is a small tc: That testcase is not using robust futexes, but yes it's demonstrating the glibc does not handle all documented error codes. But I don't think it has anything to do with the problem at hand. Famous last words.... Thanks, tglx --8323329-1399204439-1548798352=:1950--