Procedure to Generate Core dump of a process in Linux system

Hello All,
I have one machine where some customized applications written in C++ (process) are getting hanged frequently.
In order analyze the same , I require to generate a core dump when the application starts responding slow or processing slow.

I have done the following to enable core dump of the system.

1) In /etc/security/limit.conf, I have enabled the following lines which are #shed.

•      * soft core 0
•      * hard core 0

and then save the file.

Run the following command at the time of hang but it did not create any core dump.

#kill -s SIFSEGV <PID of the hang process>

But it has not generate any core dump. I think I am doing some fundamental mistake being not aware much about it.

Can you help me to generate the same? I have gdb installed in my system.My RHEL version in 5.9.

I do not know much about it.Can somebody help me out to generate the core dump.
Member_2_7964709Senior EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dfkeCommented:
Hi,

To enable Core Dumps for new processes make the following entry in /etc/profile:

ulimit -c unlimited >/dev/null 2>&1

To enable a Core Dump for an already running process with let's say PID 34234 under RedHat:

cd /proc/34234/
[root@somehost 34234]# cat limits  | grep nice
Max nice priority         0                    0
[root@somehost 34234]# echo -n "Max nice priority=5:6" > limits
[root@somehost 34234]# cat limits  | grep nice
Max nice priority         5                    6

Or you can use prlimit:

[root@somehost 34234]# prlimit --core=1000000 --pid 34234
[root@somehost 34234]# prlimit --pid 34234 | grep CORE
CORE       max core file size                   1000000   1000000 bytes


Cheers
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dfkeCommented:
Both options I gave can be used. Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.