Community
Participate
Working Groups
Created attachment 287269 [details] Example of broken SVG that triggers the crash When loading a broken SVG image, JVM would crash. This is a bug in Linux's librsvg, see: https://gitlab.gnome.org/GNOME/librsvg/-/issues/405 The following versions of the library are affected: 2.44.9 ... 2.44.11 inclusive 2.45.0 ... 2.45.4 inclusive The crash is triggered by SWT, where it passes 0 to 'error' parameter of 'gdk_pixbuf_loader_write()'. When it happens, java's crash log will be like: -------- Stack: [0x00007fec8f5f1000,0x00007fec8f7f2000], sp=0x00007fec8f7efdc0, free space=2043k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) C [libpixbufloader-svg.so+0x12c0] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.eclipse.swt.internal.gtk.GDK.gdk_pixbuf_loader_write(JJI[J)Z+0 j org.eclipse.swt.graphics.ImageLoader.getImageDataArrayFromStream(Ljava/io/InputStream;)[Lorg/eclipse/swt/graphics/ImageData;+102 j org.eclipse.swt.graphics.ImageLoader.load(Ljava/io/InputStream;)[Lorg/eclipse/swt/graphics/ImageData;+14 j org.eclipse.swt.graphics.ImageDataLoader.load(Ljava/io/InputStream;)[Lorg/eclipse/swt/graphics/ImageData;+8 <...> siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 --------
Examples of affected Linux: Debian GNU/Linux 10 (buster) MX 19.4 patito feo Progress Linux 5+ (engywuck-backports) Ubuntu 19.04
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189784
@Alexandr Miloslavskiy: I'm working on a fix for this, but I can't test SVG files right now. Do you have a snippet I can use to test? I was reading the issue you linked and it appears that they fixed it? Not too sure, but a snippet would help in determining if its still an issue now.
Sorry for a late reply. 'librsvg' versions with the bug are: 2.44.9 ... 2.44.11 inclusive 2.45.0 ... 2.45.4 inclusive So yes, the bug is already fixed and only some older Linux are affected. As for the snippet, it's trivial, you just need to load the broken SVG file from disk: InputStream fileStream = Snippet.class.getResourceAsStream("broken.svg"); Image image = new Image (display, fileStream); You can use the example image I attached to this Bug.
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/189784 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=969c9f1e842964e6370172c833c1f55447a26f40
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/190383
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/190383 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=1a408f0b8407fac42e133fbb7784a17cdfff8621
Verified in I20220216-1800.