Any suggestion where I could start looking? Not sure if my OS was updated in between. Everything was working fine until I made a couple view changes which i have since returned to original but I get this error:

EXC_BAD_INSTRUCTION is most commonly caused by a trap inserted by the compiler, or the code’s author, to stop the program when things have gone horribly wrong. See Identifying the Cause of Common Crashes for some more background.

To see where this is coming from, select frame 0 (the topmost) in the Debug navigator on the left and then go to the debugger console (View > Debug Areas > Show Debug Area) and enter bt at the (lldb) prompt.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

Thanks Quinn
Looks like I have to sluice through the code I found in the debugger doing that:

thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
frame #0: 0x00007fff2c7e66e1 SwiftUI(extension in SwiftUI):__C.NSAttributedString.(MetricsCache in _4EAA3873E044FE8466A2EF8771E1058D).findMetrics(requestedSize: __C.CGSize) -> Swift.Optional<(extension in SwiftUI):__C.NSAttributedString.(Metrics in _4EAA3873E044FE8466A2EF8771E1058D)> + 1057 frame #1: 0x00007fff2c7e39c9 SwiftUI(extension in SwiftUI):__C.NSAttributedString.(MetricsCache in _4EAA3873E044FE8466A2EF8771E1058D).metrics(requestedSize: __C.CGSize) -> (extension in SwiftUI):__C.NSAttributedString.(Metrics in _4EAA3873E044FE8466A2EF8771E1058D) + 297

Interesting. I was wondering how you managed to trap in Swift code in NSAttributedString, and it turns out that this is an extension added by SwiftUI. Unfortunately I don’t know nearly enough about SwiftUI to offer any insight as to why that’s trapping. My best advice is that you ask about this over on DevForums; make sure you use the SwiftUI tag so that’s it’s seen be the relevant folks.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

Eureka I solved the problem with your help. I had a textmodifier that had a frame with incorrect parameters even though it built just fine..

this is what was causing the error:

.frame(width: .infinity, height: 8, alignment: .center)

this is what I changed it to:

.frame(minWidth: 0, maxWidth: .infinity, alignment: .center)

Thanks alot

1 Like
Terms of Service

Privacy Policy

Cookie Policy