Bug 26760 - MTMBProgressHud: crash in iOS 6 using `sizeWithAttributes` selector
Summary: MTMBProgressHud: crash in iOS 6 using `sizeWithAttributes` selector
Status: RESOLVED FIXED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Matthew Leibowitz
URL:
Depends on:
Blocks:
 
Reported: 2015-02-04 17:43 UTC by Adam Patridge
Modified: 2015-12-23 21:18 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Adam Patridge 2015-02-04 17:43:47 UTC
When running a project with the latest MTMBProgressHUD component (0.9.0.1) on an iOS 6 device, it will crash when the HUD is used. The only significant change to that project since it was last running successfully on iOS 6 was updating to the Unified API, which required updating from 0.9.0 to 0.9.0.1 of this component.

I put together a sample repro project (https://gist.github.com/patridge/a1ff0fbdfcab35b81454), but for some reason, it provides less detailed output than the production project I was initially running. The original had a line specifically mentioning MBProgressHUD:

`5 SomeOtherApp 0x0002efef -[MBProgressHUD layoutSubviews] + 574`

Oddly enough, MBProgressHUD only has one reference to `sizeWithAttributes`, and it is guarded by something that looks like a version check (and it was written way back in June, 2013).

https://github.com/jdg/MBProgressHUD/blame/28c44be41399e474ed959269e2364be0047ad8eb/MBProgressHUD.m#L29

> #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
>   #define MB_TEXTSIZE(text, font) [text length] > 0 ? [text \
>     sizeWithAttributes:@{NSFontAttributeName:font}] : CGSizeZero;
> #else

Here is the full application output from sample repro project:
2015-02-04 15:20:58.323 iOSUnifiedStarterProject[4895:907] -[__NSCFString sizeWithAttributes:]: unrecognized selector sent to instance 0x1fdea530
2015-02-04 15:20:58.336 iOSUnifiedStarterProject[4895:907] critical: Stacktrace:

2015-02-04 15:20:58.340 iOSUnifiedStarterProject[4895:907] critical: 
Native stacktrace:

