Program terminated with signal 6, Aborted,有可能啥原因呢?

Posted zhjh256

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Program terminated with signal 6, Aborted,有可能啥原因呢?相关的知识,希望对你有一定的参考价值。

Program terminated with signal 6, Aborted,有可能啥原因呢?其中一种原因就是事实上的OOM(虽然/var/log/message中没有标明操作系统kill了进行,应该是进程内部初始化已申请内存时报错了,因为malloc的申请会被OS尽可能延后的分配,所以很有可能已经申请的内存早就OOM了,但是程序还可以运行一段时间,甚至很久,除非设置了lock in memory,比如jdk和oracle、mysql都支持这么做)

技术分享图片

 

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.

 in most cases SIGABRT was sent by libc trying to call free() on a non-initialized/corrupted pointer

It usually happens when there is a problem with memory allocation.

 

SIGABRT is commonly used by libc and other libraries to abort the program in case of critical errors. For example, glibc sends an SIGABRT in case of a detected double-free or other heap corruptions.

Also, most assert implementations make use of SIGABRT in case of a failed assert.

Furthermore, SIGABRT can be sent from any other process like any other signal. Of course, the sending process needs to run as same user or root.

 

参考:https://stackoverflow.com/questions/3413166/when-does-a-process-get-sigabrt-signal-6

 

以上是关于Program terminated with signal 6, Aborted,有可能啥原因呢?的主要内容,如果未能解决你的问题,请参考以下文章

How to run an manually installed program from terminals in Linux / Ubuntu

Qt error: fatal error: Killed signal terminated program cc1plus

C++: fatal error: Killed signal terminated program cc1plus的问题解决

Lab 1: Write a java program for the triangle problem and test the program with Junit.

进行数据库进程的杀死

JSON with C program