Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV while executing native code when initWithFormat:arguments: when building for 64 bit #1

Open
LGFox opened this issue Aug 15, 2017 · 3 comments
Assignees

Comments

@LGFox
Copy link

LGFox commented Aug 15, 2017

This code causes app crash on 'iPhone 7 Plus iOS 10.3' simulator with x64 build:

var testString = NSStringUtility.LocalizedFormat(NSBundle.MainBundle.LocalizedNSString("cb_reminders_detail_repeat_untiloccurrences"), 110, 1.508, 10);

It seems, it relates to this bug
Stacktrace:

2017-08-14 20:22:34.310 App.iOS[86905:5189452] critical: Stacktrace:

2017-08-14 20:22:34.311 App.iOS[86905:5189452] critical: at <0xffffffff>
2017-08-14 20:22:34.311 App.iOS[86905:5189452] critical: at (wrapper managed-to-native) App.iOS.Classes.LocalizationUtility.NSStringUtility.NSStringInitWithFormatArguments (intptr,intptr,intptr,intptr) [0x0000c] in <316d4c67b02147a5bd23e98bd7553ede>:0
2017-08-14 20:22:34.312 App.iOS[86905:5189452] critical: at App.iOS.Classes.LocalizationUtility.NSStringUtility.LocalizedFormat (Foundation.NSString,App.iOS.Classes.LocalizationUtility.VariadicArguments.VariadicArgument[]) [0x00046] in F:\Git\CB.MobileIOS\App.iOS\Classes\LocalizationUtility\NSStringUtility.cs:40
2017-08-14 20:22:34.312 App.iOS[86905:5189452] critical: at App.iOS.Pages.SignIn.SignInViewController.CreateKeepMeSignView () [0x00061] in F:\Git\CB.MobileIOS\App.iOS\Pages\SignIn\SignInViewController.cs:154
2017-08-14 20:22:34.312 App.iOS[86905:5189452] critical: at App.iOS.Pages.SignIn.SignInViewController.CreateMarkUp () [0x00154] in F:\Git\CB.MobileIOS\App.iOS\Pages\SignIn\SignInViewController.cs:107
2017-08-14 20:22:34.313 App.iOS[86905:5189452] critical: at App.iOS.Pages.SignIn.SignInViewController.OnViewDidLoad () [0x00008] in F:\Git\CB.MobileIOS\App.iOS\Pages\SignIn\SignInViewController.cs:55
2017-08-14 20:22:34.313 App.iOS[86905:5189452] critical: at BusinessLogic.Classes.CatchExceptionHelper.CatchException (System.Action) [0x00002] in F:\Git\CB.MobileIOS\Libraries\BusinessLogic\Classes\CatchExceptionHelper.cs:23
2017-08-14 20:22:34.314 App.iOS[86905:5189452] critical: at App.iOS.Pages.ABaseViewController`2<TParameter_REF, TData_REF>.ViewDidLoad () [0x0000f] in F:\Git\CB.MobileIOS\App.iOS\Pages\ABaseViewController.cs:133
2017-08-14 20:22:34.314 App.iOS[86905:5189452] critical: at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <2f4074c3120b4d80802e10af84b67d41>:0
2017-08-14 20:22:34.314 App.iOS[86905:5189452] critical: at <0xffffffff>
2017-08-14 20:22:34.315 App.iOS[86905:5189452] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) [0x0005c] in <58a9bd8a3cbb4d0092bc0a767ff66c0f>:0
2017-08-14 20:22:34.316 App.iOS[86905:5189452] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:79
2017-08-14 20:22:34.317 App.iOS[86905:5189452] critical: at UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:63
2017-08-14 20:22:34.317 App.iOS[86905:5189452] critical: at App.iOS.Application.Main (string[]) [0x00336] in F:\Git\CB.MobileIOS\App.iOS\Main.cs:121
2017-08-14 20:22:34.317 App.iOS[86905:5189452] critical: at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <316d4c67b02147a5bd23e98bd7553ede>:0
2017-08-14 20:22:34.318 App.iOS[86905:5189452] critical:
Native stacktrace:
2017-08-14 20:22:34.334 App.iOS[86905:5189452] critical: 0 App.iOS 0x000000010223f2b1 mono_handle_native_crash + 257
2017-08-14 20:22:34.335 App.iOS[86905:5189452] critical: 1 App.iOS 0x000000010224c380 mono_sigsegv_signal_handler + 288
2017-08-14 20:22:34.335 App.iOS[86905:5189452] critical: 2 libsystem_platform.dylib 0x000000010f340bba _sigtramp + 26
2017-08-14 20:22:34.335 App.iOS[86905:5189452] critical: 3 ??? 0x0000000000000000 0x0 + 0
2017-08-14 20:22:34.336 App.iOS[86905:5189452] critical: 4 CoreFoundation 0x000000010da77d83 _CFStringCreateWithFormatAndArgumentsAux2 + 243
2017-08-14 20:22:34.336 App.iOS[86905:5189452] critical: 5 App.iOS 0x0000000102411009 xamarin_dyn_objc_msgSend + 217
2017-08-14 20:22:34.336 App.iOS[86905:5189452] critical: 6 ??? 0x000000012983b528 0x0 + 4991464744
2017-08-14 20:22:34.337 App.iOS[86905:5189452] 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.
=================================================================

@rubo
Copy link
Owner

rubo commented Aug 15, 2017

This is a known issue. Sadly, I don't know any workarounds for this. The simplest way is to go with 32-bit apps on simulators. Not the best solution, of course, but we have what we have.

Xamarin team is aware of the issue but seems they put it on hold due to the fact it's pretty heavy to fix. I believe the importance of this issue is underrated and it needs more votes on their issue tracker to catch their attention.

@rubo rubo added the bug label Aug 15, 2017
@rubo rubo changed the title SIGSEV while executing native code when initWithFormat:arguments: when building for 64 bit SIGSEGV while executing native code when initWithFormat:arguments: when building for 64 bit Aug 15, 2017
@rubo rubo added the wontfix label Aug 16, 2017
@LGFox
Copy link
Author

LGFox commented Aug 18, 2017

At least, it works on real devices.

@rubo
Copy link
Owner

rubo commented Sep 15, 2017

Made a small improvement in 9d699b1 to prevent crashing on 64-bit simulators. Instead, it now returns the key itself. Definitely, much better than crashing.

@rubo rubo self-assigned this Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants