Community
Participate
Working Groups
The problem is related to how SWT extracts libraries when they are missing. If multiple processes are started quickly when libraries are missing, the following happens: 1) Process A notices that library is missing and starts extracting it 2) Process B finds incomplete library and loads it 3) JVM crashes with SIGBUS - BUS_ADRERR in NativeLibrary.load() I'll prepare a patch for this: use a temp file and rename it when fully extracted.
New Gerrit change created: https://git.eclipse.org/r/141885
Before the patch, following problems happened: ----------------------------------- On Linux - JVM will crash like this ----------------------------------- siginfo: si_signo: 7 (SIGBUS), si_code: 2 (BUS_ADRERR), si_addr: 0x00007ff852a28428 Stack: [0x00007ff8dae89000,0x00007ff8db08a000], sp=0x00007ff8db085bd8, free space=2034k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ld-linux-x86-64.so.2+0x1dc94] C [ld-linux-x86-64.so.2+0x8c27] 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 org.eclipse.swt.internal.Library.load(Ljava/lang/String;Ljava/lang/StringBuilder;)Z+12 j org.eclipse.swt.internal.Library.loadLibrary(Ljava/lang/String;Z)V+230 j org.eclipse.swt.internal.Library.loadLibrary(Ljava/lang/String;)V+2 j org.eclipse.swt.internal.cairo.Cairo.<clinit>()V+2 ... ----------------------------------- On Windows - SWT exception ----------------------------------- Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: <snip>\swt-win32-4926r17.dll: The process cannot access the file because it is being used by another process Can't load library: <snip>\swt-win32.dll no swt-win32-4926r17 in java.library.path: [<snip>] no swt-win32 in java.library.path: [<snip>] ----------------------------------- On macOS - SWT exception ----------------------------------- Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: <snip>/libswt-pi-cocoa-4926r17.jnilib: dlopen(<snip>/libswt-pi-cocoa-4926r17.jnilib, 1): no suitable image found. Did find: <snip>/libswt-pi-cocoa-4926r17.jnilib: truncated mach-o error: segment __TEXT extends to 155648 which is past end of file 86016 <snip>/libswt-pi-cocoa-4926r17.jnilib: truncated mach-o error: segment __TEXT extends to 155648 which is past end of file 86016 Can't load library: <snip>/libswt-pi-cocoa.jnilib no swt-pi-cocoa-4926r17 in java.library.path: [<snip>] no swt-pi-cocoa in java.library.path: [<snip>]
Gerrit change https://git.eclipse.org/r/141885 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=2f184c152fc3529bb638ee788f03292a8326a23c
New Gerrit change created: https://git.eclipse.org/r/142470
New Gerrit change created: https://git.eclipse.org/r/142471
Gerrit change https://git.eclipse.org/r/142470 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d22c98cde19b6176542ea30cc1df3269b7c55ca7
Gerrit change https://git.eclipse.org/r/142471 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=de7e7c9387313985c1f07d2bbd874278fcebce50
In master now.
Verified in I20190612-0115.