一、Crash详情

Crash类型

exception EXC_BREAKPOINT (SIGTRAP)
reason EXC_BREAKPOINT EXC_ARM_BREAKPOINT fault_address:0x0000000185ba6824

Crash堆栈

0 libswiftCore.dylib 0x0000000185ba6824 swift_slowAlloc.cold.1 (in libswiftCore.dylib) + 16
1 libswiftCore.dylib 0x0000000185b2c9d8 _swift_slowAlloc (in libswiftCore.dylib) + 208
2 libswiftCore.dylib 0x0000000185b2cb48 _swift_allocObject (in libswiftCore.dylib) + 60
3 libswiftCore.dylib 0x0000000185abe67c specialized static _DictionaryStorage.resize(original: __RawDictionaryStorage, capacity: Int, move: Bool) (in libswiftCore.dylib) + 328
4 libswiftCore.dylib 0x000000018591fbf8 _NativeDictionary._copyOrMoveAndResize(capacity: Int, moveElements: Bool) (in libswiftCore.dylib) + 324
5 libswiftCore.dylib 0x0000000185920034 _NativeDictionary.ensureUnique(isUnique: Bool, capacity: Int) (in libswiftCore.dylib) + 52

二、分析过程

经过排查, 该对象不存在多线程访问的问题

通过 异常类型 EXC_BREAKPOINT, 猜测是Swift Runtime中的异常触发, 参考SwiftAlloc的源代码

// When alignMask == ~(size_t(0)), allocation uses the "default"
// _swift_MinAllocationAlignment. This is different than calling swift_slowAlloc
// with `alignMask == _swift_MinAllocationAlignment - 1` because it forces
// the use of AlignedAlloc. This allows manually allocated to memory to always
// be deallocated with AlignedFree without knowledge of its original allocation
// alignment.
//
// For alignMask > (_minAllocationAlignment-1)
// i.e. alignment == 0 || alignment > _minAllocationAlignment:
// The runtime must use AlignedAlloc, and the standard library must
// deallocate using an alignment that meets the same condition.
//
// For alignMask <= (_minAllocationAlignment-1)
// i.e. 0 < alignment <= _minAllocationAlignment:
// The runtime may use either malloc or AlignedAlloc, and the standard library
// must deallocate using an identical alignment.
void *swift::swift_slowAlloc(size_t size, size_t alignMask) {
void *p;
// This check also forces "default" alignment to use AlignedAlloc.
if (alignMask <= MALLOC_ALIGN_MASK) {
#if defined(__APPLE__) && SWIFT_STDLIB_HAS_DARWIN_LIBMALLOC
p = malloc_zone_malloc(DEFAULT_ZONE(), size);
#else
p = malloc(size);
#endif
} else {
size_t alignment = (alignMask == ~(size_t(0)))
? _swift_MinAllocationAlignment
: alignMask + 1;
p = AlignedAlloc(size, alignment);
}
if (!p) swift::crash("Could not allocate memory.");
return p;
}

关于 EXC_BREAKPOINT

The breakpoint exception type indicates a trace trap interrupted the process. A trace trap gives an attached debugger the chance to interrupt the process at a specific point in its execution. On ARM processors, this appears as EXC_BREAKPOINT (SIGTRAP). On x86_64 processors, this appears as EXC_BAD_INSTRUCTION (SIGILL).

The Swift runtime uses trace traps for specific types of unrecoverable errors—see Addressing Crashes from Swift Runtime Errors for information on those errors. Some lower-level libraries, such as Dispatch, trap the process with this exception upon encountering an unrecoverable error, and log additional information about the error in the Additional Diagnostic Information section of the crash report. See Diagnostic Messages for information about those messages.

If you want to use the same technique in your own code for unrecoverable errors, call the __builtin_trap() function. This allows the system to generate a crash report with thread backtraces that show how you reached the unrecoverable error.

