-
Notifications
You must be signed in to change notification settings - Fork 35
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
C stack error are not caught #103
Comments
try(object.size(e), silent = T)
try(withCallingHandlers(object.size(e)), silent = T) but not in this one when an try(withCallingHandlers(object.size(e), error = function(e) NULL), silent = T) I don't know why yet. |
Saw this today:
|
Great! It seems we can just wait for the next release of R. Thanks for the info! |
While stackoverflow errors are now caught: e <- new.env()
attr(e, "e") <- e
tryCatch(object.size(e), error = function(err) err)
#> <CStackOverflowError: C stack usage 7953636 is too close to the limit> Created on 2024-01-11 with reprex v2.0.2.9000 And evaluate now "works", it still doesn't actually capture the error: evaluate::evaluate('
e <- new.env()
attr(e, "e") <- e
object.size(e)'
)
#> [[1]]
#> $src
#> [1] "\n"
#>
#> attr(,"class")
#> [1] "source"
#>
#> [[2]]
#> $src
#> [1] " e <- new.env()\n"
#>
#> attr(,"class")
#> [1] "source"
#>
#> [[3]]
#> $src
#> [1] " attr(e, \"e\") <- e\n"
#>
#> attr(,"class")
#> [1] "source"
#>
#> [[4]]
#> $src
#> [1] " object.size(e)"
#>
#> attr(,"class")
#> [1] "source" Created on 2024-01-11 with reprex v2.0.2.9000 This is likely due to the special nature of stackoverflow errors (because the stack is "full", it's hard to run any additional code wrapped around the error, so will likely require some careful extra handling). |
I'm pretty sure it's not possible to capture this error in evaluate itself |
I don't know if this is possible or not but currently we have this
This was reported in tidyverse/reprex#388
The text was updated successfully, but these errors were encountered: