zoukankan      html  css  js  c++  java
  • core dump

    一.core dump配置
    [root@scctmpdev:/root]#grep pattern /etc/sysctl.conf
    kernel.core_pattern = corefile/core-%e
    这个表示dump文件在可执行应用的相对目录的corefile下
    [root@scctmpdev:/root]#ulimit  -c
    102400

    二.测试core dump
    [root@scctmpdev:/root]#cat test.c
    #include <stdio.h>
    #include <stdlib.h>
    int main(int argc,char** argv)
    {
    int a,b, result;
    a = 2;
    b = 0;
    result = a/b;
    return 0;
    }
    [root@scctmpdev:/root]#gcc -g test.c  -o test
    [root@scctmpdev:/root]#ll co
    config.log   context.xml  corefile/    
    [root@scctmpdev:/root]#ll corefile/
    total 0
    [root@scctmpdev:/root]#ll test
    -rwxr-xr-x 1 root root 7734 Jan 29 17:06 test
    [root@scctmpdev:/root]#./test
    Floating point exception (core dumped)
    --运行test可执行文件时发生异常进而产生dump,如下。
    [root@scctmpdev:/root]#ll corefile/
    total 96
    -rw------- 1 root root 188416 Jan 29 17:06 core-test

  • 相关阅读:
    php高效率写法
    php经典bug
    cideogniter部署到阿里云服务器出现session加载错误
    linux gcc编译protocol
    linux权限问题
    http协议详解
    哈希表
    c语言函数
    socket相关函数
    构建之法阅读笔记05
  • 原文地址:https://www.cnblogs.com/dotagg/p/8378554.html
Copyright © 2011-2022 走看看