While playing around with the Solaris process.max-core-size resource control last week, I noticed some interesting behavior. If you set the system wide maximum size of a core with projmod:
$ projmod -sK “process.max-core-size=(privileged,1048576,deny)”
system**
and then attempt to generate a core file:
$ su - test
$ ./coreme 2097152 &
Calling malloc() to allocate 2097152 bytes of heap space
[1] 2641
$ kill -ABRT 2641
The core file that is produced will match the value of the resource control:
$ ls -la core
-rw——- 1 test other 1048576 May 22 14:29 core
Now the interesting part. If you have global core file support enabled, the size of the core file written to the global core file directory is not limited in size:
$ ls -al /var/core
total 6692 drwxr-xr-x 2 root root 512 May 22 14:29 . drwxr-xr-x 44 root sys 1024 May 22 14:28 .. -rw——- 1 root root 3411254 May 22 14:29 core.coreme.2641
This is definitely something to watch out for, and it was a complete surprise to me.