1.第一种内存溢出
abort(): 函数首先解除进程对SIGABRT信号的阻止,然后向调用进程发送该信号。abort()函数会导致进程的异常终止除非SIGABRT信号被捕捉并且信号处理句柄没有返回
CorruptMalloc: 堆内存腐化,也就是说默认分配的内存地址很小,但是使用时却超过我们分配的空间(默认一般是不会崩溃的,但是超过一定数量的话就会造成崩溃,一般超过一个 PAGE_SIZE 大小就会崩溃),Xcode 一般提示如下错误: EXC_BAD_ACCESS (code=EXC_I386_GPFLT), 大牛解释:(Basically, the memory allocator allocates pages of memory at once for use by programs, and it gives you a pointer within them (making sure the following space is free for use). Since these pages are usually bigger than 8KiB, you have no issue in your mini-program. But if a larger program is allocating larger amounts of memory and writing further and further past the end of your allocated space, then you’ll end up attempting to write into unallocated memory (or memory used by another program!), thus corrupting memory.)
2.数据接收时,服务器返回数据不规范,如字典或数组元素中存在null,且客户端没做处理导致的崩溃。
3.内存管理不当,向野指针发送消息导致的崩溃。(此类bug最难解决,所以编码时谨慎)
一般报错为:EXC_BAD_ACCESS
4.数组越界
-[__NSArrayI objectAtIndex:]: index 100 beyond bounds [0 .. 99]'
5.数据集合类型,如字典、数组中插入元素时,插入空指针nil。
6、 userCorruptObject : 非法对象使用,(__bridge id)将一个 C 指针转换 OC 对象时容易出现,音视频领域常见该问题。