Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2005:
[Freeciv-Dev] Re: How can I get a core dump?
Home

[Freeciv-Dev] Re: How can I get a core dump?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Guido Ostkamp <freeciv@xxxxxxxxxxxxxxxxxxx>
Cc: Freeciv Developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: How can I get a core dump?
From: Peter Schaefer <peter.schaefer@xxxxxxxxx>
Date: Thu, 15 Sep 2005 23:51:04 +0200
Reply-to: peter.schaefer@xxxxxxxxx

Try looking at 
http://www.network-theory.co.uk/articles/gccdebug.html

Excerpt:
========
Some systems are configured not to write core files by default, since
the files can be large and rapidly fill up the available disk space on
a system. In the GNU Bash shell the command ulimit -c controls the
maximum size of core files. If the size limit is set to zero, no core
files are produced. The current size limit can be shown by typing the
following command:

$ ulimit -c
0

If the result is zero, as shown above, then it can be increased with
the following command to allow core files of any size to be written:

$ ulimit -c unlimited

Note that this setting only applies to the current shell. To set the
limit for future sessions the command should be placed in an
appropriate login file, such as '.bash_profile' for the GNU Bash
shell.
========



On 9/15/05, Guido Ostkamp <freeciv@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> On Thu, 15 Sep 2005, Christian Knoke wrote:
> > I crashed civserver, but cannot find the core file.
> >
> > I start civclient from the panel of the Gnome desktop in Debian Sarge.
> > .bashrc has ulimit -c unlimited
> 
> Make sure the current working directory of civclient is writable and there
> is no 'core' file belongin to another user in that directory.
> 
> This can be achieved by either not using chdir() and starting in a
> writable directory with no 'core' file or by setting up appropriate signal
> handler.
> 
> Example:
> 
> --- snip --- snap
> #include <signal.h>
> 
> void
> signal_handler(int sig)
> {
>         signal(SIGABRT, SIG_DFL);
>         chdir("/tmp");
>         abort();
> }
> 
> int
> main(void)
> {
>         int i;
>         int x, y, z;
>         for (i = 0; i < 30; i++)
>                 signal(i, signal_handler);
>         x = 1;
>         y = x-1;
>         z = x/y; /* crash it */
> }
> --- snip --- snap ---
> 
> On crash, this will chdir to /tmp (which should be writable as long there
> is no core file with another owner) and dump a core there.
> 
> Regards,
> 
> Guido
> 
> 
>



[Prev in Thread] Current Thread [Next in Thread]