Open ThingUroboros opened 5 months ago
I'm running into the same issue. Not sure if this is related to the homebrew issue https://github.com/Homebrew/homebrew-core/issues/150824
For the record, we do not use JNI. So I am not sure what we can do about this... Sorry about that!
Sorry @arnaudroques. I saw the illegal instruction and assumed that it's some JNI issue. However, after a little bit of investigation, it seem like the problem is in the Apple SDK homebrew is using to compile JDK. It's also affecting other Java applications.
Do you think it might be related to Swing? There is light Swing Windows integrated in PlantUML and if needed, we could build a temporary version without this Swing Window, just for Mac. Would that help?
Thanks! I'm not familiar with java GUI libraries. I don't think the problem is in the Swing window. Given this call stack, I assume that the error actually happened during the process of rendering images and unrelated to the Swing window. If you think it might be related to Swing, and it is easy to build on your end, I'm happy to test.
In addition, I tested a different JDK (Amazon Corretto 21) and managed to get plantuml run properly.
C [libawt.dylib+0x2efc8] fillAAPgram+0x3e0
C [libawt.dylib+0x2e7a8] Java_sun_java2d_loops_MaskFill_FillAAPgram+0x320
j sun.java2d.loops.MaskFill.FillAAPgram(Lsun/java2d/SunGraphics2D;Lsun/java2d/SurfaceData;Ljava/awt/Composite;DDDDDD)V+0 java.desktop@21.0.1
j sun.java2d.pipe.AlphaColorPipe.fillParallelogram(Lsun/java2d/SunGraphics2D;DDDDDDDDDD)V+25 java.desktop@21.0.1
j sun.java2d.pipe.PixelToParallelogramConverter.drawGeneralLine(Lsun/java2d/SunGraphics2D;DDDD)Z+634 java.desktop@21.0.1
j sun.java2d.pipe.PixelToParallelogramConverter.drawLine(Lsun/java2d/SunGraphics2D;IIII)V+12 java.desktop@21.0.1
j sun.java2d.SunGraphics2D.drawLine(IIII)V+10 java.desktop@21.0.1
j net.sourceforge.plantuml.klimt.drawing.g2d.DriverTextG2d.printSingleText(Ljava/awt/Graphics2D;Lnet/sourceforge/plantuml/klimt/font/FontConfiguration;Ljava/lang/String;DDLnet/sourceforge/plantuml/klimt/color/ColorMapper;)D+399
j net.sourceforge.plantuml.klimt.drawing.g2d.DriverTextG2d.draw(Lnet/sourceforge/plantuml/klimt/shape/UText;DDLnet/sourceforge/plantuml/klimt/color/ColorMapper;Lnet/sourceforge/plantuml/klimt/UParam;Ljava/awt/Graphics2D;)V+101
j net.sourceforge.plantuml.klimt.drawing.g2d.DriverTextG2d.draw(Lnet/sourceforge/plantuml/klimt/UShape;DDLnet/sourceforge/plantuml/klimt/color/ColorMapper;Lnet/sourceforge/plantuml/klimt/UParam;Ljava/lang/Object;)V+17
j net.sourceforge.plantuml.klimt.drawing.AbstractUGraphic.draw(Lnet/sourceforge/plantuml/klimt/UShape;)V+157
j net.sourceforge.plantuml.klimt.shape.TileText.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+189
j net.sourceforge.plantuml.klimt.shape.SingleLine.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+84
j net.sourceforge.plantuml.klimt.shape.TextBlockRaw.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+53
j net.sourceforge.plantuml.klimt.shape.TextBlockVertical2.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+151
j net.sourceforge.plantuml.klimt.shape.TextBlockVertical2.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+151
j net.sourceforge.plantuml.klimt.shape.TextBlockVertical2.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+151
j net.sourceforge.plantuml.klimt.shape.TextBlockMarged.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+57
j net.sourceforge.plantuml.klimt.shape.TextBlockUtils$3.drawU(Lnet/sourceforge/plantuml/klimt/drawing/UGraphic;)V+5
j net.atmp.ImageBuilder.writeImageInternal(Ljava/io/OutputStream;Lnet/sourceforge/plantuml/anim/Animation;)Lnet/sourceforge/plantuml/core/ImageData;+227
j net.atmp.ImageBuilder.write(Ljava/io/OutputStream;)Lnet/sourceforge/plantuml/core/ImageData;+150
j net.sourceforge.plantuml.PlainDiagram.exportDiagramNow(Ljava/io/OutputStream;ILnet/sourceforge/plantuml/FileFormatOption;)Lnet/sourceforge/plantuml/core/ImageData;+18
j net.sourceforge.plantuml.error.PSystemError.exportDiagramNow(Ljava/io/OutputStream;ILnet/sourceforge/plantuml/FileFormatOption;)Lnet/sourceforge/plantuml/core/ImageData;+74
j net.sourceforge.plantuml.AbstractPSystem.exportDiagram(Ljava/io/OutputStream;ILnet/sourceforge/plantuml/FileFormatOption;)Lnet/sourceforge/plantuml/core/ImageData;+9
j net.sourceforge.plantuml.PSystemUtils.exportDiagramsDefault(Lnet/sourceforge/plantuml/core/Diagram;Lnet/sourceforge/plantuml/file/SuggestedFile;Lnet/sourceforge/plantuml/FileFormatOption;)Ljava/util/List;+63
j net.sourceforge.plantuml.PSystemUtils.exportDiagrams(Lnet/sourceforge/plantuml/core/Diagram;Lnet/sourceforge/plantuml/file/SuggestedFile;Lnet/sourceforge/plantuml/FileFormatOption;Z)Ljava/util/List;+166
j net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages()Ljava/util/List;+236
j net.sourceforge.plantuml.Run.manageFileInternal(Ljava/io/File;Lnet/sourceforge/plantuml/Option;Lnet/sourceforge/plantuml/ErrorStatus;)V+329
j net.sourceforge.plantuml.Run.processArgs(Lnet/sourceforge/plantuml/Option;Lnet/sourceforge/plantuml/ErrorStatus;)V+211
j net.sourceforge.plantuml.Run.manageAllFiles(Lnet/sourceforge/plantuml/Option;Lnet/sourceforge/plantuml/ErrorStatus;)V+56
j net.sourceforge.plantuml.Run.main([Ljava/lang/String;)V+624
Is there a known workaround?
You can use a different JDK (I tried Amazon Corretto 21, because they are building against a different apple SDK). An alternative approach is to run the plantuml server locally in docker https://github.com/plantuml/plantuml-server#how-to-run-the-server-with-docker.
This works for me
docker run --rm -v .:/source -v .:/target plantuml/plantuml -tpng '/source/*.puml'
The OpenJDK Bug was fixed in November 2023 by commit 940f67c1.
This fix is not in Homebrew (openjdk version "21.0.2" 2024-01-16) as of today. :(
To Reproduce Steps to reproduce the behavior:
Launch the application on Mac OS Sonoma 14.1.1 on a MacBook Pro. Execute the command plantUML x.puml. During the application's execution, the above-mentioned warning appears. Subsequently, the application crashes with a SIGILL error and the provided message. This updated section outlines the specific command that triggers the issue within the application.
hs_err_pid12357.log