Scope.Thread and @Setup bug?

Aleksey Shipilev shade at
Wed Sep 28 20:00:38 UTC 2016

On 09/28/2016 03:44 PM, Lev Serebryakov wrote:
> On 28.09.2016 16:08, Aleksey Shipilev wrote:
>> On 09/28/2016 03:02 PM, Lev Serebryakov wrote:
>>>  I'll try to compile minimal example where I got this.
>> If that reproduces only with your payload, I would appreciate if you can
>> publish that, if MCVE does not reproduce the failure. I'll stare at
>> generated code for a while...
>  Now I have minimal code, which hangs in JMH sometimes (interruption
> doesn't work) and throw this exception sometimes! Windows 7, JDK
> 1.8.0_102/x64. It hangs more often, than throws exception, but I got
> exceptions sometimes too, like this:

Thank you, this helped to uncover a serious bug in group thread
distribution. It will produce the symptoms like you described: on some
iteration the worker threads may swap methods they are executing, and
each would initialize an additional thread-local instance of

There is no workaround for 1.14.1, but it should be fixed in latest source:


More information about the jmh-dev mailing list