Skip to content
Prev 16226 / 63424 Next

segfault on large number of open brackets (PR#7859)

I suspect that is coincidence, as I can see no source change that would 
account for it.

2.0.1 and R-devel work for me and 2.1.0 segfaults with

999         KeepSource = *LOGICAL(GetOption(install("keep.source"), R_NilValue));
(gdb) bt
#0  0x080ca229 in ParseInit () at gram.y:999
#1  0x080cb305 in token () at gram.y:1530

I am not sure that is right, but I am pretty sure that

static char	contextstack[50], *contextp;

just above is an unchecked nesting limit, as in

static void IfPush(void)
{
     if (*contextp==LBRACE ||
 	*contextp=='['    ||
 	*contextp=='('    ||
 	*contextp == 'i')
 	    *++contextp = 'i';
}

However, although I thought this was the problem, it seems only to apply 
to nested if()s.  So I do not currently have a solution.
On Thu, 12 May 2005 andy_liaw@merck.com wrote: