From blindglobe at gmail.com  Wed Apr 12 06:47:37 2006
From: blindglobe at gmail.com (A.J. Rossini)
Date: Wed, 12 Apr 2006 06:47:37 +0200
Subject: [Rd] Stack checking, core dumps, and embedding R
In-Reply-To: <E725DDAC-4044-4A6E-B9F6-007FAF7225DA@r-project.org>
References: <1abe3fa90604110234v1b4958c0w1e51e2b49f7ff9c5@mail.gmail.com>
	<E725DDAC-4044-4A6E-B9F6-007FAF7225DA@r-project.org>
Message-ID: <1abe3fa90604112147k7fd60700n7ad30a7409364621@mail.gmail.com>

On 4/12/06, Simon Urbanek <simon.urbanek at r-project.org> wrote:
> On Apr 11, 2006, at 5:34 AM, A.J. Rossini wrote:
>
> > I've been experiencing some interesting stack warnings recently
> > when moving from R 2.2.x to the R 2.3.0 series and the R 2.4.0
> > series.  In particular, I'm getting warnings of "Error: C stack
> > usage is too close to the limit" before segfaulting, and this
> > wasn't happening under the 2.2.x series.
> >
> > Here's the question statement:  (ONLY) In the situation where one
> > is embedding R, is anyone else seeing this occur with recent (past
> > 2 weeks) versions of R (both the 2.3.x and 2.4.x series)?
> >
>
> When embedding R, the stack base is set to -1 (which is almost
> certainly wrong) if R cannot find the stack base using some system
> method. I have just fixed the detection for OS X, so you shouldn't
> get that message there anymore. However, I was wondering why to not
> set it to something reasonable - even if we are not the main
> application, IMHO less harm is done setting it to something based on
> the current stack pointer than using -1. The status quo relies on the
> embedding application to set the stack base - I don't know if that's
> a good idea. Opinions?

Ah...   I see what you mean, Simon, which would explain the stack #'s
I was popping out (I'd changed the warning which occurs when stack is
within 5% (?) of max, to show me what it was talking about -- also,
your point explains why this happens nearly immediately.

Thanks all, I'd forgotten about ulimits.
best,
-tony

blindglobe at gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we can easily
roll-back your mistakes" (AJR, 4Jan05).



[Rd] Stack checking, core dumps, and embedding R
A.J. Rossini