<div dir="auto"><div>FWIW, I have the same problem, which is what I reported here:<div dir="auto"><br></div><div dir="auto"><a href="https://github.com/RcppCore/Rcpp/issues/972#issuecomment-593291723">https://github.com/RcppCore/Rcpp/issues/972#issuecomment-593291723</a><br></div><div dir="auto"><br></div><div dir="auto">I haven't been able to solve it because I can't reproduce it (I don't have a Mac, and the Docker container with that R setup doesn't fail). </div><div dir="auto"><br></div><div dir="auto">In my case, it could be that the exception pointer ends up being null, like in this unrelated issue I found:</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/dart-lang/sdk/issues/38141">https://github.com/dart-lang/sdk/issues/38141</a><br></div><div dir="auto"><br></div><div dir="auto">But until I get access to a Mac, I won't be sure. </div><div dir="auto"><br></div>Regards, </div><div dir="auto">Alexis. <br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sun, Mar 22, 2020, 18:41 Venelin Mitov <<a href="mailto:vmitov@gmail.com">vmitov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for your quick response, Dirk!<br>
<br>
Concise and informative as usual.<br>
<br>
Best,<br>
Venelin<br>
<br>
Am So., 22. März 2020 um 17:57 Uhr schrieb Dirk Eddelbuettel <<a href="mailto:edd@debian.org" target="_blank" rel="noreferrer">edd@debian.org</a>>:<br>
><br>
><br>
> On 22 March 2020 at 17:30, Venelin Mitov wrote:<br>
> | 3. The line of code that is causing a segfault error and a crash of<br>
> | the R-process is a call to the<br>
> | std::logic_error() constructor. This line of code is found in the package's file<br>
> | src/QuadraticPoly.h:<br>
> |<br>
> | throw logic_error(oss.str());<br>
><br>
> I always recommend to Rcpp::stop() which I use extensively and almost exclusively.<br>
><br>
> | 4. However, throwing the above exception is correct - the<br>
> | exception is intercepted (caught) at a higher functional level of the<br>
> | PCMBaseCpp package, where it is handled. The same line of code is<br>
> | executed without problem on all other flavours.<br>
> |<br>
> | 5. Hence, my question is why std::logic_error(oss.str()) is<br>
> | throwing a memory allocation exception on this specific CRAN flavour?<br>
><br>
> I have no idea.<br>
><br>
> But excception handling is genuinely complicated. Feel free to peruse the old<br>
> issue ticket and pull request discussions at the Rcpp repo at GitHub -- there<br>
> is lots of it.<br>
><br>
> | I couldn't find anywhere in the R extension manual a text stating that<br>
> | it is illegal to create std::logic_error objects in C++ code. The<br>
><br>
> You missed that (at least parts of) R Core does not want us to use C++ in the<br>
> first place -- or that is how one could read the (still somewhat<br>
> "controversial" blog post [1]).<br>
><br>
> | fact that the same code is passing on all other flavours including<br>
> | rhub's fedora-clang suggests that this might be a local problem in the<br>
> | fedora-clang test environment on CRAN.<br>
> |<br>
> | Any advice on how I should proceed to prevent the package getting<br>
> | removed from CRAN?<br>
><br>
> Just because "it should work in theory" simply does not mean it will in<br>
> practice. If a CRAN test machine consistently shows errors, I most often try<br>
> to change my code [2]. You could at least try that.<br>
><br>
> A sad aspect in all this also is that we have no publically accessible<br>
> machine behaving exactly like that Fedora box.<br>
><br>
> | For you information, here is the stacktrace generated using gdb:<br>
><br>
> No there wasn't.<br>
><br>
> Standard GNU mailman mailing list setup so attachments are stripped.<br>
><br>
> Dirk<br>
><br>
> [1] <a href="http://developer.r-project.org/Blog/public/2019/03/28/use-of-c---in-packages/index.html" rel="noreferrer noreferrer" target="_blank">http://developer.r-project.org/Blog/public/2019/03/28/use-of-c---in-packages/index.html</a><br>
> [2] There are exceptions. I think the errors against anytime are a setup<br>
> issue at their end as it genuinely happens nowhere else.<br>
><br>
> --<br>
> <a href="http://dirk.eddelbuettel.com" rel="noreferrer noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank" rel="noreferrer">edd@debian.org</a><br>
<br>
<br>
<br>
-- <br>
Venelin MITOV<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank" rel="noreferrer">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" rel="noreferrer noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></blockquote></div></div></div>