compose-multiplatform: free(): invalid pointer - when running on Linux

Trying to run almost any Compose app (including, for instance, the codeviewer sample) results in the JVM crashing with a free(): invalid pointer error. This was observed on a fresh install of Ubuntu 20.04 in a virtual machine, but is presumably true of all Ubuntus and a wide variety of other distributions and hardware configurations. Interestingly, @olonho tested on his physical Ubuntu 20.04 machine and did not encounter this failure, so the percentage of users impacted is not yet known. This appears to be a regression introduced between 0.3.0-build154 and 0.3.0-rc1.

For more details, I know @theapache64 encountered the same error in https://github.com/JetBrains/compose-jb/issues/275#issuecomment-782896658 and posted a full backtrace dump. His dump also includes a shader compile error, which I do not see when running the codeviewer app, so is presumably unrelated.

Questions for @theapache64 : (1) More just curiosity than anything, but also looking for patterns, are you running on a VM or physical hardware? (2) When running the codeviewer sample for instance, but I don’t get nearly the same amount of debug info as you and I don’t seem to be getting a hs_err_pid file. How did you get your full backtrace dump?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 27 (23 by maintainers)

Commits related to this issue

Most upvoted comments

Just

./gradlew -stop
export SKIKO_RENDER_API=SOFTWARE
./gradlew run

Could you please try with

 dependencies {
     implementation(compose.desktop.currentOs)
+     implementation("org.jetbrains.skiko:skiko-jvm-runtime-linux-x64:0.2.16")
+     implementation("org.jetbrains.skiko:skiko-jvm:0.2.16")
 }

as fix in 0.2.15 incomplete.

Guess there are two distinct issues, one encountered by @jimgoog which is not fixed by switch to software rendering, and other seen by @alialbaali and @theapache64 which is fixed.

Anything is possible, although I would expect that if you were encountering the error with OPENGL and then switching to SOFTWARE fixed the issue, it would be a little surprising if that switch fixed it only in a few situations. But to test that theory, you could try running the codeviewer example from master both with the SKIKO_RENDER_API set to OPENGL and SOFTWARE and see if the complexity of the sample changes anything.

Ok, seems OpenGL cannot be used by Skia somehow.