1831641 Members
1884 Online
110027 Solutions
New Discussion

corefiles as core.<pid>

 
SOLVED
Go to solution
Vic S. Kelan
Regular Advisor

corefiles as core.<pid>

Hi All
One of our developers would want the kernel configured to write corefiles as core.

I did a google and found this
"Subject: 8.49 How do I configure the kernel to write corefiles as core.?
Added: 07/24/02

If you are using 11.00 or later, set the 'core_addpid' kernel parameter to a non-zero value. The kernel will now create corefiles as core.. SAM can be used to easily modify kernel paramters. Note, a reboot will be necessary."

My question is, what is the benefit of doing this change on core_addpid? Other than knowing the PIDs? Any Gothhas I should thnk of?

thanks ALL
8 REPLIES 8
Stephen Keane
Honored Contributor

Re: corefiles as core.<pid>

Your filesystems will fill up if you generate a lot of core files.

To find core files you'll need to look cor core.* rather than core.

If a process has core-dumped and exited, knowing it's pid doesn't really help, although running file against the core will tell you the name of the process that produced it.
Victor BERRIDGE
Honored Contributor

Re: corefiles as core.<pid>

Hi,
Well it "could" be handy in some occasions but from a developper I see more the issue side of it: instead of having 1 core file overwritten again and again because of a bug you will end up with a file system full....

Just thoughts

All the best
Victor
A. Clay Stephenson
Acclaimed Contributor

Re: corefiles as core.<pid>

The benefit, is that it becomes much more unlikely that a core file of interest will be overwritten. Normally, when debugging, the core file is mv'ed or copied to a safe location to prevent it's accidental overwrite. The downside is that now the debugger user must specify the corefile because the default 'core' will not be found. Also, because multiple core files will now be written, it's much easier to fill up a filesystem. If you have scripts which search for 'core' and delete them, they will need to be modified as well.
If it ain't broke, I can fix that.
Pete Randall
Outstanding Contributor

Re: corefiles as core.<pid>

Vic,

The main problem I see with this is that I can't find that kernel parameter anywhere in my 11.11 system!

Assuming there is such a thing, I can't really see that it would add any overhead. The only ill effect that I can think of is the chance of having multiple core files hanging around eating up space.


Pete

Pete
Stephen Keane
Honored Contributor

Re: corefiles as core.<pid>

Presumably you add it to the bottom of your system file and rebuild the kernel? SAM knows nothing about it. But the string is present in my current kernel. kmtune doesn't show it either.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: corefiles as core.<pid>

Because the command
echo "core_addpid/d" | adb /stand/vmunix /dev/kmem
works, this suggests that you could use adb to alter /dev/kmem on the fly to set core_addpid to 1.
If it ain't broke, I can fix that.
Vic S. Kelan
Regular Advisor

Re: corefiles as core.<pid>

Thanks for all the tips, I really appreciate all you inputs!!
Vic
Vic S. Kelan
Regular Advisor

Re: corefiles as core.<pid>

Hi Mr. Stephenson!

I am really tempted to rebuild my kernel to add the core_addpid but cant get your suggestion below outta my mind

"Because the command
echo "core_addpid/d" | adb /stand/vmunix /dev/kmem
works, this suggests that you could use adb to alter /dev/kmem on the fly to set core_addpid to 1."

Please how do I use adb to alter /dev/kmem on the fly to set core_addpid to 1? Not much experience with adb.....

Thanks
Vic