Konstantin Belousov 787a64ddd2 Do not skip two elements of the tid_buffer when reusing the buffer
slot. This eventually results in exhaustion of the tid space, causing
new threads get tid -1 as identifier.

The bad effect of having the thread id equal to -1 is that
UMTX_OP_UMUTEX_WAIT returns EFAULT for a lock owned by such thread,
because casuword cannot distinguish between literal value -1 read from
the address and -1 returned as an indication of faulted
access. _thr_umutex_lock() helper from libthr does not check for
errors from _umtx_op_err(2), causing an infinite loop in
mutex_lock_sleep().

We observed the JVM processes hanging and consuming enormous amount of
system time on machines with approximately 100 days uptime.

Reported by:	Mykola Dzham <freebsd levsha org ua>
MFC after:	1 week
2012-09-22 12:17:09 +00:00
..
2012-05-31 19:32:37 +00:00
2012-08-16 13:01:56 +00:00
2012-08-17 02:47:16 +00:00
2012-08-28 19:30:29 +00:00
2011-04-13 11:28:46 +00:00
2012-08-22 20:01:57 +00:00
2012-03-28 20:58:30 +00:00
2012-08-11 23:48:39 +00:00
2011-07-10 00:53:04 +00:00
2012-06-25 05:41:16 +00:00
2012-09-04 23:16:55 +00:00
2012-02-01 14:34:52 +00:00
2012-01-26 16:35:09 +00:00
2012-06-11 18:47:26 +00:00
2012-09-14 21:28:56 +00:00
2012-08-08 00:20:30 +00:00
2012-08-17 02:47:16 +00:00
2012-01-02 12:12:10 +00:00
2012-08-15 22:12:01 +00:00