Operating System - HP-UX
1834149 Members
2047 Online
110064 Solutions
New Discussion

Re: What dteremines/controls core file location - HPUX

 
SOLVED
Go to solution
Tim Killinger
Regular Advisor

What dteremines/controls core file location - HPUX

We're Fairly new to unix/UX system administration. What are the determinants of core file placement? Can the programmer specify the directory/location that any possible corefiles will be placed? Or is it determined by the location of the code that might cause the core dump? In other words, can the location of core dumps be fully controlled?

Thanks!
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: What dteremines/controls core file location - HPUX

The current working directory.
If it ain't broke, I can fix that.
Geoff Wild
Honored Contributor

Re: What dteremines/controls core file location - HPUX

Usually, cores are placed in the current working directory...

Have a look at:

ulimit

You can use it to limit the size of core dumps:

To completely suppress core dumps:

Bourne-style shells: "ulimit -c 0"
C-style shells: "limit coredumpsize 0"

If you want to limit dumps to a specific size, specify a number instead of 0, in blocks for Bourne-style shells, or kilobytes for C-style shells.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Prashant Zanwar_4
Respected Contributor

Re: What dteremines/controls core file location - HPUX

The HP-UX system writes out a file containing a core image of a
terminated process when certain signals are received (see signal(5)for the list of reasons). The most common causes are memory
violations, illegal instructions, floating point exceptions, bus errors, and user-generated quit signals. The core image file is called core and is written in the process's working directory (provided it is allowed by normal access controls)

Thanks
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Geoff Wild
Honored Contributor

Re: What dteremines/controls core file location - HPUX

I don't know if this works on HP-UX, but you can try:

The environment variable CORE_PATH can be used to change this default location.

% setenv CORE_PATH /usr/develop/corefiles

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor

Re: What dteremines/controls core file location - HPUX

In HP-UX it's just the CWD provided that the process has write permissions in the CWD and can overwrite any previously existing core file. More ver because the file is simply 'core' rather than, for example, core.12345 (core.PID) the last program crash wins. Man 4 core for details.
If it ain't broke, I can fix that.