mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 12:05:47 +08:00
* cygheap.h (struct init_cygheap): Add rlim_core member.
* cygheap.cc (cygheap_init): Initialize rlim_core to RLIM_INFINITY. * exceptions.cc (stackdump): Drop extern declaration of rlim_core. Refer to cygheap->rlim_core instead. (exception::handle): Disable stackdumping if cygheap->rlim_core is 0. Don't set WCOREDUMP flag in exit code, if cygheap->rlim_core is 0. (sigpacket::process): Ditto. * resource.cc (rlim_core): Remove. (getrlimit): Fetch RLIMIT_CORE value from cygheap->rlim_core. (setrlimit): Store RLIMIT_CORE value in cygheap->rlim_core.
This commit is contained in:
parent
2ac91a1483
commit
9e40fe8112
@ -1,3 +1,16 @@
|
|||||||
|
2010-04-20 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* cygheap.h (struct init_cygheap): Add rlim_core member.
|
||||||
|
* cygheap.cc (cygheap_init): Initialize rlim_core to RLIM_INFINITY.
|
||||||
|
* exceptions.cc (stackdump): Drop extern declaration of rlim_core.
|
||||||
|
Refer to cygheap->rlim_core instead.
|
||||||
|
(exception::handle): Disable stackdumping if cygheap->rlim_core is 0.
|
||||||
|
Don't set WCOREDUMP flag in exit code, if cygheap->rlim_core is 0.
|
||||||
|
(sigpacket::process): Ditto.
|
||||||
|
* resource.cc (rlim_core): Remove.
|
||||||
|
(getrlimit): Fetch RLIMIT_CORE value from cygheap->rlim_core.
|
||||||
|
(setrlimit): Store RLIMIT_CORE value in cygheap->rlim_core.
|
||||||
|
|
||||||
2010-04-19 Christopher Faylor <me+cygwin@cgf.cx>
|
2010-04-19 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
* cygerrno.h: Nevermind.
|
* cygerrno.h: Nevermind.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* cygheap.cc: Cygwin heap manager.
|
/* cygheap.cc: Cygwin heap manager.
|
||||||
|
|
||||||
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc.
|
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
||||||
|
2010 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
@ -167,6 +168,7 @@ cygheap_init ()
|
|||||||
strcpy (cygheap->locale.charset, "UTF-8");
|
strcpy (cygheap->locale.charset, "UTF-8");
|
||||||
/* Set umask to a sane default. */
|
/* Set umask to a sane default. */
|
||||||
cygheap->umask = 022;
|
cygheap->umask = 022;
|
||||||
|
cygheap->rlim_core = RLIM_INFINITY;
|
||||||
}
|
}
|
||||||
if (!cygheap->fdtab)
|
if (!cygheap->fdtab)
|
||||||
cygheap->fdtab.init ();
|
cygheap->fdtab.init ();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* cygheap.h: Cygwin heap manager.
|
/* cygheap.h: Cygwin heap manager.
|
||||||
|
|
||||||
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc.
|
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
||||||
|
2010 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
@ -274,6 +275,7 @@ struct init_cygheap: public mini_cygheap
|
|||||||
cygheap_user user;
|
cygheap_user user;
|
||||||
user_heap_info user_heap;
|
user_heap_info user_heap;
|
||||||
mode_t umask;
|
mode_t umask;
|
||||||
|
unsigned long rlim_core;
|
||||||
HANDLE console_h;
|
HANDLE console_h;
|
||||||
cwdstuff cwd;
|
cwdstuff cwd;
|
||||||
dtable fdtab;
|
dtable fdtab;
|
||||||
|
@ -286,10 +286,9 @@ stack_info::walk ()
|
|||||||
static void
|
static void
|
||||||
stackdump (DWORD ebp, int open_file, bool isexception)
|
stackdump (DWORD ebp, int open_file, bool isexception)
|
||||||
{
|
{
|
||||||
extern unsigned long rlim_core;
|
|
||||||
static bool already_dumped;
|
static bool already_dumped;
|
||||||
|
|
||||||
if (rlim_core == 0UL || (open_file && already_dumped))
|
if (cygheap->rlim_core == 0UL || (open_file && already_dumped))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (open_file)
|
if (open_file)
|
||||||
@ -662,10 +661,13 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
|
|||||||
}
|
}
|
||||||
|
|
||||||
rtl_unwind (frame, e);
|
rtl_unwind (frame, e);
|
||||||
|
if (cygheap->rlim_core > 0UL)
|
||||||
|
{
|
||||||
open_stackdumpfile ();
|
open_stackdumpfile ();
|
||||||
dump_exception (e, in);
|
dump_exception (e, in);
|
||||||
stackdump ((DWORD) ebp, 0, 1);
|
stackdump ((DWORD) ebp, 0, 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (e->ExceptionCode == STATUS_ACCESS_VIOLATION)
|
if (e->ExceptionCode == STATUS_ACCESS_VIOLATION)
|
||||||
{
|
{
|
||||||
@ -683,7 +685,8 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
|
|||||||
? 0 : 4) | (e->ExceptionInformation[0] << 1));
|
? 0 : 4) | (e->ExceptionInformation[0] << 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
me.signal_exit (0x80 | si.si_signo); // Flag signal + core dump
|
/* Flag signal + core dump */
|
||||||
|
me.signal_exit ((cygheap->rlim_core > 0UL ? 0x80 : 0) | si.si_signo);
|
||||||
}
|
}
|
||||||
|
|
||||||
si.si_addr = (si.si_signo == SIGSEGV || si.si_signo == SIGBUS
|
si.si_addr = (si.si_signo == SIGSEGV || si.si_signo == SIGBUS
|
||||||
@ -1310,6 +1313,7 @@ exit_sig:
|
|||||||
c.ContextFlags = CONTEXT_FULL;
|
c.ContextFlags = CONTEXT_FULL;
|
||||||
GetThreadContext (hMainThread, &c);
|
GetThreadContext (hMainThread, &c);
|
||||||
use_tls->copy_context (&c);
|
use_tls->copy_context (&c);
|
||||||
|
if (cygheap->rlim_core > 0UL)
|
||||||
si.si_signo |= 0x80;
|
si.si_signo |= 0x80;
|
||||||
}
|
}
|
||||||
sigproc_printf ("signal %d, about to call do_exit", si.si_signo);
|
sigproc_printf ("signal %d, about to call do_exit", si.si_signo);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* resource.cc: getrusage () and friends.
|
/* resource.cc: getrusage () and friends.
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009 Red Hat, Inc.
|
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009, 2010 Red Hat, Inc.
|
||||||
|
|
||||||
Written by Steve Chamberlain (sac@cygnus.com), Doug Evans (dje@cygnus.com),
|
Written by Steve Chamberlain (sac@cygnus.com), Doug Evans (dje@cygnus.com),
|
||||||
Geoffrey Noer (noer@cygnus.com) of Cygnus Support.
|
Geoffrey Noer (noer@cygnus.com) of Cygnus Support.
|
||||||
@ -21,6 +21,7 @@ details. */
|
|||||||
#include "fhandler.h"
|
#include "fhandler.h"
|
||||||
#include "pinfo.h"
|
#include "pinfo.h"
|
||||||
#include "dtable.h"
|
#include "dtable.h"
|
||||||
|
#include "cygheap.h"
|
||||||
|
|
||||||
/* add timeval values */
|
/* add timeval values */
|
||||||
static void
|
static void
|
||||||
@ -109,8 +110,6 @@ getrusage (int intwho, struct rusage *rusage_in)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long rlim_core = RLIM_INFINITY;
|
|
||||||
|
|
||||||
extern "C" int
|
extern "C" int
|
||||||
getrlimit (int resource, struct rlimit *rlp)
|
getrlimit (int resource, struct rlimit *rlp)
|
||||||
{
|
{
|
||||||
@ -146,7 +145,7 @@ getrlimit (int resource, struct rlimit *rlp)
|
|||||||
rlp->rlim_max = OPEN_MAX_MAX;
|
rlp->rlim_max = OPEN_MAX_MAX;
|
||||||
break;
|
break;
|
||||||
case RLIMIT_CORE:
|
case RLIMIT_CORE:
|
||||||
rlp->rlim_cur = rlim_core;
|
rlp->rlim_cur = cygheap->rlim_core;
|
||||||
break;
|
break;
|
||||||
case RLIMIT_AS:
|
case RLIMIT_AS:
|
||||||
rlp->rlim_cur = 0x80000000UL;
|
rlp->rlim_cur = 0x80000000UL;
|
||||||
@ -182,7 +181,7 @@ setrlimit (int resource, const struct rlimit *rlp)
|
|||||||
switch (resource)
|
switch (resource)
|
||||||
{
|
{
|
||||||
case RLIMIT_CORE:
|
case RLIMIT_CORE:
|
||||||
rlim_core = rlp->rlim_cur;
|
cygheap->rlim_core = rlp->rlim_cur;
|
||||||
break;
|
break;
|
||||||
case RLIMIT_NOFILE:
|
case RLIMIT_NOFILE:
|
||||||
if (rlp->rlim_cur != RLIM_INFINITY)
|
if (rlp->rlim_cur != RLIM_INFINITY)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user