RFR: 8264752: SIGFPE crash with option FlightRecorderOptions:threadbuffersize=30M
Markus Grönlund
mgronlun at openjdk.java.net
Fri Apr 16 14:38:44 UTC 2021
On Mon, 12 Apr 2021 09:36:56 GMT, Hui Shi <hshi at openjdk.org> wrote:
> …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
I did see this test fail when running on linux-aarch64:
[2021-04-16T12:55:44,162Z] java.lang.RuntimeException: 'Decrease globalbuffersize or increase memorysize or adjust global/threadbuffersize' missing from stdout/stderr
[2021-04-16T12:55:44,163Z]
[2021-04-16T12:55:44,163Z] at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:206)
[2021-04-16T12:55:44,163Z] at jdk.jfr.startupargs.TestBadOptionValues.test(TestBadOptionValues.java:56)
[2021-04-16T12:55:44,163Z] at jdk.jfr.startupargs.TestBadOptionValues.main(TestBadOptionValues.java:139)
[2021-04-16T12:55:44,163Z] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2021-04-16T12:55:44,163Z] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
[2021-04-16T12:55:44,163Z] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2021-04-16T12:55:44,164Z] at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[2021-04-16T12:55:44,164Z] at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
[2021-04-16T12:55:44,164Z] at java.base/java.lang.Thread.run(Thread.java:831)
[2021-04-16T12:55:44,164Z]
[2021-04-16T12:55:44,164Z] JavaTest Message: Test threw exception: java.lang.RuntimeException
[2021-04-16T12:55:44,165Z] JavaTest Message: shutting down test
-------------
PR: https://git.openjdk.java.net/jdk/pull/3432
More information about the hotspot-jfr-dev
mailing list