UISearchController logs about loading view during deallocation due to uninstalling back gesture recognizer

Originator:SaagarJha28
Number:rdar://32630657 Date Originated:07-Jun-2017 04:17 PM
Status:Open Resolved:
Product:iOS + SDK (UIKit) Product Version:iOS 10.3 [14E8301]
Classification:Other Bug Reproducible:
 
Area:
UIKit

Summary:
UISearchController posts a the log message "Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior <UISearchController: [pointer]>" occasionally when tapping around in my app. It seems to be trying to remove the back gesture recognizer. Please see the attached project.

Here's a stack trace:
#0	0x00000001079ccb47 in -[UIViewController loadViewIfRequired] ()
#1	0x00000001079cd45a in -[UIViewController view] ()
#2	0x000000010839eb3e in -[UISearchController _uninstallBackGestureRecognizer] ()
#3	0x000000010839bcc5 in -[UISearchController dealloc] ()
#4	0x000000010588381e in @objc ProgressReportViewController.__ivar_destroyer ()
#5	0x00000001061459bc in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#6	0x0000000106151d34 in objc_destructInstance ()
#7	0x0000000106151d66 in object_dispose ()
#8	0x0000000107a3fa21 in -[UIResponder dealloc] ()
#9	0x000000011cb21b7e in -[UIResponderAccessibility dealloc] ()
#10	0x00000001079c9cca in -[UIViewController dealloc] ()
#11	0x0000000107812544 in __destroy_helper_block_.125 ()
#12	0x000000010b0b399d in _Block_release ()
#13	0x00000001078e3187 in -[UIViewAnimationBlockDelegate .cxx_destruct] ()
#14	0x00000001061459bc in object_cxxDestructFromClass(objc_object*, objc_class*) ()
#15	0x0000000106151d34 in objc_destructInstance ()
#16	0x0000000106151d66 in object_dispose ()
#17	0x000000010615bb8e in objc_object::sidetable_release(bool) ()
#18	0x000000010664b52d in -[__NSDictionaryI dealloc] ()
#19	0x000000010615bb8e in objc_object::sidetable_release(bool) ()
#20	0x000000010615c2fa in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
#21	0x0000000106631e96 in _CFAutoreleasePoolPop ()
#22	0x000000010666daec in __CFRunLoopRun ()
#23	0x000000010666d016 in CFRunLoopRunSpecific ()
#24	0x000000010cf15a24 in GSEventRunModal ()
#25	0x000000010782a134 in UIApplicationMain ()
#26	0x00000001058ef2d7 in main at /Users/saagarjha/Downloads/break/iOS/break/break/break/AppDelegate.swift:14

Steps to Reproduce:
1. Run the attached project and tap around.
2. Stop in -[UIViewController loadViewIfRequired] with the conditional breakpoint expression for x86: (BOOL)[(id)$rdi _isDeallocating]

Expected Results:
No message

Observed Results:
Message

Version:
iOS 10.3 [14E8301]

Notes:

Configuration:
iOS Simulator

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!