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

HP-UX Handbook ā€“ Rev 13.00 Page 77 (of 101)
Chapter 11 Software Development
October 29, 2013
x.c version 0.1 from Jan 04 2002
$ PATCH/11.00:PHCO_24723 Sep 13 2001 05:01:45 $
92453-07 dld dld dld.sl B.11.30 011005
$
If the what(1) output does not end with the what string of dld/dl, the core file is incomplete
and canā€™t be used for debugging. A core file size of 2147483646 (2 GB - 2 Bytes) indicates a
missing largefiles option of the target file system. Any other size of an incomplete core file
would point to lack of disk space or an insufficient ulimit ā€“c setting.
The core file that a process would leave will approximately have the same size as the amount of
virtual memory the process is occupying at the time of the abort. The total VSS size in the
memory report of glance(1) (mainly Data VSS and Other VSS) is a good measure for that.
Make sure all limits are set high enough.
If you cannot provide enough free space in the file system, there are ways to redirect the core file
to a different location. In HP-UX 11.11 and earlier, you can create a symbolic link named core
to any other directory, e.g.
$ cd /pwd/of/the/program
$ ln ā€“s /dir/with/plenty/space/core .
The directory /dir/with/plenty/space must exist, while /dir/with/plenty/space/core
can be a regular file or must not exist. The core file will be written to
/dir/with/plenty/space/core then.
The same does not work in HP-UX 11.23 and later. If you try that, no core file will be written.
See further down in this paragraph for more information about not getting core files. In HP-UX
11.23 there is no way to make the kernel write the core file to a different location, but with 11.31
the command coreadm(1M) can be used to define the directory where the core file will be written
to.
Core file corruption can occur if multiple processes with the same working directory crash at the
same time, because all core files will be stored as $PWD/core. To avoid this, there is a kernel flag
which can be set as root, and which will make core files to be stored as $PWD/core.<PID>:
# echo core_addpid/W 1 | adb -w /stand/vmunix /dev/kmem
This flag will not be stored permanently. The setting will be lost after a reboot. It can also be
reset manually with