和CoreDumpDirectory不工作在Ubuntu上;让用PHP分段故障 [英] CoreDumpDirectory isn't working on ubuntu; getting segmentation fault with php

查看:228
本文介绍了和CoreDumpDirectory不工作在Ubuntu上;让用PHP分段故障的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图解决一个分段错误。出现在我的Apache的error.log中此消息:


  

[声明]儿童3979 PID退出信号
  分段错误(11)


我已经试过禁用某些Apache和PHP模块,但我仍然得到同样的错误。

我也试过把这个在apache2.conf:


  

和CoreDumpDirectory的/ tmp / Apache2的-GDB转储


,然后搭配chmod 777,CHOWN www数据......这样服务器可以写。

我看不出有什么核心转储文件给我上的错误提示。

没有任何人有一个想法,为什么和CoreDumpDirectory不工作在Ubuntu?


  

答案:$的ulimit -a
  核心文件大小结果
  (块,-c)无限数据赛格大小结果
  (千字节,-d)无限调度
  优先级(-e)0文件大小
  (块,-f)无限挂起信号
  (-i)15863最大锁定内存结果
  (千字节,-l)32最大内存大小结果
  (千字节,-m)无限打开文件的结果
  (-n)1024管道尺寸(512
  字节,-p)8 POSIX消息队列结果
  (字节,-q)819200实时优先级
  (-r)0堆栈大小结果
  (千字节,-S)8192的CPU时间结果
  (秒,-t)无限制用户
  流程(-u)15863
  虚拟内存(​​千字节,-v)
  无限的文件锁结果
  (-x)无限



解决方案

我终于能看到Apache的核心转储在Ubuntu:


  1. 编辑的/ etc /默认/ Apport会

  2. 编辑apache2.conf:

     和CoreDumpDirectory的/ tmp / Apache2的-GDB转储


  3. 确认Apache可以写它:

     #搭配chmod 777的/ tmp / Apache2的-GDB转储


  4. 删除核心转储大小限制:

     #的ulimit -c无限


  5. 另外,改变核心的名称模式转储:

     #回声。coredump-%E%P'>的/ proc / SYS /内核/ core_pattern


要分析转储使用 GDB

  $ GDB的Apache2 /tmp/apache2-gdb-dump/coredump-x.x

要看到堆栈跟踪信息,在GDB:

  GDB>哪里

这个我做到了,我所获得的核心转储。
然而,我的问题未通过查看信息转储解决;
这显然​​是在我的PHP脚本的问题。

更多信息:
http://matrafox.info/apache-child-pid-exit -signal分割-fault.html

I'm trying to solve a segmentation fault. This message appears in my apache-error.log:

[notice] child pid 3979 exit signal Segmentation fault (11)

I've tried disabling some apache and php modules but I'm still getting the same error.

I've also tried putting this in apache2.conf:

CoreDumpDirectory /tmp/apache2-gdb-dump

and then chmod 777, chown www-data... so that the server can write.

I can see no core-dump files to give me a hint on the error.

Does anybody have an idea why CoreDumpDirectory isn't working on Ubuntu?

answers: $ ulimit -a core file size
(blocks, -c) unlimited data seg size
(kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 15863 max locked memory
(kbytes, -l) 32 max memory size
(kbytes, -m) unlimited open files
(-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues
(bytes, -q) 819200 real-time priority (-r) 0 stack size
(kbytes, -s) 8192 cpu time
(seconds, -t) unlimited max user processes (-u) 15863 virtual memory (kbytes, -v) unlimited file locks
(-x) unlimited

解决方案

I finally was able to see Apache's core dump in Ubuntu:

  1. edit /etc/default/apport
  2. edit apache2.conf:

      CoreDumpDirectory /tmp/apache2-gdb-dump
    

  3. make sure Apache can write to it:

    # chmod 777 /tmp/apache2-gdb-dump
    

  4. remove core dump size limit:

    # ulimit -c unlimited
    

  5. Optionally, change the name pattern of the core dumps:

    # echo 'coredump-%e.%p' > /proc/sys/kernel/core_pattern
    

To analyse the dump use gdb:

$ gdb apache2 /tmp/apache2-gdb-dump/coredump-x.x

To see stacktrace details, in gdb:

gdb> where

This I did, and I obtained the core-dump. However, my problem was not solved by looking at the coredump; it was apparently an issue in my php script.

More info: http://matrafox.info/apache-child-pid-exit-signal-segmentation-fault.html

这篇关于和CoreDumpDirectory不工作在Ubuntu上;让用PHP分段故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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