SkiaSharp: [BUG] Random unit test crashes in dev/update-skia?
I am trying to run the units tests in the dev/update-skia
branch, so I can continue working on PRs, but my dotnet test
run always fails randomly, with native exceptions (access violations). Sometimes a dozens of tests succeed before crashing, sometimes upto abour 100, so this smells like a multi threading issues. I have 32 hyperthreads (AMD 3950x) all running at the same time, so this might reveal race conditions.
Is this a known issue?
I have build both the native and managed code successfully, on Windows 10, using the latest version of VS2019.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 16 (16 by maintainers)
Fixed in 1590d7e1e81581e1c4ab1252b7d3dcb563d1a8e1 and https://github.com/mono/skia/commit/47de7965be076311e824589b0464a4e1e08d54eb
I think I found it…
m68: (https://github.com/mono/skia/blob/xamarin-mobile-bindings/src/c/sk_types_priv.h#L193) ref on the way in
m80: (https://github.com/mono/skia/blob/dev/update-m80/src/c/sk_types_priv.h#L210) NO REF on the way in
Let me fix that. What is happening is that when I get the struct from native code, the cs is incremented. When it reaches managed code, it is decremented. So no problem. However, when it goes back into the native code, it is not incremented, so when the native code cleans up, it gets decremented.