Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toRelative formatter crashes with EXC_BAD_INSTRUCTION #797

Open
creativecbr opened this issue Jun 7, 2022 · 1 comment
Open

toRelative formatter crashes with EXC_BAD_INSTRUCTION #797

creativecbr opened this issue Jun 7, 2022 · 1 comment

Comments

@creativecbr
Copy link

I faced problem as in title, when I call .toRelative(since:style:locale:) on my date which as string is f.e. "2022-06-07 13:12:06 +0000" my app crashes. Crash stack from Console app prints:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   SwiftDate                     	       0x10425f4ee specialized static RelativeFormatter.suitableFlavour(inList:forLocale:) + 1230
1   SwiftDate                     	       0x10425e46d specialized static RelativeFormatter.format(date:to:style:locale:) + 1517
2   SwiftDate                     	       0x104252e9b DateRepresentable.toRelative(since:style:locale:) + 507
3   MyApp                      	       0x103f8d8cf 0x103f76000 + 96463

The line where I call that is the last one below:

 var locales = Locales.english
 let style = RelativeFormatter.timeStyle()
 return creationDate.toRelative(style:style, locale: locales)

Maybe is significant that I call that in SwiftUI.

The problem occurs after a few launches on OS X 10.15 and 12.4 at this moment, architecture x86_64.

The error is:


System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 4 Illegal instruction: 4
Terminating Process:   exc handler [830]

Thanks for every help!

@wonder2011
Copy link

Can u provide the code where this is happening, your own code ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants