JDK-8225784 : jfx media crashes on RHEL 7.3
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: 8u191
  • Priority: P2
  • Status: Closed
  • Resolution: Incomplete
  • OS: linux_redhat_7.3
  • Submitted: 2019-06-14
  • Updated: 2020-01-14
  • Resolved: 2020-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8-poolResolved
Related Reports
Relates :  
Description
JFX Media crashes on RHEL 7.3 on attempt to load libglib-lite.so

This is likely a regression of JDK-8199527.

To reproduce try to play any media content in WebView.

A snippet from the crash dump (attached)

Current thread (0x00007f15b51e3000):  JavaThread "JavaFX Application Thread" [_thread_in_native, id=8827, stack(0x00007f14ff6b0000,0x00007f14ff7b1000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00000000ffffffff

Registers:
RAX=0x00007f1618b6a840, RBX=0x000000000000001b, RCX=0x00007f14f0225410, RDX=0x00007ffde5e11be8
RSP=0x00007f14ff7ab2a8, RBP=0x00007ffde5e11b08, RSI=0x00007ffde5e11b08, RDI=0x000000000000001b
R8 =0x0000000000000001, R9 =0x0000000000004000, R10=0x00007f14ff7ab030, R11=0x00007f161887a8b0
R12=0x00007ffde5e11be8, R13=0x00007f148f8d1378, R14=0x0000000000000002, R15=0x00007f148f8d1370
RIP=0x00000000ffffffff, EFLAGS=0x0000000000010202, CSGSFS=0x0000000000000033, ERR=0x0000000000000014
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007f14ff7ab2a8)
0x00007f14ff7ab2a8:   00007f148f5c218c 00007f148f648a80
0x00007f14ff7ab2b8:   0000000000000008 00007f148f64aedf
0x00007f14ff7ab2c8:   0000000000000020 00007f148f6430dd
0x00007f14ff7ab2d8:   0000000000000040 00007f148f648a6e
0x00007f14ff7ab2e8:   0000000000000080 000000000000001b
0x00007f14ff7ab2f8:   00007ffde5e11b08 000000000000001b
0x00007f14ff7ab308:   00007f16b3c41553 00007f14f02231a0
0x00007f14ff7ab318:   000000000000000a 0000000000000000
0x00007f14ff7ab328:   000000000000000a 00007f14ff7ab420
0x00007f14ff7ab338:   000000000000000a 0000000000000001
0x00007f14ff7ab348:   000000000000000a 00007f14f02231a0
0x00007f14ff7ab358:   00007f16b3c45c66 00007f14f02231a0
0x00007f14ff7ab368:   00007f14f0223680 00007f14f0223b90
0x00007f14ff7ab378:   00007f14f02246a0 00007f14ff7ab420
0x00007f14ff7ab388:   00007f16b3c45aa9 00007f14ff7ab3b0
0x00007f14ff7ab398:   00007f14ff7ab450 00007f1400000001
0x00007f14ff7ab3a8:   0000000000000050 00007f14ff7ab360
0x00007f14ff7ab3b8:   00007f14ff7ab390 0000000000000003
0x00007f14ff7ab3c8:   000000000000000a 00007f16b3e54120
0x00007f14ff7ab3d8:   000000000000000b 8000000100000001
0x00007f14ff7ab3e8:   00007f14ff7ab588 00007f16b3138250
0x00007f14ff7ab3f8:   00007f14ff7b06f8 0000000080000001
0x00007f14ff7ab408:   00007f14f0222920 00007ffde5e11b08
0x00007f14ff7ab418:   000000000000001b 00007f14ff7ab600
0x00007f14ff7ab428:   00007f16b3c41364 00007f14ff7b06f8
0x00007f14ff7ab438:   00007f14ff7ab578 00007f14ff7ab580
0x00007f14ff7ab448:   00007f14ff7ab570 00007f16b3c458b0
0x00007f14ff7ab458:   00007f14ff7ab588 00000000ff7ab480
0x00007f14ff7ab468:   00007f14ff7ab680 0000000000000000
0x00007f14ff7ab478:   0000000000000000 00007f167472f3d8
0x00007f14ff7ab488:   fffffffffffffffe a10ea7a5be2cb2ce
0x00007f14ff7ab498:   0000000080000001 00007f14f0222920 

Instructions: (pc=0x00000000ffffffff)
0x00000000ffffffdf:   
[error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xb]

Register to memory mapping:

RAX=0x00007f1618b6a840: <offset 0x335840> in /lib64/libglib-2.0.so.0 at 0x00007f1618835000
RBX=0x000000000000001b is an unknown value
RCX=0x00007f14f0225410 is an unknown value
RDX=0x00007ffde5e11be8 is an unknown value
RSP=0x00007f14ff7ab2a8 is pointing into the stack for thread: 0x00007f15b51e3000
RBP=0x00007ffde5e11b08 is an unknown value
RSI=0x00007ffde5e11b08 is an unknown value
RDI=0x000000000000001b is an unknown value
R8 =0x0000000000000001 is an unknown value
R9 =0x0000000000004000 is an unknown value
R10=0x00007f14ff7ab030 is pointing into the stack for thread: 0x00007f15b51e3000
R11=0x00007f161887a8b0: glib__private__+0 in /lib64/libglib-2.0.so.0 at 0x00007f1618835000
R12=0x00007ffde5e11be8 is an unknown value
R13=0x00007f148f8d1378: <offset 0x342378> in /export/apps/xtools/LNKD-intellij-2019.1/jre64/jre/lib/amd64/libglib-lite.so at 0x00007f148f58f000
R14=0x0000000000000002 is an unknown value
R15=0x00007f148f8d1370: <offset 0x342370> in /export/apps/xtools/LNKD-intellij-2019.1/jre64/jre/lib/amd64/libglib-lite.so at 0x00007f148f58f000


Stack: [0x00007f14ff6b0000,0x00007f14ff7b1000],  sp=0x00007f14ff7ab2a8,  free space=1004k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x00000000ffffffff

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;Z)V+0
j  java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+328
j  java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+48
j  java.lang.Runtime.load0(Ljava/lang/Class;Ljava/lang/String;)V+57
j  java.lang.System.load(Ljava/lang/String;)V+7
j  com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(Ljava/lang/String;)V+342
j  com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(Ljava/lang/String;)V+1
j  com.sun.glass.utils.NativeLibLoader.loadLibrary(Ljava/lang/String;)V+11
j  com.sun.media.jfxmediaimpl.NativeMediaManager.lambda$new$33()Ljava/lang/Object;+36
j  com.sun.media.jfxmediaimpl.NativeMediaManager$$Lambda$3272.run()Ljava/lang/Object;+0
v  ~StubRoutines::call_stub
J 5545  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object; (0 bytes) @ 0x00007f169db7508f [0x00007f169db75040+0x4f]
j  com.sun.media.jfxmediaimpl.NativeMediaManager.<init>()V+42
j  com.sun.media.jfxmediaimpl.NativeMediaManager$NativeMediaManagerInitializer.<clinit>()V+4
v  ~StubRoutines::call_stub
j  com.sun.media.jfxmediaimpl.NativeMediaManager.getDefaultInstance()Lcom/sun/media/jfxmediaimpl/NativeMediaManager;+0
j  com.sun.media.jfxmedia.MediaManager.getSupportedContentTypes()[Ljava/lang/String;+0
j  com.sun.javafx.webkit.prism.PrismGraphicsManager.getSupportedMediaTypes()[Ljava/lang/String;+0
v  ~StubRoutines::call_stub
j  com.sun.webkit.network.URLLoader.twkDidFinishLoading(J)V+0
j  com.sun.webkit.network.URLLoader.notifyDidFinishLoading()V+44
j  com.sun.webkit.network.URLLoader.lambda$didFinishLoading$102()V+8
j  com.sun.webkit.network.URLLoader$$Lambda$2558.run()V+4
j  com.sun.javafx.application.PlatformImpl.lambda$null$402(Ljava/lang/Runnable;)Ljava/lang/Void;+1
j  com.sun.javafx.application.PlatformImpl$$Lambda$2221.run()Ljava/lang/Object;+4
v  ~StubRoutines::call_stub
J 3192  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (0 bytes) @ 0x00007f169d3324e3 [0x00007f169d332480+0x63]
j  com.sun.javafx.application.PlatformImpl.lambda$runLater$403(Ljava/lang/Runnable;Ljava/security/AccessControlContext;)V+7
j  com.sun.javafx.application.PlatformImpl$$Lambda$2220.run()V+8
J 19532 C1 com.sun.glass.ui.InvokeLaterDispatcher$Future.run()V (91 bytes) @ 0x00007f169fd6f4d4 [0x00007f169fd6f3c0+0x114]
v  ~StubRoutines::call_stub
j  com.sun.glass.ui.gtk.GtkApplication._runLoop(Ljava/lang/Runnable;Z)V+0
j  com.sun.glass.ui.gtk.GtkApplication.lambda$null$208(Ljava/lang/Runnable;Z)V+7
j  com.sun.glass.ui.gtk.GtkApplication$$Lambda$1976.run()V+12
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

Comments
In my understanding problem is when libglib-2.0.so.0 is loaded into global scope including libgobject and libgmodule. In this case GStreamer will call into libglib-2.0.so and not into glib-lite.so, since symbols names are same between libglib-2.0.so and glib-lite.so. As I mentioned early I think libdbm64.so can cause this issue, since it looks like it has dependency on libglib-2.0 and loads it to global scope. Looks like this libdbm64.so file is part of IDE. Assuming it is part of IDE can you check with ldd command if it has dependency on glib and if yes can you find out how it is being loaded by IDE? 10783: add /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/bin/libdbm64.so [0] to global scope 10783: 10783: add /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 [0] to global scope 132400: add /lib64/libgobject-2.0.so.0 [0] to global scope 132400: 132400: add /lib64/libglib-2.0.so.0 [0] to global scope 132400: 132400: add /lib64/libgmodule-2.0.so.0 [0] to global scope
01-08-2019

Hi Alexander, Thank you, yes I see that libuuid does not depend on glib, but what the logs show looks confusing or I can't read it correctly. I've attached ld_log.txt.132400 which lists glib-lite.so. It's the only log file listing glib-lite when IDEA was run on RHEL 7.3 and crashed. The log doesn't show that glib-lite was loaded into global section. Still the crash happened. So, this probably means there can be some other problem with glib-lite?
22-07-2019

I do not think it is libuuid.so, since it does not have dependency on glib. ldd /lib/x86_64-linux-gnu/libuuid.so.1 linux-vdso.so.1 => (0x00007fffc2f3d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbc5a370000) /lib64/ld-linux-x86-64.so.2 (0x00007fbc5a93f000) Probably /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/bin/libdbm64.so has dependency on glib. You can check it with ldd command. Hard to tell why it does not crash even if glib is being loaded to global scope. I did notice it as well that on some system it crashes and on some it does not. It might depends on which symbol gets loaded first glib or our glib-lite.
28-06-2019

Alexander, A standalone JFX app does not crash with JDK8 on RHEL 7.3. And the LD logs do not show glib loading into global scope. Then, when I simply run IDEA on my local Ubuntu 18.04 (where I do not reproduce the crash), I can find the following log output (attached ld_log.txt.10783): 10783: object=/lib/x86_64-linux-gnu/libuuid.so.1 [0] 10783: scope 6: /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/bin/libdbm64.so /usr/lib/x86_64-linux-gnu/libglib-2.0 .so.0 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 /usr/lib/x86_64-linux-gnu/libdbusmenu-glib.so.4 /usr/lib/x86_64-linux-gnu/libgobject-2.0 .so.0 /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libpcre.so.3 /lib/x86_64-linux-gnu/libpthread.so.0 /usr/lib/x86_64-linux-gnu /libgmodule-2.0.so.0 /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libselinux.so.1 /lib/x86_64-linux-gnu/libresolv.so.2 /lib/x86 _64-linux-gnu/libmount.so.1 /usr/lib/x86_64-linux-gnu/libffi.so.6 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_ 64-linux-gnu/libblkid.so.1 /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libuuid.so.1 10783: 10783: /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/jre64/lib/amd64/libjava.so: error: symbol lookup error: undefin ed symbol: Java_sun_awt_X11_XlibWrapper_XTranslateCoordinates (fatal) 10783: /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/bin/libdbm64.so: error: symbol lookup error: undefined symbol: JNI_OnLoad (fatal) 10783: /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/jre64/lib/amd64/libzip.so: error: symbol lookup error: undefine d symbol: Java_sun_awt_X11_XlibWrapper_XTranslateCoordinates (fatal) 10783: /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/jre64/lib/amd64/libnio.so: error: symbol lookup error: undefine d symbol: Java_sun_awt_X11_XlibWrapper_XTranslateCoordinates (fatal) 10783: 10783: add /home/tav/Downloads/ideaIU-191.8026.1/idea-IU-191.8026.1/bin/libdbm64.so [0] to global scope 10783: 10783: add /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 [0] to global scope 10783: 10783: add /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 [0] to global scope 10783: 10783: add /usr/lib/x86_64-linux-gnu/libdbusmenu-glib.so.4 [0] to global scope 10783: 10783: add /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 [0] to global scope 10783: 10783: add /lib/x86_64-linux-gnu/libpcre.so.3 [0] to global scope 10783: 10783: add /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 [0] to global scope 10783: 10783: add /lib/x86_64-linux-gnu/libz.so.1 [0] to global scope 10783: 10783: add /lib/x86_64-linux-gnu/libselinux.so.1 [0] to global scope 10783: 10783: add /lib/x86_64-linux-gnu/libresolv.so.2 [0] to global scope 10783: 10783: add /lib/x86_64-linux-gnu/libmount.so.1 [0] to global scope 10783: 10783: add /usr/lib/x86_64-linux-gnu/libffi.so.6 [0] to global scope 10783: 10783: add /lib/x86_64-linux-gnu/libblkid.so.1 [0] to global scope 10783: 10783: add /lib/x86_64-linux-gnu/libuuid.so.1 [0] to global scope Am I reading it correctly and it's libuuid.so which loads glib into global scope? Also, why it doesn't crash on my local Ubuntu then? No symbols conflict?
26-06-2019

IDEA will need to load glib or library which loads glib into local scope. Use RTLD_LOCAL with dlopen() instead of RTLD_GLOBAL.
19-06-2019

Kevin, Alexander, thank you, yes it's run with IDEA. I'll provide the logs later. If your assumption is confirmed, what are the recommendations to resolve the conflict?
19-06-2019

Does this issue reproduces when running test application via terminal with java -jar Some.jar? Based on crash it looks like test application run via IDE. With JDK-8199527 we using our version of GLib (glib-lite.so) which will conflict if application (process) which loads JavaFX media has or will load system libglib-2.0.so into global scope. To check this you can set following environment variables before running test app: export LD_DEBUG=scopes export LD_DEBUG_OUTPUT=ld_log.txt ld_logs.txt will show scopes of loaded libraries.
14-06-2019

[~ant] What version of the libav packages do you have installed on your system?
14-06-2019