RFR: JDK-8274435: EXCEPTION_ACCESS_VIOLATION in BFSClosure::closure_impl
Stefan Karlsson
stefank at openjdk.java.net
Thu Sep 30 11:40:35 UTC 2021
On Tue, 28 Sep 2021 11:08:48 GMT, Ekaterina Vergizova <evergizova at openjdk.org> wrote:
> Hi,
> please review this small change that prevents EXCEPTION_ACCESS_VIOLATION on some Windows machines.
> The crash is intermittently reproducible on win32 client jvm when running e.g. jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java test.
> It is caused by BitSet::get_fragment_bits method which returns null for the newly initialized BitSet if granule (= addr >> _bitmap_granularity_shift) is equal to 0.
>
> Testing:
> jdk/jfr/* with win32 and win64 builds, no crashes or regression after the fix.
Great find! Thanks for fixing.
src/hotspot/share/jfr/leakprofiler/chains/bitset.inline.hpp line 71:
> 69: inline CHeapBitMap* BitSet::get_fragment_bits(uintptr_t addr) {
> 70: uintptr_t granule = addr >> _bitmap_granularity_shift;
> 71: if (granule == _last_fragment_granule && _last_fragment_bits != NULL) {
Did you consider changing the initial value of _last_fragment_granule to an invalid granule value (say ~uintptr_t(0))?
That would allow you to keep the old code, which I think is a little bit easier to understand. With that, either _last_fragment_granule is uninitialized and will never match `granule`, or it has a valid granule value, which can be used to check if we have a properly set up _last_fragment_bits.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5736
More information about the hotspot-jfr-dev
mailing list