Swift keyboard extension SIGQUIT, Execution was interrupted, reason: EXC_BREAKPOINT

1.8k views Asked by At

When I try to build and run my keyboard extension, it sometimes just crashes with a Thread 1: signal SIGQUIT.

I am not able to reproduce the error. Sometimes I can build and run my app but most of the time the keyboard just quits. This happens on an actual device. In the simulator it does not open my keyboard and says Waiting to Attach.

The console does not output any errors at first. However, if I change the dropdown to View UI Hierachy in the Debug navigator I get the following description:

Details:  No plist data for fetching view hierarchy: error evaluating expression “(id)[(Class)objc_getClass("DBGViewDebuggerSupport_iOS") fetchViewHierarchyWithOptions:(id)[(Class)objc_getClass("NSDictionary") dictionaryWithObjects:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:1]] arrayByAddingObject:(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:@"_UIVisualEffectBackdropView"] arrayByAddingObject:@"_UIBackdropEffectView"]] arrayByAddingObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:0]] forKeys:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:@"DBGViewDebuggerUseLayersAsSnapshots"] arrayByAddingObject:@"DBGViewDebuggerEffectViewsToSnapshotAsImage"] arrayByAddingObject:@"DBGViewDebuggerAlwaysEncodeLayers"]]]”: error: Execution was interrupted, reason: EXC_BREAKPOINT (code=1, subcode=0x18daddc34).
The process has been returned to the state before expression evaluation.

Method:   -[DBGAbstractViewDescriber handleFetchedViewInfo:fetchError:resultHandler:]
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

I also took a screenshot of the processes.

enter image description here

Am I doing something wrong and how could I prevent that my keyboard extension quits all the time when running it? Is it actually a bug as it says in the description?

2

There are 2 answers

3
Randy On

DISCLAIMER

It seems like something in xCode 8.2.1 is broken and the debugger is not correctly attaching to the correct process or the hosting process is not properly loading the new code.

This is a not a permanent solution but a temporary workaround.

WORKAROUND

I have been able to work around this issue by following the steps below.

  1. Kill any process that is using your keyboard (important!)
  2. Launch the application using the debugger so the latest code is deployed to the device
  3. Navigate to Settings > General > Keyboards > etc.
  4. Remove your custom keyboard
  5. Re-add your custom keyboard
  6. Debug the application once again

The reason this works is because removing the keyboard kills the process that is hosting the extension allowing Xcode to attach to the new binary.

1
Alirezak On

As I understand this is a bug in Xcode 8.2.1. because before update my custom keyboard was working very well. this is a temporary solution.

  1. Run your code like always!
  2. Bring up your keyboard until the error (SIGQUIT) appear!
  3. Goto xcode > debug > detach
  4. Goto again Xcode > debug > Attach to Process: attach the keyboard (it should be first process)

now, your breakpoints will work. but there are no log output unfortunately! I hope it temporary solve your problem