Details
-
Bug
-
Resolution: Fixed
-
P2
-
7u40, 8
-
Generic Linux. I tested on OEL 6u3.
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8030292 | 8u5 | Anton Litvinov | P3 | Resolved | Fixed | b01 |
JDK-8034699 | 7u65 | Anton Litvinov | P2 | Resolved | Fixed | b01 |
JDK-8028350 | 7u60 | Anton Litvinov | P2 | Closed | Fixed | b03 |
JDK-8078406 | 6u105 | Anton Litvinov | P2 | Resolved | Fixed | b01 |
JDK-8079097 | 6u101 | Anton Litvinov | P2 | Closed | Fixed | b10 |
Description
Run netbeans 7.3.1 with -Xcheck:jni. With JDK 7u40, only a few, seemingly harmless warnings are printed. With JDK8 b106, a large number of warnings are printed:
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
...
The JNI functions that cause these warnings are Java_sun_java2d_loops_Blit_Blit and Java_sun_java2d_loops_MaskBlit_MaskBlit. They are trying to copy a source image (in memory buffer) to a destination image (in X11).
[1] It first calls BufImg_GetRasInfo, which calls jni_GetPrimitiveArrayCritical, which calls GC_locker::jni_lock to prevent GC from happening.
[2] Then, it calls X11SD_GetRasInfo, which tries to execute a Java method:
#0 functionEnter (thr=0x7f69e4170800) at src/share/vm/prims/jniCheck.cpp:187
#1 0x00007f6a6b987b3c in checked_jni_EnsureLocalCapacity (env=0x7f69e4170a20, capacity=3)
#2 0x00007f6a6aa934ac in JNU_CallStaticMethodByName ()
#3 0x00007f6a44d4113f in TryXShmAttach ()
#4 0x00007f6a44d32825 in X11SD_CreateSharedImage ()
#5 0x00007f6a44d33eb4 in X11SD_GetImage ()
#6 0x00007f6a44d3464a in X11SD_GetRasInfo ()
#7 0x00007f6a45062ee1 in Java_sun_java2d_loops_Blit_Blit ()
Actually a few different methods are called while the primitive array is still being held.
If one of these Java methods causes a GC, we will deadlock because GC has been disabled.
The chance for deadlock may be higher for apps which refreshes the screen frequently and creates a lot of garbage.
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical
...
The JNI functions that cause these warnings are Java_sun_java2d_loops_Blit_Blit and Java_sun_java2d_loops_MaskBlit_MaskBlit. They are trying to copy a source image (in memory buffer) to a destination image (in X11).
[1] It first calls BufImg_GetRasInfo, which calls jni_GetPrimitiveArrayCritical, which calls GC_locker::jni_lock to prevent GC from happening.
[2] Then, it calls X11SD_GetRasInfo, which tries to execute a Java method:
#0 functionEnter (thr=0x7f69e4170800) at src/share/vm/prims/jniCheck.cpp:187
#1 0x00007f6a6b987b3c in checked_jni_EnsureLocalCapacity (env=0x7f69e4170a20, capacity=3)
#2 0x00007f6a6aa934ac in JNU_CallStaticMethodByName ()
#3 0x00007f6a44d4113f in TryXShmAttach ()
#4 0x00007f6a44d32825 in X11SD_CreateSharedImage ()
#5 0x00007f6a44d33eb4 in X11SD_GetImage ()
#6 0x00007f6a44d3464a in X11SD_GetRasInfo ()
#7 0x00007f6a45062ee1 in Java_sun_java2d_loops_Blit_Blit ()
Actually a few different methods are called while the primitive array is still being held.
If one of these Java methods causes a GC, we will deadlock because GC has been disabled.
The chance for deadlock may be higher for apps which refreshes the screen frequently and creates a lot of garbage.
Attachments
Issue Links
- backported by
-
JDK-8034699 JNI warnings in TryXShmAttach
- Resolved
-
JDK-8078406 JNI warnings in TryXShmAttach
- Resolved
-
JDK-8030292 JNI warnings in TryXShmAttach
- Resolved
-
JDK-8028350 JNI warnings in TryXShmAttach
- Closed
-
JDK-8079097 JNI warnings in TryXShmAttach
- Closed
- relates to
-
JDK-8005607 Recursion in J2DXErrHandler() Causes a Stack Overflow on Linux
- Resolved
(1 relates to)