futex: Fix buggy timeout
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 14 Dec 2018 21:49:19 +0000 (16:49 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 14 Dec 2018 22:23:48 +0000 (17:23 -0500)
commit287bd2317d46a30fa3c96670b8e0c92029224f11
tree449eecc67994d2f70ff02b40c9c36a57f498ac32
parenta13aa901a37a407407771f0f45dd79e28fced28b
futex: Fix buggy timeout

We were sending the abs_timeout timespec in all cases, even if we
weren't passed a timeout.  That means we were signing up for a timespec
from uninitialized data!  Who knows when that will go off.  If it is far
in the future, we're likely to never notice.  If it happens to go off,
we'll have futexes timing out that shouldn't time out - chaos!

I had a VM that was up long enough that these timers were going off, and
I noticed really old alarms in the "alarm pcpu" output.  They would fire
instantly too.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/pthread/futex.c