Skip to content

spy_on NSDate crashes on Xcode 10 #406

@aaa-abrowne

Description

@aaa-abrowne

After updating to Xcode 10, we saw our tests crashing when swizzling Foundation methods like [NSDate date].

objc[30382]: no class for metaclass 0x11588e700
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSDate as_spied_class:]: unrecognized selector sent to class 0x1153656d8'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001150b229b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x000000010d15b735 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001150d0ea4 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00000001150b6fb6 ___forwarding___ + 1446
	4   CoreFoundation                      0x00000001150b8e88 _CF_forwarding_prep_0 + 120
	5   aaa-ace-mobileTests-b-objc          0x0000000139354e83 -[CDRSpy hash] + 211
	6   CoreFoundation                      0x000000011507fc23 __21+[__NSSetI __new::::]_block_invoke + 51
	7   CoreFoundation                      0x000000011507fb1a +[__NSSetI __new::::] + 474
	8   CoreFoundation                      0x00000001150d5ed4 +[NSSet setWithObjects:count:] + 52
	9   CoreFoundation                      0x00000001150d6eab -[NSSet setByAddingObjectsFromSet:] + 763
	10  DTXConnectionServices               0x00000001372baf44 -[DTXProxyChannel _allowedClassesForReturnValues] + 109
	11  DTXConnectionServices               0x00000001372bb722 __42-[DTXProxyChannel _sendInvocationMessage:]_block_invoke + 260
	12  DTXConnectionServices               0x00000001372c9e76 __51-[DTXChannel _scheduleMessage:tracker:withHandler:]_block_invoke.751 + 101
	13  libdispatch.dylib                   0x0000000116ec151d _dispatch_call_block_and_release + 12
	14  libdispatch.dylib                   0x0000000116ec2587 _dispatch_client_callout + 8
	15  libdispatch.dylib                   0x0000000116ec9058 _dispatch_lane_serial_drainTest Case '-[_ValidationTextViewControllerSpec Initialization_with_masking_disabled_as_saves_what_is_initialized_into_properties_Loading_the_view_With_rightImage_as_when_the_view_loads_validate_When_the_validation_object_is_valid_should_hide_the_error_label]' started.
 + 720
	16  libdispatch.dylib                   0x0000000116ec9b9b _dispatch_lane_invoke + 401
	17  libdispatch.dylib                   0x0000000116ed29c6 _dispatch_workloop_worker_thread + 645
	18  libsystem_pthread.dylib             0x00000001172a2fd2 _pthread_wqthread + 980
	19  libsystem_pthread.dylib             0x00000001172a2be9 start_wqthread + 13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions