NSDateFormatter crashes when used from different threads

前端 未结 5 1699
傲寒
傲寒 2020-12-15 05:58

We keep getting a random, weird crash with NSDateFormatter. The relevant stack trace is:

Program received signal:  “EXC_BAD_ACCESS”.
#0  0x00000         


        
5条回答
  •  无人及你
    2020-12-15 06:49

    I was experiencing weird crashes with _sigtramp which caused to application to appear locked up but still on the screen - completely obstructing the real root cause.

    It turned out indeed that we introduced multi-thread data parsing which collided with the main GUI thread trying to parse dates using NSDateFormatter.

    Putting some synchronization around the NSDateFormatter formatDate calls resolved the issues.

提交回复
热议问题