Skip to content

Cancelling new addin causes crash #510

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

Closed
oliverbeagley opened this issue May 9, 2019 · 3 comments · Fixed by #511
Closed

Cancelling new addin causes crash #510

oliverbeagley opened this issue May 9, 2019 · 3 comments · Fixed by #511

Comments

@oliverbeagley
Copy link

The new addin does not exit properly when cancel is pressed.

Then console lines switch to starting with ?, pressing enter does nothing and typing any garbage in causes the session to crash.

Using esc to exit this state works though

Session info if required:

sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-apple-darwin18.5.0 (64-bit)
#> Running under: macOS Mojave 10.14.4
#> 
#> Matrix products: default
#> BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
#> LAPACK: /usr/local/Cellar/openblas/0.3.6_1/lib/libopenblasp-r0.3.6.dylib
#> 
#> locale:
#> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods  
#> [7] base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] compiler_3.6.0  backports_1.1.4 magrittr_1.5   
#>  [4] tools_3.6.0     pillar_1.3.1    rstudioapi_0.10
#>  [7] tibble_2.1.1    crayon_1.3.4    styler_1.1.1   
#> [10] pkgconfig_2.0.2 rlang_0.3.4     purrr_0.3.2    

Screenshots of the problem:

Screenshot 2019-05-09 at 10 54 51

Screenshot 2019-05-09 at 10 55 01

Screenshot 2019-05-09 at 10 55 08

Screenshot 2019-05-09 at 10 55 23

Screenshot 2019-05-09 at 10 56 58

@lorenzwalthert
Copy link
Collaborator

Thanks for reporting @oliverbeagley. I noted that during testing, but I thought it was a problem related to rstudioapi and I thought it will be fairly rare, so I did not look into it further. However, I was wrong. We can handle the exit properly in styler. Surprising that the ill-behaved state occurs only within with_handlers, and not before.

with_handlers({
      transformers <- eval(parse(text = new_style))
      style_text(c("a = 2", "function() {", "NULL", "}"))
    },
    error = function(e) {
      abort(paste0(
        "The selected style transformers \"",
        new_style, "\" is not valid: ", e$message
      ))
    }
    )

I have not experienced a crash of R tough. Just errors. Anyways, it should be fixe with #511. Do you want to test it?

@oliverbeagley
Copy link
Author

Yeah, thats fixed it on my end as well now.

For me it didn't crash the first few times, only when I restarted RStudio, then I couldn't get it to not crash.

@lorenzwalthert
Copy link
Collaborator

Ok, thanks. I'll close that then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants