Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343351

Re: [PATCH] signals: work around random wakeups in sigsuspend()

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] signals: work around random wakeups in sigsuspend()
Date 2016-02-25 18:40 +0100
Message-ID <r683o-78A-17@gated-at.bofh.it> (permalink)
References <qURIG-68y-83@gated-at.bofh.it> <qUUGu-8W-17@gated-at.bofh.it> <r5UD8-6ag-31@gated-at.bofh.it> <r5Zjs-XU-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Feb 25, 2016 at 09:11:44AM +0100, Peter Zijlstra wrote:

> > Out of curiousity - where did that stray wakeup come from?  PTRACE_KILL
> > used to trigger those, but that got fixed.  How does one trigger that
> > kind of bugs on the current kernels?
> 
> Its a regular TASK_INTERRUPTIBLE sleep, for those spurious wakeups are
> not a bug, they're pretty fundamentally allowed.

They are, which makes any code that doesn't expect them in such situations
buggy.

> See: lkml.kernel.org/r/CA+55aFwHkOo+YGWKYROmce1-H_uG3KfEUmCkJUerTj=ojY2H6Q@mail.gmail.com

I know.  The question is not whether the code must take them into account
(it must; it's a bug not to), it's what's a good way to trigger such bugs.
IOW, how to stress-test for such bugs?

PTRACE_KILL used to be a convenient way to arrange for a wakeup delivered
to victim engaged in something we want to stress; it doesn't do blind
wake_up_process() anymore, so that trick is gone.  Is there anything
similar?

Suppose I have a dodgy waitqueue code (pardon the redundancy) in some
filesystem.  I have some idea how to maneuver a process into such-and-such
part of that code; is there any convenient way to turn that into "... OK,
now let's add bombing it with stray wakeups"?

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] signals: work around random wakeups in sigsuspend() Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-25 04:20 +0100
  Re: [PATCH] signals: work around random wakeups in sigsuspend() Peter Zijlstra <peterz@infradead.org> - 2016-02-25 09:20 +0100
    Re: [PATCH] signals: work around random wakeups in sigsuspend() Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-25 18:40 +0100

csiph-web