2015-02-04 15:20:58.459 iOSUnifiedStarterProject[4895:907] critical: 	0   iOSUnifiedStarterProject            0x001c13a1 mono_handle_native_sigsegv + 240
2015-02-04 15:20:58.464 iOSUnifiedStarterProject[4895:907] critical: 	1   iOSUnifiedStarterProject            0x001cb951 mono_sigsegv_signal_handler + 208
2015-02-04 15:20:58.467 iOSUnifiedStarterProject[4895:907] critical: 	2   libsystem_c.dylib                   0x3c02ce93 _sigtramp + 42
2015-02-04 15:20:58.471 iOSUnifiedStarterProject[4895:907] critical: 	3   iOSUnifiedStarterProject            0x001ba2bb mono_arch_find_jit_info + 82
2015-02-04 15:20:58.475 iOSUnifiedStarterProject[4895:907] critical: 	4   iOSUnifiedStarterProject            0x001bf357 mono_find_jit_info_ext + 158
2015-02-04 15:20:58.479 iOSUnifiedStarterProject[4895:907] critical: 	5   iOSUnifiedStarterProject            0x001c0837 mono_handle_exception_internal + 1874
2015-02-04 15:20:58.483 iOSUnifiedStarterProject[4895:907] critical: 	6   iOSUnifiedStarterProject            0x001c00df mono_handle_exception + 10
2015-02-04 15:20:58.486 iOSUnifiedStarterProject[4895:907] critical: 	7   iOSUnifiedStarterProject            0x001b9d6b mono_arm_throw_exception + 110
2015-02-04 15:20:58.490 iOSUnifiedStarterProject[4895:907] critical: 	8   iOSUnifiedStarterProject            0x0016ee68 throw_exception + 64
2015-02-04 15:20:58.494 iOSUnifiedStarterProject[4895:907] critical: 	9   iOSUnifiedStarterProject            0x00058490 ObjCRuntime_Runtime_throw_ns_exception_intptr + 28
2015-02-04 15:20:58.498 iOSUnifiedStarterProject[4895:907] critical: 	10  iOSUnifiedStarterProject            0x00096c80 wrapper_native_to_managed_ObjCRuntime_Runtime_throw_ns_exception_intptr + 68
2015-02-04 15:20:58.502 iOSUnifiedStarterProject[4895:907] critical: 	11  iOSUnifiedStarterProject            0x0027c170 xamarin_throw_ns_exception + 52
2015-02-04 15:20:58.506 iOSUnifiedStarterProject[4895:907] critical: 	12  iOSUnifiedStarterProject            0x0027dfc0 exception_handler + 224
2015-02-04 15:20:58.510 iOSUnifiedStarterProject[4895:907] critical: 	13  CoreFoundation                      0x33f2e57f <redacted> + 614
2015-02-04 15:20:58.513 iOSUnifiedStarterProject[4895:907] critical: 	14  libobjc.A.dylib                     0x3bbaea65 <redacted> + 128
2015-02-04 15:20:58.517 iOSUnifiedStarterProject[4895:907] critical: 	15  libc++abi.dylib                     0x3b5fb07b <redacted> + 78
2015-02-04 15:20:58.521 iOSUnifiedStarterProject[4895:907] critical: 	16  libc++abi.dylib                     0x3b5fb114 <redacted> + 19
2015-02-04 15:20:58.526 iOSUnifiedStarterProject[4895:907] critical: 	17  libc++abi.dylib                     0x3b5fc599 __cxa_current_exception_type + 0
2015-02-04 15:20:58.529 iOSUnifiedStarterProject[4895:907] critical: 	18  libobjc.A.dylib                     0x3bbae9d1 objc_exception_rethrow + 12
2015-02-04 15:20:58.533 iOSUnifiedStarterProject[4895:907] critical: 	19  CoreFoundation                      0x33e74f21 CFRunLoopRunSpecific + 456
2015-02-04 15:20:58.537 iOSUnifiedStarterProject[4895:907] critical: 	20  CoreFoundation                      0x33e74d49 CFRunLoopRunInMode + 104
2015-02-04 15:20:58.541 iOSUnifiedStarterProject[4895:907] critical: 	21  UIKit                               0x35d8d485 <redacted> + 668
2015-02-04 15:20:58.545 iOSUnifiedStarterProject[4895:907] critical: 	22  UIKit                               0x35d8a301 UIApplicationMain + 1120
2015-02-04 15:20:58.549 iOSUnifiedStarterProject[4895:907] critical: 	23  iOSUnifiedStarterProject            0x00096990 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 272
2015-02-04 15:20:58.553 iOSUnifiedStarterProject[4895:907] critical: 	24  iOSUnifiedStarterProject            0x00071498 UIKit_UIApplication_Main_string___intptr_intptr + 52
2015-02-04 15:20:58.556 iOSUnifiedStarterProject[4895:907] critical: 	25  iOSUnifiedStarterProject            0x00071458 UIKit_UIApplication_Main_string___string_string + 204
2015-02-04 15:20:58.560 iOSUnifiedStarterProject[4895:907] critical: 	26  iOSUnifiedStarterProject            0x00055c00 iOSUnifiedStarterProject_Application_Main_string__ + 468
2015-02-04 15:20:58.564 iOSUnifiedStarterProject[4895:907] critical: 	27  iOSUnifiedStarterProject            0x0014dd24 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
2015-02-04 15:20:58.568 iOSUnifiedStarterProject[4895:907] critical: 	28  iOSUnifiedStarterProject            0x001cdb4f mono_jit_runtime_invoke + 1158
2015-02-04 15:20:58.572 iOSUnifiedStarterProject[4895:907] critical: 	29  iOSUnifiedStarterProject            0x00215299 mono_runtime_invoke + 88
2015-02-04 15:20:58.575 iOSUnifiedStarterProject[4895:907] critical: 	30  iOSUnifiedStarterProject            0x002187ab mono_runtime_exec_main + 282
2015-02-04 15:20:58.580 iOSUnifiedStarterProject[4895:907] critical: 	31  iOSUnifiedStarterProject            0x002185e9 mono_runtime_run_main + 492
2015-02-04 15:20:58.583 iOSUnifiedStarterProject[4895:907] critical: 	32  iOSUnifiedStarterProject            0x001b7af1 mono_jit_exec + 48
2015-02-04 15:20:58.586 iOSUnifiedStarterProject[4895:907] critical: 	33  iOSUnifiedStarterProject            0x0027ac70 xamarin_main + 2172
2015-02-04 15:20:58.590 iOSUnifiedStarterProject[4895:907] critical: 	34  iOSUnifiedStarterProject            0x0019a699 main + 108
2015-02-04 15:20:58.594 iOSUnifiedStarterProject[4895:907] critical: 	35  libdyld.dylib                       0x3bfe5b20 <redacted> + 0
2015-02-04 15:20:58.598 iOSUnifiedStarterProject[4895:907] 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.
Comment 1 Bill Holmes 2015-06-04 10:12:55 UTC
Matthew,

Can you check this component again?  The project that you setup in our repo targets 8.  We could change that target to , rebuild the package and publish again.

-Bill
Comment 2 David Humphreys 2015-12-22 22:10:04 UTC
No response to the message to check again
Comment 3 Adam Patridge 2015-12-22 22:19:10 UTC
Was this comment thread waiting for a response from someone? If so, who? The last question was to Matthew, presumably the assignee Matthew Leibowitz. Last I saw, we were waiting on a republish with a new target.

If the project was republished, let me know. I can go dust off an iOS 6 device again for a re-test. If not, NORESPONSE isn't a valid close reason yet.
Comment 4 David Humphreys 2015-12-23 21:18:32 UTC
Adam,

We have now updated the component in the store and it is now compatible down to iOS 5.0.

This should resolve the issue for you now.

You can reopen if you are still having issues.

Thanks