1833053 Members
2347 Online
110049 Solutions
New Discussion

sudo and core dump

 
vladimir gershman
Occasional Advisor

sudo and core dump

Hello,

I am using sudo to run a program that is supposed to generate a core file. However, if I use "-b" option, the core file is NOT dumped. Without "-b" I do get a message about "Segmentation fault", but I cannot find the core file. Is this a sudo issue?

Thanks,

Vlad
5 REPLIES 5
Ramkumar Devanathan
Honored Contributor

Re: sudo and core dump

Does the effective id of the running process allow the process to dump core in the current directory?

check the permissions of the current directory and then try to run the sudo command once again.

I don't think this is a problem of sudo.

- ramd.
HPE Software Rocks!
Steve Steel
Honored Contributor

Re: sudo and core dump

Hi

I agree that this is a permission fault.


As owner of tyhe directory do
touch core
chmod 777 core


Then try again.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
H.Merijn Brand (procura
Honored Contributor

Re: sudo and core dump

Beware the the program started with sudo may well chdir before dumping core :)

so maybe better first do a 'su' to the user and start the process manually, maybe it gives more info about the process' whereabouts.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
vladimir gershman
Occasional Advisor

Re: sudo and core dump

Actually, the problem was that the version I use, 1.6.6, uses setrlimit to set coredump size to 0. It is fixed by commenting out a line below in the config.h file of sudo.
#define HAVE_SETRLIMIT 1

Thank you all.

Ramkumar Devanathan
Honored Contributor

Re: sudo and core dump

Thanks for letting us know too.

- ramd.
HPE Software Rocks!