<div dir="ltr"><div>I believe the new toolchain uses SJLJ and not SEH specifically for backwards compatibility. <br><br></div>Avi<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 12, 2015 at 4:24 PM, JJ Allaire <span dir="ltr"><<a href="mailto:jj.allaire@gmail.com" target="_blank">jj.allaire@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just a note that Rf_error is actually not technically allowed in Rcpp<br>
(it's a longjmp which bypasses all C++ destructors on the stack). We<br>
do it as follows:<br>
<br>
Rcpp::stop("error message")<br>
<br>
Which throws an exception which is ultimately caught by our wrapper<br>
macro (which then calls Rf_error in a context where there are no more<br>
destructors).<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Thu, Mar 12, 2015 at 4:16 PM, Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br>
><br>
> Duncan,<br>
><br>
> The preferred and widely-documented address for Rcpp issues is rcpp-devel<br>
> where I am forwarding this, I would appreciate keeping follow-up there.<br>
><br>
> On 12 March 2015 at 15:11, Duncan Murdoch wrote:<br>
> | Jack (and Dirk):<br>
> |<br>
> | I see this as well when I recompile Rcpp.<br>
> |<br>
> | Dirk: We're seeing the Rgui console on Windows lock up in 64 bit<br>
> | Windows with a program calling Rf_error from Rcpp, but not from a simple<br>
> | C program (attached) that looks equivalent. This is using the new<br>
> | toolchain, both to compile Rcpp and Jack's cppFunction() call below.<br>
> |<br>
> | I'd be happy to help with debugging this, but not for a few days: I'll<br>
> | be out of the office until Wednesday next week, and I don't have 64 bit<br>
> | Windows when I'm on the road.<br>
><br>
> Sure. We can pick this up when you are back. The change vector appears to<br>
> be on your side of the fence so we need access from your end. Few of us (on<br>
> the Rcpp core group) use Windows all that much.<br>
><br>
> I think I saw a blog post mentioned where someone said that with g++ 4.9.2<br>
> (though possibly a different build/configuration/...) some exception-related<br>
> behaviour was improved. I am sure that something is different now, and we<br>
> will try to accomodate it.<br>
><br>
> Safe travels.<br>
><br>
> Dirk<br>
><br>
> |<br>
> | Duncan Murdoch<br>
> |<br>
> | On 12/03/2015 2:54 PM, Duncan Murdoch wrote:<br>
> | > On 12/03/2015 1:31 PM, Jack Wasey wrote:<br>
> | > > Dear Duncan,<br>
> | > ><br>
> | > > I hope you don't mind me emailing you directly, rather than through<br>
> | > > r-devel, since it seemed a very specific problem. I had just sent an<br>
> | > > email to the list when it crossed with yours saying you had released a<br>
> | > > new Rtools, so I pulled my r-devel email. I have a probable R,<br>
> | > > possible Rcpp bug causing a hang with Rf_error("stop") after showing<br>
> | > > the error message, but only with 64 bit Rtools 3.3 (downloaded a few<br>
> | > > hours ago).<br>
> | > ><br>
> | > > I'm afraid my reproducible example uses Rcpp, but only for<br>
> | > > compilation. I'm not adept enough to eliminate the Rcpp step quickly,<br>
> | > > but I hope it will be of use anyway.<br>
> | > ><br>
> | > > Rcpp::cppFunction("void doError() { Rf_error(\"stopping\"); }")<br>
> | > > doError()<br>
> | > ><br>
> | > > This causes a hang after showing the error message. Winbuilder checked<br>
> | > > my package "icd9" without problems in 32 bit R-devel, and both 32 and<br>
> | > > 64 bit R current.<br>
> | > ><br>
> | > > Not being sure whether this is an Rcpp or R bug (see also<br>
> | > > <a href="https://github.com/RcppCore/Rcpp/issues/276" target="_blank">https://github.com/RcppCore/Rcpp/issues/276</a>), I hesitated to report<br>
> | > > this as a bug against R itself, but perhaps people more skilled than<br>
> | > > me can do this if indeed it is so.<br>
> | ><br>
> | > I see the same problem. I've just tried the equivalent as a simple C<br>
> | > program, and it was fine. I will try compiling Rcpp and see if that<br>
> | > fixes it; I wouldn't be surprised if the binary on CRAN was built with<br>
> | > the old compiler.<br>
> | ><br>
> | > Duncan Murdoch<br>
> | > ><br>
> | > > Best wishes,<br>
> | > > Jack<br>
> | > ><br>
> | > > On Thu, Mar 12, 2015 at 1:17 PM, Duncan Murdoch<br>
> | > > <<a href="mailto:murdoch.duncan@gmail.com">murdoch.duncan@gmail.com</a>> wrote:<br>
> | > > > I've just uploaded a minor update (3.3.0.1957) to Rtools33, adding the<br>
> | > > > cygpath.exe utility. That utility converts between Windows style paths like<br>
> | > > > D:/Rtools and Cygwin style paths like /cygdrive/d/Rtools. It may be useful<br>
> | > > > in configuration files if your external library expects to find gcc on the<br>
> | > > > path, since Rtools no longer puts it there. Assuming you want to use the<br>
> | > > > Rtools toolchain, you can construct the path to the gcc directory in your<br>
> | > > > Makevars.win file as<br>
> | > > ><br>
> | > > > $(cygpath $(RTOOLS))gcc492_$(WIN)/bin<br>
> | > > ><br>
> | > > > (where RTOOLS and WIN are macros from RHOME/etc/*/Makeconf that should<br>
> | > > > already have been read.)<br>
> | > > ><br>
> | > > > Thanks to JJ Allaire for the prompting on this.<br>
> | > > ><br>
> | > > > Duncan Murdoch<br>
> | > > ><br>
> | > > > ______________________________________________<br>
> | > > > <a href="mailto:R-devel@r-project.org">R-devel@r-project.org</a> mailing list<br>
> | > > > <a href="https://stat.ethz.ch/mailman/listinfo/r-devel" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-devel</a><br>
> | ><br>
> |<br>
> | [DELETED ATTACHMENT test.c, plain text]<br>
><br>
> --<br>
> <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
> _______________________________________________<br>
> Rcpp-devel mailing list<br>
> <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote></div><br></div>