phronmophobic/membrane-skija-example

Segfault when trying to run the example on Linux

Opened this issue · 2 comments

wodin commented

I cloned the repository and ran clojure -M -m com.phronemophobic.membrane-skija-example which resulted in the following:

membrane-skija-example$ clojure -M -m com.phronemophobic.membrane-skija-example
Downloading: org/lwjgl/lwjgl-glfw/3.2.3/lwjgl-glfw-3.2.3.pom from central
Downloading: org/lwjgl/lwjgl-opengl/3.2.3/lwjgl-opengl-3.2.3.pom from central
Downloading: org/lwjgl/lwjgl/3.2.3/lwjgl-3.2.3.pom from central
Downloading: com/phronemophobic/membrane/0.9.18-beta/membrane-0.9.18-beta.pom from clojars
Downloading: org/jetbrains/skija/skija-linux/0.6.45/skija-linux-0.6.45.pom from space-maven
Downloading: org/clojure/core.async/0.4.490/core.async-0.4.490.pom from central
Downloading: org/apache/commons/commons-text/1.8/commons-text-1.8.pom from central
Downloading: net/java/dev/jna/jna/5.2.0/jna-5.2.0.pom from central
Downloading: org/jetbrains/skija/skija-macos/0.6.45/skija-macos-0.6.45.pom from space-maven
Downloading: com/rpl/specter/1.1.3/specter-1.1.3.pom from clojars
Downloading: net/n01se/clojure-jna/1.0.0/clojure-jna-1.0.0.pom from clojars
Downloading: org/jetbrains/skija/skija-shared/0.6.45/skija-shared-0.6.45.pom from space-maven
Downloading: org/clojure/tools.analyzer.jvm/0.7.2/tools.analyzer.jvm-0.7.2.pom from central
Downloading: org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.pom from central
Downloading: org/apache/commons/commons-text/1.8/commons-text-1.8.jar from central
Downloading: org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar from central
Downloading: org/lwjgl/lwjgl-opengl/3.2.3/lwjgl-opengl-3.2.3.jar from central
Downloading: org/lwjgl/lwjgl/3.2.3/lwjgl-3.2.3-natives-macos.jar from central
Downloading: org/clojure/tools.analyzer.jvm/0.7.2/tools.analyzer.jvm-0.7.2.jar from central
Downloading: org/lwjgl/lwjgl/3.2.3/lwjgl-3.2.3.jar from central
Downloading: org/lwjgl/lwjgl-opengl/3.2.3/lwjgl-opengl-3.2.3-natives-linux.jar from central
Downloading: net/java/dev/jna/jna/5.2.0/jna-5.2.0.jar from central
Downloading: org/lwjgl/lwjgl-opengl/3.2.3/lwjgl-opengl-3.2.3-natives-macos.jar from central
Downloading: org/clojure/tools.reader/1.0.0-beta4/tools.reader-1.0.0-beta4.jar from central
Downloading: org/lwjgl/lwjgl-glfw/3.2.3/lwjgl-glfw-3.2.3-natives-macos.jar from central
Downloading: org/lwjgl/lwjgl-glfw/3.2.3/lwjgl-glfw-3.2.3-natives-linux.jar from central
Downloading: org/lwjgl/lwjgl/3.2.3/lwjgl-3.2.3-natives-linux.jar from central
Downloading: org/lwjgl/lwjgl-glfw/3.2.3/lwjgl-glfw-3.2.3.jar from central
Downloading: org/clojure/core.async/0.4.490/core.async-0.4.490.jar from central
Downloading: net/n01se/clojure-jna/1.0.0/clojure-jna-1.0.0.jar from clojars
Downloading: org/jetbrains/skija/skija-shared/0.6.45/skija-shared-0.6.45.jar from space-maven
Downloading: com/rpl/specter/1.1.3/specter-1.1.3.jar from clojars
Downloading: org/jetbrains/skija/skija-linux/0.6.45/skija-linux-0.6.45.jar from space-maven
Downloading: org/jetbrains/skija/skija-macos/0.6.45/skija-macos-0.6.45.jar from space-maven
Downloading: com/phronemophobic/membrane/0.9.18-beta/membrane-0.9.18-beta.jar from clojars
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fe63eeab1ad, pid=982724, tid=983105
#
# JRE version: OpenJDK Runtime Environment (11.0.19+7) (build 11.0.19+7-post-Ubuntu-0ubuntu122.04.1)
# Java VM: OpenJDK 64-Bit Server VM (11.0.19+7-post-Ubuntu-0ubuntu122.04.1, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libskija.so+0xab1ad]  Java_org_jetbrains_skija_Font__1nMakeTypefaceSize+0xd
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /tmp/membrane-skija-example/core.982724)
#
# An error report file with more information is saved as:
# /tmp/membrane-skija-example/hs_err_pid982724.log
#
# If you would like to submit a bug report, please visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-lts
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)

Hi @wodin , I can try to look into this later this week. I suspect the issue can probably be fixed just by updating dependencies (also, the skija library has since moved to a new repository).

If you're interested, you can also try the skija example in the main membrane library which will probably be more update to date:

git clone https://github.com/phronmophobic/membrane.git
cd membrane
clojure -X:deps prep
clojure -M:skija -m membrane.skija

The skia and java2d backend are much better supported than the skija backend. Do you have a particular reason for preferring the skija backend? Mostly just curious.

wodin commented

Not really :) I assumed that the way to use skia was via skija.

I'll try the other backends