-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup stack parsing / demangling #598
Conversation
LGTM -- @eddelbuettel, if things look good to you as well shall we merge? |
@kevinushey Sure. You could play fancypants and click on code review here. Not sure it buys much. One way to it via 'files' view and hit review changes. |
Thanks again. Works (of course) like a charm:
|
I'll probably roll this up as a (more clearly marked) 0.12.8.2 and stick it into the drat for the world to use. |
And for additional closure, full reverse-depends check over 850 packages (!!) showed no issues. Results committed to the usual rcpp-logs repo. |
The main cause of the errors was the logic at https://github.com/RcppCore/Rcpp/compare/master...jimhester:cppstack?expand=1#diff-f885be769bd30163f6d49bcfa6246690L44. If there was no
+
in the stack tracefind_last_of()
would returnstd::string::npos (-1)
and resizing to-2
is obviously an error.Some compiler versions return the stack trace in slightly different formats, so this error was only apparent with older gcc compilers. I modified the logic to retain more information (now only the demangled name is fixed, the rest of the information remains) and it should also be more robust to future formatting changes.
This was not noticed in previous releases because stack traces were only enabled if the
Rcpp::exception()
was constructed with a file and line. In #582 I modified the default constructor to also include the cpp stack trace, which revealed this bug. Also as noted my tests for the exception code did not include use ofRcpp::stop()
and this bug did not occur with standard expectations and direct call ofRcpp::exception()
. We now have an explicit test usingRcpp::stop()
as well.Fixes #596 and possibly #593 although that is as yet untested.