Closed michaldobrodenka closed 4 years ago
In the problem output it seems that HarfBuzzSharp.Font.Shape jumps into DynamicMobileVLCKit?!?
Using text search I discovered HarfBuzz also in DynamicMobileVLCKit, maybe some version mismatch?
Hi @michaldobrodenka,
Wow thats weird... Yes Harfbuzz
is included in DynamicMobileVLCKit
.
Can you provide a sample repo so I can reproduce?
Hi mfkl,
I've created minimalistic sample. On simulator it writes "Hello World!" on screen. On real device crash after I added VideoLAN.libVLC.iOS package. Only adding package is enough, I even don't have to use it:
2018-09-11 16:33:22.991 HarfBuzzDemo.iOS[1032:554401] critical: Stacktrace:
2018-09-11 16:33:22.991 HarfBuzzDemo.iOS[1032:554401] critical: at <unknown> <0xffffffff>
2018-09-11 16:33:22.991 HarfBuzzDemo.iOS[1032:554401] critical: at (wrapper managed-to-native) HarfBuzzSharp.HarfBuzzApi.hb_shape (intptr,intptr,intptr,uint) <0x00007>
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at HarfBuzzSharp.Font.Shape (HarfBuzzSharp.Buffer,HarfBuzzSharp.Feature[]) [0x00027] in <6749cfd53a6b42819d78f7b3330ebbe7#C1EFC438-5227-9BB8-19DF-B1DBA840BF1C>:0
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at SkiaSharp.HarfBuzz.SKShaper.Shape (string,single,single,SkiaSharp.SKPaint) [0x0005e] in <7f99c9f4307c45d4819055684265e1c1#C1EFC438-5227-9BB8-19DF-B1DBA840BF1C>:0
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at ClassLibrary1.PaintClass.SayHello (SkiaSharp.SKCanvas) [0x00059] in /Users/mixal11/Downloads/HarfBuzzDemo/ClassLibrary1/PaintClass.cs:42
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at HarfBuzzDemo.iOS.ViewController.PaintSurface (object,SkiaSharp.Views.iOS.SKPaintSurfaceEventArgs) [0x00001] in /Users/mixal11/Downloads/HarfBuzzDemo/HarfBuzzDemo.iOS/ViewController.cs:29
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at SkiaSharp.Views.iOS.SKCanvasView.DrawInSurface (SkiaSharp.SKSurface,SkiaSharp.SKImageInfo) [0x00013] in <bf39c54c7e114c18891138c2778b079f#C1EFC438-5227-9BB8-19DF-B1DBA840BF1C>:0
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at SkiaSharp.Views.iOS.SKCanvasView.Draw (CoreGraphics.CGRect) [0x0004b] in <bf39c54c7e114c18891138c2778b079f#C1EFC438-5227-9BB8-19DF-B1DBA840BF1C>:0
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <287924bfcd764fda9061b733b0262652#C1EFC438-5227-9BB8-19DF-B1DBA840BF1C>:0
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at <unknown> <0xffffffff>
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00007>
2018-09-11 16:33:22.992 HarfBuzzDemo.iOS[1032:554401] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/UIKit/UIApplication.cs:79
2018-09-11 16:33:22.993 HarfBuzzDemo.iOS[1032:554401] critical: at UIKit.UIApplication.Main (string[],string,string) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/UIKit/UIApplication.cs:63
2018-09-11 16:33:22.993 HarfBuzzDemo.iOS[1032:554401] critical: at HarfBuzzDemo.iOS.Application.Main (string[]) [0x00001] in /Users/mixal11/Downloads/HarfBuzzDemo/HarfBuzzDemo.iOS/Main.cs:12
2018-09-11 16:33:22.993 HarfBuzzDemo.iOS[1032:554401] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <287924bfcd764fda9061b733b0262652#C1EFC438-5227-9BB8-19DF-B1DBA840BF1C>:0
2018-09-11 16:33:22.993 HarfBuzzDemo.iOS[1032:554401] critical:
Native stacktrace:
2018-09-11 16:33:23.003 HarfBuzzDemo.iOS[1032:554401] critical: 0 HarfBuzzDemo.iOS 0x0000000100d4f3fc mono_handle_native_crash + 224
2018-09-11 16:33:23.003 HarfBuzzDemo.iOS[1032:554401] critical: 1 HarfBuzzDemo.iOS 0x0000000100d5adf4 mono_sigsegv_signal_handler + 316
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 2 libsystem_platform.dylib 0x0000000182f14b58 _sigtramp + 52
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 3 DynamicMobileVLCKit 0x00000001019d97b8 hb_shape_plan_create_cached2 + 448
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 4 DynamicMobileVLCKit 0x00000001019d8b90 hb_shape + 60
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 5 HarfBuzzDemo.iOS 0x0000000100d0c038 wrapper_managed_to_native_HarfBuzzSharp_HarfBuzzApi_hb_shape_intptr_intptr_intptr_uint + 232
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 6 HarfBuzzDemo.iOS 0x0000000100d02eec HarfBuzzSharp_Font_Shape_HarfBuzzSharp_Buffer_HarfBuzzSharp_Feature__ + 380
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 7 HarfBuzzDemo.iOS 0x0000000100cf46ec SkiaSharp_HarfBuzz_SKShaper_Shape_string_single_single_SkiaSharp_SKPaint + 764
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 8 HarfBuzzDemo.iOS 0x0000000100cce94c ClassLibrary1_PaintClass_SayHello_SkiaSharp_SKCanvas + 828
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 9 HarfBuzzDemo.iOS 0x0000000100aa912c HarfBuzzDemo_iOS_ViewController_PaintSurface_object_SkiaSharp_Views_iOS_SKPaintSurfaceEventArgs + 188
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 10 HarfBuzzDemo.iOS 0x0000000100c6d7b4 SkiaSharp_Views_iOS_SKCanvasView_DrawInSurface_SkiaSharp_SKSurface_SkiaSharp_SKImageInfo + 308
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 11 HarfBuzzDemo.iOS 0x0000000100c6cf80 SkiaSharp_Views_iOS_SKCanvasView_Draw_CoreGraphics_CGRect + 1104
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 12 HarfBuzzDemo.iOS 0x0000000100bd2d08 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 248
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 13 HarfBuzzDemo.iOS 0x0000000100d5deb4 mono_jit_runtime_invoke + 904
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 14 HarfBuzzDemo.iOS 0x0000000100dc5c70 mono_runtime_invoke_checked + 148
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 15 HarfBuzzDemo.iOS 0x0000000100dc92a0 mono_runtime_invoke + 84
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 16 HarfBuzzDemo.iOS 0x0000000100aa651c _ZL31native_to_managed_trampoline_11P11objc_objectP13objc_selectorPP11_MonoMethod6CGRectj + 272
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 17 HarfBuzzDemo.iOS 0x0000000100aa6400 -[SKCanvasView drawRect:] + 92
2018-09-11 16:33:23.004 HarfBuzzDemo.iOS[1032:554401] critical: 18 UIKit 0x000000018cf56f60 <redacted> + 536
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 19 QuartzCore 0x000000018747ba10 <redacted> + 296
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 20 QuartzCore 0x0000000187372274 <redacted> + 256
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 21 QuartzCore 0x00000001874817d0 <redacted> + 52
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 22 QuartzCore 0x000000018747b43c <redacted> + 1684
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 23 QuartzCore 0x00000001873ec78c <redacted> + 516
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 24 QuartzCore 0x00000001874141b0 <redacted> + 580
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 25 UIKit 0x000000018d2f0680 <redacted> + 140
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 26 CoreFoundation 0x000000018329b2bc <redacted> + 20
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 27 CoreFoundation 0x000000018329aa7c <redacted> + 264
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 28 CoreFoundation 0x00000001832987b0 <redacted> + 1224
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 29 CoreFoundation 0x00000001831b8da8 CFRunLoopRunSpecific + 552
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 30 GraphicsServices 0x000000018519e020 GSEventRunModal + 100
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 31 UIKit 0x000000018d1d8758 UIApplicationMain + 236
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 32 HarfBuzzDemo.iOS 0x0000000100c4bc44 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 324
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 33 HarfBuzzDemo.iOS 0x0000000100c325ac UIKit_UIApplication_Main_string___intptr_intptr + 44
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 34 HarfBuzzDemo.iOS 0x0000000100c3256c UIKit_UIApplication_Main_string___string_string + 172
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 35 HarfBuzzDemo.iOS 0x0000000100aa8710 HarfBuzzDemo_iOS_Application_Main_string__ + 128
2018-09-11 16:33:23.005 HarfBuzzDemo.iOS[1032:554401] critical: 36 HarfBuzzDemo.iOS 0x0000000100bd2d08 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 248
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical: 37 HarfBuzzDemo.iOS 0x0000000100d5deb4 mono_jit_runtime_invoke + 904
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical: 38 HarfBuzzDemo.iOS 0x0000000100dc5c70 mono_runtime_invoke_checked + 148
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical: 39 HarfBuzzDemo.iOS 0x0000000100dcaf60 mono_runtime_exec_main_checked + 120
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical: 40 HarfBuzzDemo.iOS 0x0000000100d45920 mono_jit_exec + 272
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical: 41 HarfBuzzDemo.iOS 0x0000000100e65f90 xamarin_main + 2220
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical: 42 HarfBuzzDemo.iOS 0x0000000100aa8614 main + 96
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical: 43 libdyld.dylib 0x0000000182c49fc0 <redacted> + 4
2018-09-11 16:33:23.006 HarfBuzzDemo.iOS[1032:554401] critical:
Have you tried different linker options?
No :( Will try first thing in the morning. My iPhone test device just left :)
Also, you reference SkiaSharp.HarfBuzz
version 1.60.1
in ClassLibrary1
.
But your HarfBuzzDemo.iOS
project, which references the class library project, has a harfbuzz reference on 1.60.3
. Not sure how much of an impact that may cause, if any.
Probably an issue on our side: https://code.videolan.org/videolan/VLCKit/issues/200
Ok, I have workaround for this demo. I have extracted from ipa libHArfBuzz.a fat binary library used by SkiaSharp and added it as a native library reference. Then everything worked on iPhone, but not on iPhoneSimulator. After adding condition it works now:
<ItemGroup>
<NativeReference Condition=" '$(Platform)' == 'iPhone' " Include="lib\libHarfBuzzSharp.a">
<Kind>Static</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>True</ForceLoad>
</NativeReference>
</ItemGroup>
Ok, good job on the work around. I'll leave this issue open until it's fixed on our side.
Ima close this for now, it's been stale for too long and the next libvlc iOS version will be dynamic.
I'm using VideoLAN.LibVLC.iOS in one app with SkiaSharp. When I try to use SkiaSharp HarfBuzz application freezes or crashes. It seems that maybe SkiaSharp.HarfBuzz is trying to use native harfbuzz from DynamicFramework from DynamicMobileVLCKit. How to prevent this crash? When I remove VideoLAN.LibVLC.iOS from app, everything works normally.
What application outputs (there is no exception, only stacktrace):