0

CentOS release 6.10 (Final)

GNU gdb (GDB) Red Hat Enterprise Linux (7.2-92.el6)

My program is crashing, and generating a core dump. Unfortunately, it's trying to dump it in my home directory, which doesn't come close to having the space to hold it:

BFD: Warning: core.30906 is truncated: expected core file size >= 155732344832, found: 29430394880.

I need to set things so that when I launch my program, any core dump will go to a location I specify, where there is available room. I've looked here, but the answers seem to require sudo, and apply to all accounts. I need something that will work without root access, and applies only to my account.

  • 1
    I had a bit of a google on this and concluded (like yourself) that it can't be done. (But they said that heavier than air flight was impossible so I'm prepared to be corrected) It may be that it's a security thing - dumps are not encrypted and could contain passwords etc. So the sysadmin can control where dumps are located and who can read them. – wef Apr 3 at 6:16
1

You can use the /sbin/sysctl kernel.core_pattern without root access to view the current core file naming pattern.

If the pattern does not begin with a / character, the core file will be created relative to the current working directory of the program dumping the core. So if your program is at $HOME/myprogram, do this:

cd /location/with/enough/space/and/writable/for/you
$HOME/myprogram

Now the core dump should be generated in the desired location and not in $HOME.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.