RFR: 8264752: SIGFPE crash with option FlightRecorderOptions:threadbuffersize=30M

Hui Shi hshi at openjdk.java.net
Mon Apr 12 09:43:52 UTC 2021


…ize=30M

Fix misc explicit JFR memory option caused crash and assertion (https://bugs.openjdk.java.net/browse/JDK-8241773).

1. Fix SIGFPE crash in div_total_by_per_unit.
   a) In valid_memory_relations, check threadbuffersize should not larger than memorysize.
   b) In "void thread_buffer_size(JfrMemoryOptions* options)", calculate memorysize if it isn't configured, avoid SIGFPE when thread buffer size is larger than default memorysize.
   
2. Fix "assert(free_size() == size, "invariant");" in JfrBuffer::initialize.
   Limit globalbuffersize and threadbuffersize under 2G, avoid size_t to u4 coversion lost.
   
3. Check and report possible inconsistent conditions after jfr memory size adjustment.
   a) globalbuffercount < MIN_BUFFER_COUNT
   b) globalbuffersize < threadbuffersize

-------------

Commit messages:
 - 8264752: SIGFPE crash with option FlightRecorderOptions:threadbuffersize=30M

Changes: https://git.openjdk.java.net/jdk/pull/3432/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3432&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264752
  Stats: 104 lines in 5 files changed: 91 ins; 0 del; 13 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3432.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3432/head:pull/3432

PR: https://git.openjdk.java.net/jdk/pull/3432


More information about the hotspot-jfr-dev mailing list