LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   How to simulate crash to aquire coredump? (http://www.linuxquestions.org/questions/red-hat-31/how-to-simulate-crash-to-aquire-coredump-4175437355/)

khandu 11-15-2012 08:11 PM

How to simulate crash to aquire coredump?
 
Hi

We are running an ldap server on RHEL 6.. its run as user "user1"

in .bash_profile we have set

Code:

ulimit -c unlimited
to collect coredump on crash..


the system crashed (we think) and we had to restart the service. but we did not see any core dump file generated in home directory of user1.

Can we write some program and put it in crontab for "user1" which will crash in say 10 sec or so and then we can see if core dump file is generated or not?

We are not sure if our coredump settings are right or not.. when we login as "user1" and do "ulimit -a" we get
Quote:

core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 62830
max locked memory (kbytes, -l) 64
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) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

When we login as root we get

Quote:

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 62830
max locked memory (kbytes, -l) 64
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) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

How can we test our core dump?

Thing to note is : when we run a command of ldap as "user1" (which has a known bug) and gives us a segmentation fault (core dumped) .. we get the file in home directory

pan64 11-16-2012 02:07 AM

there are signals which cause coredump, for example kill -3 will do this.


All times are GMT -5. The time now is 11:07 AM.