[Rcpp-devel] Rf_error and Rcpp
edd at debian.org
Tue May 4 18:24:48 CEST 2010
On 4 May 2010 at 18:02, Romain Francois wrote:
| Le 04/05/10 15:18, Douglas Bates a écrit :
| > As I understand it, we are still at risk of code in the R API that we
| > call in turn calling Rf_error, right? That will have the same effect
| > of leaving the C++ exception stack in an inconsistent state?
| Yes. While we do our best to isolate this problem, it is still a
| We need to track down all calls to R APIs in Rcpp and be careful about
| potential jumps. This is probably going to be difficult to track, fix or
| even test that we fixed it, because apparently the incubating period is
| unpredictable (if I understand what Simon wrote) and the symptoms could
| be quite unrelated. should be fun.
| One thing I am not sure at all is how the old api behaves with regards
| to exceptions and R error mechanism, and I'm not volunteering to look.
A bit of separation of church and state -- the old API was used mostly in
what I tend to call 'vertical mode': called from R in a synchronous manner,
does some work, returns. This leaves less scope for errors as the code was
mostly in C++ outside the R API. Also, most calls were from try / catch
The new API is more ambitious and allows for more things in C++ and R
interchangeably (and I tend to call that 'horizontal') so there is indeed a
possibility of jumping put at the wrong time.
I'm not entirely sure how to make this water-tight.
More information about the Rcpp-devel