swift_slowAlloc Crash 分析的更多相关文章

  1. iOS --------Crash 分析(一)

    iOS Crash 分析(文一)- 开始 1. 名词解释 1. UUID 一个字符串,在iOS上每个可执行文件或库文件都包含至少一个UUID.目的是为了唯一识别这个文件. 2. dwarfdump 苹 ...

  2. iOS开发之Crash分析,以及收集

    一  先谈谈iOS的Crash收集方式: 1. APP 发生crash,用户手机手机上肯定会有crash纪录,当然删除了该app,或是删了再装 crash纪录还是没了. 2. 如果用户设置-隐私  同 ...

  3. iOS Crash 分析 符号化崩溃日志

    参考: http://blog.csdn.net/diyagoanyhacker/article/details/41247367 http://blog.csdn.net/diyagoanyhack ...

  4. 如何使用crash分析vmcore - 之基础思路case1

    如何使用crash分析vmcore - 之基础思路case1 dmesg查看内核日志 [2493382.671020] systemd-shutdown[1]: Sending SIGKILL to ...

  5. 利用crash 分析软死锁问题【转】

    转自:https://blog.csdn.net/divlee130/article/details/47806551 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog. ...

  6. 一个未完成的2.6.32-220内核踩内存crash分析记录

    遇到一个crash,log如下: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81 ...

  7. Linux内核Crash分析

    转载自:http://linux.cn/article-3475-1.html 在工作中经常会遇到一些内核crash的情况,本文就是根据内核出现crash后的打印信息,对其进行了分析,使用的内核版本为 ...

  8. jvm crash分析

    问题描述:线上进程异常退出,查看服务器端日志,有jvm crash文件生成 # # A fatal error has been detected by the Java Runtime Enviro ...

  9. 高通CP Crash分析调试

    1. 转换tlcore文件 获取 EBICS0.BIN tl2elf --qconly tlcore 2.使用T32 命令把Riva的dump信息从EBICS0文件分离出来 data.load.BIN ...

  10. IOS crash分析

    此处不讨论具体的如何根据.dsym文件解析crash log的方式. 什么是崩溃: 不希望出现的中断,APP收到了系统发出的unhandle signal,来源主要由系统内核,处理器,或者应用程序本身 ...

随机推荐

  1. 五款最优秀的java微服务框架

    微服务被广泛用于创建多功能的应用程序,通过组合每个功能部分并将它们逐层放在一个单元中.许多人可能没有意识到微服务是一组小型服务中制作单个应用程序的方法,每个服务都独立运行(进程). java微服务框架 ...

  2. sql 语句系列(删库跑路系列)[八百章之第七章]

    前言 最开心的章节,没有之一. 删除违反参照完整性的记录 EMP 是员工表,DEPT 是部门表 DEPTNO是部门编号 delete from EMP where not exists ( selec ...

  3. Phoenix 时区问题

    最近在测试flink从trino查询数据插入到phoenix5的功能,发现一个时间的问题: 明明插入的时间是 '1940-06-01',查询出来的时间会少一天,同样的 Timestamp 也会自动少掉 ...

  4. 13_总结Vue数据监测

    总结: Vue监视数据的原理:         1.vue会监视data中所有层次的数据         2.如何监视对象中的数据?             通过setter实现监视,且要在new V ...

  5. 力扣209(java&python)-长度最小的子数组(中等)

    题目: 给定一个含有 n 个正整数的数组和一个正整数 target . 找出该数组中满足其和 ≥ target 的长度最小的 连续子数组 [numsl, numsl+1, ..., numsr-1, ...

  6. 内含干货PPT下载|一站式数据管理DMS及最新解决方案发布

    ​简介: 今天主要给大家介绍一站式数据管理平台DMS以及解决方案的发布.议题包含企业数据管理当前的一些痛,DMS一站式数据管理平台以及其核心技术,实时数仓解决方案以及相应的应用实践. "数聚 ...

  7. 使用 Flink Hudi 构建流式数据湖

    ​简介: 本文介绍了 Flink Hudi 通过流计算对原有基于 mini-batch 的增量计算模型的不断优化演进. 本文介绍了 Flink Hudi 通过流计算对原有基于 mini-batch 的 ...

  8. Apache Hudi 在 B 站构建实时数据湖的实践

    ​简介: B 站选择 Flink + Hudi 的数据湖技术方案,以及针对其做出的优化. 本文作者喻兆靖,介绍了为什么 B 站选择 Flink + Hudi 的数据湖技术方案,以及针对其做出的优化.主 ...

  9. [PPT] WPS 提取 PPT 中的母版到另一份 PPT 中

    1. 打开 PPT. 2. 视图 - 幻灯片母版,在第一个 ppt 上面 "鼠标右键 - 复制" 来进行拷贝. 3. 打开目标 PPT,视图 - 幻灯片模板,快捷键 Ctrl + ...

  10. 修复 WPF 安装 WindowsAppSDK 库构建失败 NETSDK1082 和 NETSDK1112 找不到 win10-arm 失败

    通过在 WPF 项目上安装 WindowsAppSDK 库,可以让 WPF 使用上 Win10 及以上版本提供的 Windows Runtime 强大的 API 集和使用上更多的黑科技.本文记录在安装 ...