Skip to content

App 子线程中初始化 APNGImage 偶现 crash #131

@Mervin1024

Description

@Mervin1024

线上崩溃日志收集如下:

#32 Thread SIGABRT

0 ??? 0x00000001acdf0f9c + 0
1 ??? 0x00000001e9ff75c0 + 0
2 ??? 0x00000001f2930000 + 0
3 ??? 0x00000001acdf1484 + 0
4 ??? 0x00000001acdff928 + 0
5 libdyld.dylib dyld_stub_binder + 60
6 APPName read (Reader.swift:104)
7 APPName read (<compiler-generated>:0)
8 APPName init (APNGDecoder.swift:78)
9 APPName init (APNGDecoder.swift:67)
10 APPName loadEmoticonMapper (<compiler-generated>:0)
11 APPName _$sIeg_IeyB_TR (<compiler-generated>:0)
12 libdispatch.dylib __dispatch_call_block_and_release + 24

crash 统计中,目前的用户设备系统版本均为 iOS13+。

  • loadEmoticonMapper 中加载 APNGImage 的代码在子线程调用,通过如下方式使用
    if let image = try? APNGImage(fileURL: url, scale: 3) { /// }

为何 try catch 无法避免 APNGDecoder.init() 方法引起的 crash 呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions