一个进程什么时候得到SIGABRT(信号6)? [英] When does a process get SIGABRT (signal 6)?

查看:343
本文介绍了一个进程什么时候得到SIGABRT(信号6)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

进程在C ++中获取SIGABRT的场景是什么?这个信号是否始终来自过程,或者这个信号可以从一个进程发送到另一个进程?



有没有办法确定哪个进程发送这个信号? / p>

解决方案

abort()发送调用进程 SIGABRT 信号,这是如何 abort()基本上工作。



abort()通常由库函数调用,用于检测内部错误或某些严重破坏的约束。例如如果其内部结构被堆溢出损坏,malloc()将调用 abort() >

What are the scenarios where a process gets a SIGABRT in C++? Does this signal always come from within the process or can this signal be sent from one process to another?

Is there a way to identify which process is sending this signal?

解决方案

abort() sends the calling process the SIGABRT signal, this is how abort() basically works.

abort() is usually called by library functions which detect an internal error or some seriously broken constraint. For example malloc() will call abort() if its internal structures are damaged by a heap overflow.

这篇关于一个进程什么时候得到SIGABRT(信号6)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