Skip to content
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

Make matching of R and native call stacks more robust #37

Open
krlmlr opened this issue Oct 13, 2019 · 1 comment
Open

Make matching of R and native call stacks more robust #37

krlmlr opened this issue Oct 13, 2019 · 1 comment
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@krlmlr
Copy link
Member

krlmlr commented Oct 13, 2019

@atheriel: Would you like to share your experience?

@krlmlr krlmlr added this to the 1.0.0 milestone Oct 13, 2019
@krlmlr krlmlr added the bug an unexpected problem or unintended behavior label Oct 13, 2019
@atheriel
Copy link
Contributor

atheriel commented Oct 13, 2019

Yes, here are a few observations from my experience:

  • Matching on Rf_eval itself sometimes has issues because that function actually does slightly more than just evaluate R code (e.g. finding the function). As a result, I tried to match only on the combination of Rf_eval + R_execClosure, which is actually where R pushes the new function onto its own stack.

  • Some "generic" functions are dispatched in C code (by tryDispatch) and skip the Rf_eval entirely, so I also had to match on those as well.

  • Some R "functions" are handled by the interpreter itself and do not appear in the Rprof stack at all, but show up in the C stack. For example c() usage appears with the do_c C symbol, and <- appears with the do_set C symbol.

  • I could only get sensible mixed-mode stacks if I deduplicated R-level calls to eval(). I was never able to determine why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants