什么情况下会出现sigabrt崩溃,如何调试

什么情况下会出现sigabrt崩溃,如何调试,第1张

我们需要做的第一件事就是:不要惊慌。

修复崩溃不是很困难的。假如你崩溃了,并且胡乱的改些东西,而且还在不停的念着咒语希望bug神奇的自动消失,你大多数情况下都会使情况更麻烦。相反的,你需要知道一些系统的方法,并且学习怎么找到崩溃和他的原因。

第一件需要知道的就是在你的代码中准确的找到crash发生的地方:在那个文件,那一行。Xcode debugger将会帮助你,但是你需要懂得怎么样最好的使用它

Runtime Error 代号介绍 SIG (Signal,Linux系统信号) 部分: (4) SIGILL 执行了非法指令. 通常是因为可执行文件本身出现错误, 或者试图执行数据段.堆栈溢出时也有可能产生这个信号. (6) SIGABRT 程序自己发现错误并调用abort时产生. (6) SIGIOT 在PDP-11上由iot指令产生, 在其它机器上和SIGABRT一样. (7) SIGBUS 非法地址, 包括内存地址对齐(alignment)出错. eg: 访问一个四个字长的整数, 但其地址不是4的倍数. (8) SIGFPE 在发生致命的算术运算错误时发出. 不仅包括浮点运算错误, 还包括溢出及除数为0等其它所有的算术的错误. (11) SIGSEGV 试图访问未分配给自己的内存, 或试图往没有写权限的内存地址写数据. 造成这种错误的原因有很多,主要原因有三条: 一、数据下标越界,包括越上界和越下界。 二、堆栈溢出,比如递归层数过多。 三、不恰当的指针使用。 FPC (由Free Pascal 产生的错误代码): 由于OJ系统已经限制了程序的行为,所以以下部分代码并不会实际出现,此处列举仅仅为了文档相对完整。 1 Invalid function number 错误的功能代码 2 File not found 文件未找到 3 Path not found 目录未发现 4 Too many open files 打开太多的文件 5 File access denied 文件访问拒绝 6 Invalid file handle 错误的文件句柄 12 Invalid file access code 错误的文件访问代码 15 Invalid drive number 错误的驱动器数字 16 Cannot remove current directory 不能移动当前目录 17 Cannot rename across drives 不能跨越驱动器更改文件名 100 Disk read error 磁盘读错误 101 Disk write error 磁盘写错误 102 File not assigned 文件未曾建立关联 103 File not open 文件未打开 104 File not open for input 文件不能打开读数据 105 File not open for output 文件不能打开写数据 106 Invalid numeric format 错误的数字格式 从标准输入(Text文件)中预期得到的数字格式不对. 150 Disk is write-protected 151 Bad drive request struct length 152 Drive not ready 154 CRC error in data 156 Disk seek error 157 Unknown media type 158 Sector Not Found 159 Printer out of paper 160 Device write fault 161 Device read fault 162 Hardware failure 200 Division by zero 被除数为0. 201 Range check error 如果你编译你的程序时设置了方位检查,原因有可能是: 数组访问超过了声明的范围. 试图给一个变量赋值超过其范围(例如枚举类型). 202 Stack overflow error 栈溢出 栈增长超过了最大值 (in which case the size of local variables should be reduced to avoid this error), or the stack has become corrupt. 只有当栈检查时才出现该错误. 203 Heap overflow error 堆溢出 堆增长超过了上界. This is caused when trying to allocate memory exlicitly with New, GetMem or ReallocMem, or when a class or object instance is created and no memory is left. Please note that, by default, Free Pascal provides a growing heap, i.e. the heap will try to allocate more memory if needed. However, if the heap has reached the maximum size allowed by the operating system or hardware, then you will get this error. 204 Invalid pointer operation 错误的指针 *** 作 使用Dispose or Freemem 时使用错误的指针 (特别的, Nil) 205 Floating point overflow 浮点数上溢 你试图使用或产生一个太大实数. 206 Floating point underflow 你试图使用或产生一个太小实数. 207 Invalid floating point operation 错误的浮点数 *** 作 可能是你开平方根或者对数时使用负数. 210 Object not initialized 对象未初始化 When compiled with range checking on, a program will report this error if you call a virtual method without having called istr constructor. 211 Call to abstract method 212 Stream registration error 213 Collection index out of range 214 Collection overflow error 215 Arithmetic overflow error 数字超出范围 例如3000000000超出长整形范围 216 General Protection fault 217 Unhandled exception occurred 219 Invalid typecast 227 Assertion failed error 原文地址: http://www.tkz.org.ru/2009-02/runtime-error-%E4%BB%A3%E5%8F%B7%E4%BB%8B%E7%BB%8D/ 孔牛,分给我把~


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/7183014.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-02
下一篇 2023-04-02

发表评论

登录后才能评论

评论列表(0条)

保存