-
Bug
-
Resolution: Fixed
-
P4
-
8-pool, 11-pool, 17, 20, 21
-
b26
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8311483 | 17.0.9 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
TLAB initialization (in ThreadLocalAllocBuffer::initialize()) samples how much of capacity has actually been filled for statistics/resizing purposes:
size_t capacity = Universe::heap()->tlab_capacity(thread()) / HeapWordSize;
// Keep alloc_frac as float and not double to avoid the double to float conversion
float alloc_frac = desired_size() * target_refills() / (float) capacity;
That capacity can be zero (if e.g. there is no space left for allocation).
Adding an assert checking that capacity is > 0 here will crash the VM during shutdown (experienced only on OSX for whatever reason):
Stack: [0x000000016d454000,0x000000016d657000], sp=0x000000016d656d40, free space=2059k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0x1374050] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x4bc (threadLocalAllocBuffer.cpp:216)
V [libjvm.dylib+0x13749ec] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x40
V [libjvm.dylib+0x6aa82c] report_vm_error(char const*, int, char const*, char const*, ...)+0x6c
V [libjvm.dylib+0x12a8754] ThreadLocalAllocBuffer::initialize()+0x7c
V [libjvm.dylib+0xb11194] attach_current_thread(JavaVM_*, void**, void*, bool)+0x1d0
V [libjvm.dylib+0xb10e0c] jni_DestroyJavaVM+0x4c
C [libjli.dylib+0x745c] JavaMain+0xc3c
C [libjli.dylib+0x94cc] ThreadJavaMain+0xc
C [libsystem_pthread.dylib+0x7240] _pthread_start+0x94
This seems timing dependent, only on OSX and G1 we ever noticed an issue (probablyJDK-8264798), the FPE_FLTDIV delivered lazily/late.
The suggested fix is to just not sample in this case.
size_t capacity = Universe::heap()->tlab_capacity(thread()) / HeapWordSize;
// Keep alloc_frac as float and not double to avoid the double to float conversion
float alloc_frac = desired_size() * target_refills() / (float) capacity;
That capacity can be zero (if e.g. there is no space left for allocation).
Adding an assert checking that capacity is > 0 here will crash the VM during shutdown (experienced only on OSX for whatever reason):
Stack: [0x000000016d454000,0x000000016d657000], sp=0x000000016d656d40, free space=2059k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0x1374050] VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x4bc (threadLocalAllocBuffer.cpp:216)
V [libjvm.dylib+0x13749ec] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, char*)+0x40
V [libjvm.dylib+0x6aa82c] report_vm_error(char const*, int, char const*, char const*, ...)+0x6c
V [libjvm.dylib+0x12a8754] ThreadLocalAllocBuffer::initialize()+0x7c
V [libjvm.dylib+0xb11194] attach_current_thread(JavaVM_*, void**, void*, bool)+0x1d0
V [libjvm.dylib+0xb10e0c] jni_DestroyJavaVM+0x4c
C [libjli.dylib+0x745c] JavaMain+0xc3c
C [libjli.dylib+0x94cc] ThreadJavaMain+0xc
C [libsystem_pthread.dylib+0x7240] _pthread_start+0x94
This seems timing dependent, only on OSX and G1 we ever noticed an issue (probably
The suggested fix is to just not sample in this case.
- backported by
-
JDK-8311483 TLAB initialization may cause div by zero
- Resolved
- relates to
-
JDK-8264798 exp_avg() throws SIGFPE, FPE_FLTDIV signal with floating point div by 0 zero signals enabled
- Closed
- links to
-
Commit openjdk/jdk17u-dev/90345a4c
-
Commit openjdk/jdk/96ed1392
-
Review openjdk/jdk17u-dev/1536
-
Review openjdk/jdk/14121
(1 links to)