Chinaunix首页 | 论坛 | 博客
  • 博客访问: 336747
  • 博文数量: 135
  • 博客积分: 4637
  • 博客等级: 上校
  • 技术积分: 1410
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 13:22
文章分类

全部博文(135)

文章存档

2013年(12)

2012年(14)

2011年(42)

2010年(22)

2009年(18)

2008年(27)

分类: LINUX

2011-01-18 10:53:14

Step-by-step restoration of core on Fedora 13

  1. Get rid of that annoying abrtd:
    sudo service abrtd stop
    
  2. Just go away abrtd and don't trouble me any more:
    sudo chkconfig --del abrtd
    
  3. Edit /etc/sysctrl.conf and change
    kernel.core_pattern = |/usr/libexec/abrt-hook-ccpp /var/spool/abrt %p %s %u %c
    
    to
    kernel.core_pattern = core
    
  4. Edit /etc/security/limits.conf and add the line
    *  soft  core  unlimited
    
    (Yeah, "soft core". Actually "hard core" is legal too.)
  5. Finally, edit /etc/init.d/functions if necessary:
    	# make sure it doesn't core dump anywhere unless requested
    	corelimit="ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0}"
    
    That step appears to be unnecessary.
  6. Now create a program that drops core. (I assume that the reader already knows how.)

After steps above

[alison@bonnet ~]$ ulimit -c unlimited
[alison@bonnet kernel_char]$ ./bit_palindrome
Segmentation fault (core dumped)

Finally! A file called core.$PID will be dropped in $CWD. Now the user can "gdb $EXECUTABLE $CORE" to heart's content.

阅读(549) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~