HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 78 (of 101)
Chapter 11 Software Development
October 29, 2013
# echo core_addpid/W 0 | adb -w /stand/vmunix /dev/kmem
On HP-UX 11.31 and later, coreadm(1M) can be used by any user to define the name of the core
files created by his processes, e.g.
$ coreadm p core.%p
Will instruct the kernel to store all core files of this user as core.<PID>.
The reasons for not getting a core file can be:
The process has no write permissions in its working directory.
The limit for the maximum size of core files, ulimit c, is set to 0.
The program has caught the signal and exits without leaving a core file.
HP-UX 11.23 and later: The path where the core file would be written to includes a
symbolic link.
The programs real and effective user ID are not identical. This applies to setuid
programs or such that have changed their effective UID actively.
First check the obvious things like access permissions and ulimit c.
Then check for symbolic links, e.g. by changing to the process’ working directory and
comparing the output of pwd and pwd P (see sh-posix(1)). If both commands give a different
output, then the path contains a symbolic link. This is considered as a security risk, that’s why
HP-UX 11.23 and later will not allow the core dumping.
On 11.23 there is nothing you can do about this, except of making sure the path to the process’
working directory does not contain a symbolic link. With HP-UX 11.31 and later, the
coreadm(1M) can be used which allows setting various core file related attributes, e.g. a
dedicated directory where the core files will be written to. It can be used to circumvent the
symbolic link problem.
Coredumping of setuid programs also poses a security risk and will not be done, because
unauthorized users (the ones with the effective UID) would have read permissions to such a core
file, which could contain information that belongs to the user with the real UID. There is
however a kernel flag that can be set as root to allow core dumping of such processes:
# echo dump_all/W 1 | adb -w /stand/vmunix /dev/kmem
Make sure to reset this flag when no longer needed: