From nakama at ki.rim.or.jp  Wed Oct  5 17:30:27 2005
From: nakama at ki.rim.or.jp (Ei-ji Nakama)
Date: Thu, 06 Oct 2005 00:30:27 +0900 (JST)
Subject: [Rd] R crashes for large formulas in lm() (PR#8180)
In-Reply-To: <Pine.LNX.4.61.0510051327310.25562@gannet.stats>
References: <Pine.LNX.4.61.0510051256110.24974@gannet.stats>
	<4343C2A5.2060102@lancaster.ac.uk>
	<Pine.LNX.4.61.0510051327310.25562@gannet.stats>
Message-ID: <20051006.003027.884028680.nakama@ki.rim.or.jp>

Hi,

Wed, 5 Oct 2005 13:38:12 +0100 (BST)
Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote.
> This is almost certainly C stack overflow, which will be _very_ 
> OS-specific. I can run this 9-var example in Linux with a stacksize of 
> 30Mb, but not the default 10Mb. I tried it with the default stack under 
> valgrind, and it works.
> 
> Windows versions of R have I believe a stack of 8Mb, and so I suspect are 
> running close to that with 8-var example.
> 
> The problem appears to be recursion in StripTerm.

default of stack of ld for Mingw seems to be 2M.
see. binutils-2.16.91-20050827-1/ld/emultempl/pe.em
   289    D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000),

How about adding the following to MkRules?
MINGW32LDFLAG=-Wl,--stack=33554432
--
http://www.nakama.ne.jp
e-mail : EIJI Nakama <nakama at ki.rim.or.jp>



[Rd] R crashes for large formulas in lm() (PR#8180)
Ei-ji Nakama