Race in ident generation

Stepan Koltsov stepan.koltsov at gmail.com
Tue Nov 26 01:08:30 UTC 2019


Hi folks,

some of our builds of libraries with JMH fail with this error:

```
Foo_bar_jmhTest.java:54: error: cannot find symbol
nullint startRndMask;
```

We do in-process compilation, and we do many builds concurrently.

We cannot reproduce this problem locally (it fails occasionally in our CI).
So we have a suspicion it is a race inside JMH: when two threads compute
idents, one of them observes partially initialized IDENTS variable.

So this is the fix:

https://gist.github.com/stepancheg/eadc1b46587b447728a696b4a57dff4f

(not tested)

Regards, Stepan


More information about the jmh-dev mailing list