18

Error: Unable to capture view hierarchy. Details: Log Title: Data source expression execution failure. Log Details: error evaluating expression “(id)[[(Class)objc_getClass("DBGTargetHub") sharedHub] performRequestWithRequestInBase64:@"YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QFwcIGxwdHh8gISIuLzAxMjM0Nz1BQkNEVSRudWxs0wkKCwwTGldOUy5rZXlzWk5TLm9iamVjdHNWJGNsYXNzpg0ODxAREoACgAOABIAFgAaAB6YUFRYXGBmACIAJgBOAD4AUgBWAFl8QG0RCR0hpZXJhcmNoeVJlcXVlc3RQcmlvcml0eV8QHERCR0hpZXJhcmNoeVJlcXVlc3RQcmVkaWNhdGVfEBdEQkdIaWVyYXJjaHlSZXF1ZXN0TmFtZV8QHkRCR0hpZXJhcmNoeVJlcXVlc3RTcGluUnVubG9vcF8QHURCR0hpZXJhcmNoeVJlcXVlc3RJZGVudGlmaWVyXxAXREJHSGllcmFyY2h5UmVxdWVzdFR5cGUQANMJCgsjKC2kJCUmJ4AKgAuADIANpCkXKyuADoAPgBCAEIASXxATc3RyaWN0ZXN0VmlzaWJpbGl0eV8QEWluY2x1ZGVMYXp5VmFsdWVzXxATZW51bVByb3ZpZGVyQ2xhc3Nlc18QFm9wdGlvbnNQcm92aWRlckNsYXNzZXMQAwjSCgs1NqCAEdI4OTo7WiRjbGFzc25hbWVYJGNsYXNzZXNXTlNBcnJheaI6PFhOU09iamVjdNI4OT4/XxATTlNNdXRhYmxlRGljdGlvbmFyeaM+QDxcTlNEaWN0aW9uYXJ5XxAPSW5pdGlhbCByZXF1ZXN0XxAkQ0U4OUY0RkItRkRGRS00RUNGLUIwNzctMUQyNDk1REMzMjRCEAHSODlARaJAPF8QD05TS2V5ZWRBcmNoaXZlctFISVRyb290gAEACAARABoAIwAtADIANwBRAFcAXgBmAHEAeAB/AIEAgwCFAIcAiQCLAJIAlACWAJgAmgCcAJ4AoAC+AN0A9wEYATgBUgFUAVsBYAFiAWQBZgFoAW0BbwFxAXMBdQF3AY0BoQG3AdAB0gHTAdgB2QHbAeAB6wH0AfwB/wIIAg0CIwInAjQCRgJtAm8CdAJ3AokCjAKRAAAAAAAAAgEAAAAAAAAASgAAAAAAAAAAAAAAAAAAApM="]”: error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x0).

The process has been returned to the state before expression evaluation.

Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
MisterDeng
  • 181
  • 1
  • 3

2 Answers2

4

You likely have a bug somewhere in the implementation of a framework override. At least it was the case for me: a forced unwrapping of an optional nil value. Since the debugger executes the above statement, I could not get a stack trace of where the problem had happened.

My idea was to emulate the debugger's statement in my code directly. Since you won't have access to DBGTargetHub's interface, I went with using the Objective-C runtime functions.

NSString *data = @"YnBsaXN0MDDUAQIDBA[...]";

Class DbgTargetHub = objc_getClass("DBGTargetHub");

SEL sel = sel_getUid("sharedHub");

id sharedHub = ((id(*)(id, SEL))objc_msgSend)(DbgTargetHub, sel);

sel = sel_getUid("performRequestWithRequestInBase64:");

id result = ((id(*)(id, SEL, NSString*))objc_msgSend)(sharedHub, sel, data);

I was able to generate a stack trace from this which I could use to locate my problem.

Would be interested to know if this helped anybody.

bompf
  • 1,374
  • 1
  • 18
  • 24
  • 1
    Thanks, this helped me track down a crash in a Swift subclass of NSCell (see https://bugs.swift.org/browse/SR-4756) – Ryder Mackay Jun 26 '18 at 01:27
1

For me this was a really weird SwiftUI bug caused by having a Section(header: that was a Divider view. Changed it to a Rectangle view and it all started working again...

I was only able to track this down by commenting out views until things worked again. Hope this helps some poor soul

Manny
  • 1,682
  • 1
  • 14
  • 13