lkml.org 
[lkml]   [2016]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] signals: work around random wakeups in sigsuspend()
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"?

\
 
 \ /
  Last update: 2016-02-25 19:21    [W:0.055 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site