Commit 891d6232 authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Debian changes 2.4.1-2

r-base (2.4.1-2) unstable; urgency=low

  * src/main.c: Applied patch provided by Samuel Thibault to allow builds
    on hurd-i386 which (still) lacks SA_SIGINFO. Bug report also forwarded
    upstream, and R 2.5.0 should have a fix too.	(Closes: #407358)
parent b68dfcd0
r-base (2.4.1-2) unstable; urgency=low
* src/main.c: Applied patch provided by Samuel Thibault to allow builds
on hurd-i386 which (still) lacks SA_SIGINFO. Bug report also forwarded
upstream, and R 2.5.0 should have a fix too. (Closes: #407358)
-- Dirk Eddelbuettel <edd@debian.org> Sat, 27 Jan 2007 13:12:13 -0600
r-base (2.4.1-1) unstable; urgency=low
* New upstream version released this morning
......
......@@ -440,10 +440,15 @@ static void win32_segv(int signum)
static unsigned char ConsoleBuf[CONSOLE_BUFFER_SIZE];
extern void R_CleanTempDir();
#ifdef SA_SIGINFO
static void sigactionSegv(int signum, siginfo_t *ip, void *context)
#else
static void sigactionSegv(int signum)
#endif
{
char *s;
#ifdef SA_SIGINFO
/* First check for stack overflow if we know the stack position.
We assume anything within 16Mb beyond the stack end is a stack overflow.
*/
......@@ -459,6 +464,7 @@ static void sigactionSegv(int signum, siginfo_t *ip, void *context)
jump_to_toplevel();
}
}
#endif
/* need to take off stack checking as stack base has changed */
R_CStackLimit = (unsigned long)-1;
......@@ -467,6 +473,7 @@ static void sigactionSegv(int signum, siginfo_t *ip, void *context)
REprintf("\n *** caught %s ***\n",
signum == SIGILL ? "illegal operation" :
signum == SIGBUS ? "bus error" : "segfault");
#ifdef SA_SIGINFO
if(ip != (siginfo_t *)0) {
if(signum == SIGILL) {
......@@ -539,6 +546,7 @@ static void sigactionSegv(int signum, siginfo_t *ip, void *context)
}
REprintf("address %p, cause '%s'\n", ip->si_addr, s);
}
#endif
{ /* A simple customized print of the traceback */
SEXP trace, p, q;
int line = 1, i;
......@@ -603,9 +611,17 @@ static void init_signal_handlers()
warning("failed to set alternate signal stack");
} else
warning("failed to allocate alternate signal stack");
#ifdef SA_SIGINFO
sa.sa_sigaction = sigactionSegv;
#else
sa.sa_handler = sigactionSegv;
#endif
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_ONSTACK | SA_SIGINFO;
sa.sa_flags = SA_ONSTACK
#ifdef SA_SIGINFO
| SA_SIGINFO
#endif
;
sigaction(SIGSEGV, &sa, NULL);
sigaction(SIGILL, &sa, NULL);
#ifdef SIGBUS
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment