This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: Empty core dump file
- From: "Worley, Dale R (Dale)" <dworley at avaya dot com>
- To: David Aldrich <David dot Aldrich at EMEA dot NEC dot COM>, "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Fri, 2 Sep 2011 10:35:23 -0400
- Subject: RE: Empty core dump file
- References: <41302A7145AC054FA7A96CFD03835A0A047BD8@EX10MBX02.EU.NEC.COM> <20110826131657.GW25065@radix50.net>,<41302A7145AC054FA7A96CFD03835A0A049A74@EX10MBX02.EU.NEC.COM>
> From: David Aldrich [David.Aldrich@EMEA.NEC.COM]
>
> This is a file permissions problem because if I mount the shared
> folder with a specific uid the core file is correctly saved. So I
> must use a mount command such as:
>
> mount -t vboxsf -o rw,uid=1000,gid=1000 SVNProj /media/SVNProj
>
> which I store in /etc/rc.local
>
> If I omit uid the core file becomes empty.
>
> The problem with this is that I must customise the mount command for
> each user, i.e. mount needs their uid.
>
> Is there a better solution for this problem please?
As you say, this is a file permission problem. By default, the core
file is writtin in the current directory of the process that has
crashed; if the crashing process cannot write into its current
directory, a core file cannot be generated.
The ideal solution is to have the current directory be writable by the
process, as that is by far the commonest situation in Un*x operations,
and there are likely to be other standard system management operations
that fail if the process cannot write its current directory.
Can you arrange your processes to not change their current directory
to /media/SVNProj? Or if you really intend every user to be able to
write into /media/SVNProj, change the permissions on that directory so
they can.
Another approach would be to have the core files written in another
directory. I'm not sure of the details but the manual page core(5)
says that with 2.6 kernels and 2.4 kernels after 2.4.21, there is a
/proc/sys/kernel/core_pattern file that seems to allow specification
of the directory for the core file. So you could do
echo '/tmp/core.%p' >/proc/sys/kernel/core_pattern
and have all core files written into the /tmp directory.
Dale