question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessing certain skia properties crashes app

See original GitHub issue

Any call to Canvas.localToDeviceAsMatrix33 causes the app to core dump. This is very easy to reproduce. Simply add the following line to onRender within ClocksJvm in the SkiaJvmSample. The same is true for calls to Typeface.fontFamilyName and Typeface.fontFamilyNames.

// ...

override fun onRender(canvas: Canvas, width: Int, height: Int, currentTimestamp: Long) {
    canvas.localToDeviceAsMatrix33 <--- Crash
    Font(Typeface.makeFromName("Courier", FontStyle(300, 5, FontSlant.UPRIGHT)), 13f).typefaceOrDefault.familyNames <--- Crash
    // ...   
}

// ...

See attached core dump for more details.

hs_err_pid10301.log

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
olonhocommented, Dec 20, 2021

Typo, can be fixed like this

diff --git a/skiko/src/commonMain/kotlin/org/jetbrains/skia/Canvas.kt b/skiko/src/commonMain/kotlin/org/jetbrains/skia/Canvas.kt
index 3e9d6713..5f3aaefb 100644
--- a/skiko/src/commonMain/kotlin/org/jetbrains/skia/Canvas.kt
+++ b/skiko/src/commonMain/kotlin/org/jetbrains/skia/Canvas.kt
@@ -1630,7 +1630,7 @@ private external fun _nDrawPaint(ptr: NativePointer, paintPtr: NativePointer)
 private external fun _nSetMatrix(ptr: NativePointer, matrix: InteropPointer)
 
 @ExternalSymbolName("org_jetbrains_skia_Canvas__1nGetLocalToDevice")
-private external fun _nGetLocalToDevice(ptr: NativePointer, resultFloats: InteropPointer): FloatArray
+private external fun _nGetLocalToDevice(ptr: NativePointer, resultFloats: InteropPointer)
 
 @ExternalSymbolName("org_jetbrains_skia_Canvas__1nResetMatrix")
 private external fun _nResetMatrix(ptr: NativePointer)
0reactions
olonhocommented, Dec 27, 2021

Shall be fixed with Skiko 0.7.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Android] Crash in release · Issue #357 · Shopify/react-native ...
FATAL EXCEPTION: main Caused by: java.lang.NoSuchMethodError: no non-static method "Lcom/shopify/reactnative/skia/PlatformContext;.
Read more >
my app crashes whenever i click on this fragment
Your app is crashing because a ClassCastException is being thrown within your GalleryFragment on line 85. According to the logging, ...
Read more >
79792 - Skia rev 1125 causes Linux 64-bit GPU crashes in DRT
Issue 79792: Skia rev 1125 causes Linux 64-bit GPU crashes in DRT ... It appears as though the Skia roll from 1117-1140 (http://src.chromium.org/viewvc/chrome?...
Read more >
Clicking on Printer Properties inside Office App Freezes then ...
When 'Printer Properties' is clicked, the application freezes and then crashes. As a work-around, I instruct my customers to enter 'Devices ...
Read more >
Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found