Linphone-Xamarin SDKを用いた、iOSアプリケーション(SIPクライアント)を開発しています。
http://www.linphone.org/news/53/26/Creation-of-a-Liblinphone-C-wrapper-for-Xamarin.html
実行中にアプリが落ちることがあり、
デバッグ中のコンソールには下記のように出力されておりました。
※IDEでは例外は捕捉できていません
アプリが落ちる原因が分からず、困っています。
どなたか教えていただけますでしょうか。
また、有効な対策がございましたら、ご教授願います。
よろしくお願い致します。
なお、linphone_core_iterateは、以下のように実行しております。
・linphone_core_iterateはメインスレッドで実行
・linphone_core_iterateの実行間隔は100ms
コンソール出力
SipClient.iOS[485:481613] critical: Stacktrace:
2018-04-02 21:11:29.786 SipClient.iOS[485:481613] critical: at <0xffffffff>
2018-04-02 21:11:29.786 SipClient.iOS[485:481613] critical: at (wrapper managed-to-native) Linphone.Core.linphone_core_iterate (intptr) <0x00007>
2018-04-02 21:11:29.788 SipClient.iOS[485:481613] critical: at Linphone.Core.Iterate () [0x00001] in /Users/pe/Desktop/SipClient/SipClient/SipClient/Lib/LinphoneWrapper.cs:10246
2018-04-02 21:11:29.789 SipClient.iOS[485:481613] critical: at SipClient.App/<>c.b__42_0 () [0x00001] in /Users/pe/Desktop/SipClient/SipClient/SipClient/App.xaml.cs:258
2018-04-02 21:11:29.791 SipClient.iOS[485:481613] critical: at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.1.28/src/Xamarin.iOS/Foundation/NSAction.cs:163
2018-04-02 21:11:29.791 SipClient.iOS[485:481613] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <77f233cf63384ebaa1d752e479e82a77#FF549F36-3DC2-06BC-37B1-7A31A35146AA>:0
2018-04-02 21:11:29.791 SipClient.iOS[485:481613] critical: at <0xffffffff>
2018-04-02 21:11:29.792 SipClient.iOS[485:481613] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00007>
2018-04-02 21:11:29.793 SipClient.iOS[485:481613] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.1.28/src/Xamarin.iOS/UIKit/UIApplication.cs:79
2018-04-02 21:11:29.793 SipClient.iOS[485:481613] critical: at UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.1.28/src/Xamarin.iOS/UIKit/UIApplication.cs:63
2018-04-02 21:11:29.793 SipClient.iOS[485:481613] critical: at SipClient.iOS.Application.Main (string[]) [0x00001] in /Users/pe/Desktop/SipClient/SipClient/SipClient.iOS/Main.cs:17
2018-04-02 21:11:29.793 SipClient.iOS[485:481613] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <77f233cf63384ebaa1d752e479e82a77#FF549F36-3DC2-06BC-37B1-7A31A35146AA>:0
2018-04-02 21:11:29.794 SipClient.iOS[485:481613] critical:
Native stacktrace:
2018-04-02 21:11:29.800 SipClient.iOS[485:481613] critical: 0 SipClient.iOS 0x0000000102a1b298 _ZN7plcrash3BIT5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy + 214856
2018-04-02 21:11:29.800 SipClient.iOS[485:481613] critical: 1 SipClient.iOS 0x0000000102a26850 mono_pmip + 9760
2018-04-02 21:11:29.800 SipClient.iOS[485:481613] critical: 2 libsystem_platform.dylib 0x0000000180affb50 _sigtramp + 52
2018-04-02 21:11:29.800 SipClient.iOS[485:481613] critical: 3 bctoolbox 0x0000000102e791bc bctbx_list_for_each + 32
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 4 bctoolbox 0x0000000102e791bc bctbx_list_for_each + 32
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 5 linphone 0x0000000103199694 linphone_core_iterate + 1084
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 6 SipClient.iOS 0x00000001013dab90 SipClient.iOS + 977808
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 7 SipClient.iOS 0x0000000101344f60 SipClient.iOS + 364384
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 8 SipClient.iOS 0x000000010139202c SipClient.iOS + 679980
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 9 SipClient.iOS 0x00000001020f5054 SipClient.iOS + 14717012
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 10 SipClient.iOS 0x00000001016c0d08 SipClient.iOS + 4017416
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 11 SipClient.iOS 0x0000000102a299d0 mono_pmip + 22432
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 12 SipClient.iOS 0x0000000102a93128 mono_pmip + 454392
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 13 SipClient.iOS 0x0000000102a93084 mono_pmip + 454228
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 14 SipClient.iOS 0x00000001012f0204 SipClient.iOS + 16900
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 15 SipClient.iOS 0x00000001012f08e8 SipClient.iOS + 18664
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 16 Foundation 0x00000001818d72e4 + 340
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 17 CoreFoundation 0x0000000180e8377c + 24
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 18 CoreFoundation 0x0000000180e836fc + 88
2018-04-02 21:11:29.801 SipClient.iOS[485:481613] critical: 19 CoreFoundation 0x0000000180e82f84 + 204
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 20 CoreFoundation 0x0000000180e80b5c + 1048
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 21 CoreFoundation 0x0000000180da0c58 CFRunLoopRunSpecific + 436
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 22 GraphicsServices 0x0000000182c4cf84 GSEventRunModal + 100
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 23 UIKit 0x000000018a4f95c4 UIApplicationMain + 236
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 24 SipClient.iOS 0x0000000102186e10 SipClient.iOS + 15314448
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 25 SipClient.iOS 0x00000001021178dc SipClient.iOS + 14858460
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 26 SipClient.iOS 0x000000010211789c SipClient.iOS + 14858396
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 27 SipClient.iOS 0x000000010138ce80 SipClient.iOS + 659072
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 28 SipClient.iOS 0x00000001016c0d08 SipClient.iOS + 4017416
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 29 SipClient.iOS 0x0000000102a299d0 mono_pmip + 22432
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 30 SipClient.iOS 0x0000000102a93128 mono_pmip + 454392
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 31 SipClient.iOS 0x0000000102a95df8 mono_pmip + 465864
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 32 SipClient.iOS 0x0000000102a11fcc _ZN7plcrash3BIT5async24dwarf_cfa_state_iteratorIyxE4nextEPjPNS1_28plcrash_dwarf_cfa_reg_rule_tEPy + 177276
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 33 SipClient.iOS 0x0000000102b369c0 _Z9__isctypeim + 46228
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 34 SipClient.iOS 0x0000000101310694 SipClient.iOS + 149140
2018-04-02 21:11:29.802 SipClient.iOS[485:481613] critical: 35 libdyld.dylib 0x00000001808c056c + 4
2018-04-02 21:11:29.803 SipClient.iOS[485:481613] critical:
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
Xamarin.Hosting: Process '485' exited.
Application 'jp.co.hogehoge.AppName' terminated.
開発環境
IDE: VisualStudio for Mac 7.4.1
liblinphone-xamarin-sdkバージョン: 3.12.0
WebViewアプリケーションです。
ソース
private void LinphoneCoreIterate()
{
while (true)
{
Thread.Sleep(100);
try
{
// Linphoneの状態を更新する
iterate(false);
}
catch (Exception ex)
{
}
Device.BeginInvokeOnMainThread(() =>
{
// ログイン状態のチェック
CheckLoginStatus();
});
}
}
private static int IterateNum = 0;
public static void iterate(bool isRefresh) {
if (IterateNum >= 1 && !isRefresh)
{
Thread.Sleep(500);
return;
}
IterateNum++;
try
{
// メインスレッド上で実行する
Device.BeginInvokeOnMainThread(() =>
{
LinphoneCore.Iterate();
});
}
catch(Exception)
{
}
IterateNum--;
}