RFR: 8219197: ThreadGroup.enumerate() may return wrong value

Daniel Fuchs daniel.fuchs at oracle.com
Wed Mar 13 14:22:14 UTC 2019


Hi Pavel,

On 13/03/2019 14:02, Pavel Rappo wrote:
> Might it be the case that not only the returned value is wrong, but also the
> populated list is corrupted? After all the returned value is used as an index
> for the next insertion.

I'm not sure what you mean by that.

I don't think there is another bug in the 3-args enumerate
methods.

But if some node in the tree-like hierarchy returns a wrong
value then the next node in the tree-like hierarchy will
start writing at the wrong index, and the final value
returned by the top-most call will be wrong.
Without the fix, and given an original list containing only
null, then if you are unlucky enough the final list might look
like:

n = 2
[t23, t24, t12, t13, t5, t6, null, null, ...]

when in reality there are 24 ([t1..t24]) active threads...

best regards,

-- daniel


More information about the core-libs-dev mailing list