rstudio / rstudio

RStudio is an integrated development environment (IDE) for R
https://posit.co/products/open-source/rstudio/
Other
4.58k stars 1.08k forks source link

RStudio crashes in certain situations with non-ASCII characters in R scripts #14700

Closed arne-henningsen closed 2 weeks ago

arne-henningsen commented 2 weeks ago

System details

RStudio Edition : Desktop
RStudio Version : RStudio 2024.04.0+735 "Chocolate Cosmos" Release (a00d0e775dbc93e0d79a1bf474e3e8e8de677383, 2024-04-24) for Ubuntu Jammy Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2024.04.0+735 Chrome/120.0.6099.291 Electron/28.2.6 Safari/537.36, Quarto 1.4.553
OS Version      : Ubuntu 22.04.4 LTS
R Version       : 4.4.0 (2024-04-24)

The file "diagnostics-report.txt" is attached below.

Steps to reproduce the problem

(a) Create an R script with the following content:

table( dat$, dat$år )

(b) Move the cursor to the first line of the R script between the dollar sign and the comma. (c) press the 'tab' key.

Describe the problem in detail

R / RStudio crashes: "R encountered a fatal error. The session was terminated." and "Unexpected exception [...]" (see attached screenshot) Screenshot_20240514_175916

The error only occurs in RStudio's "Files" pane. It does not occur in RStudio's "Console" or in basic R.

The error also occurs if a data.frame 'dat' actually exists. As a command for creating a data.frame is unnecessary for reproducing the bug, I omitted it to keep the reproducible example minimal.

It seems to me that the bug always occurs when one uses the 'tab' key for auto-completion in a command with a non-ASCII character in an argument.

Describe the behavior you expected

Do not crash but show a 'menu' for selecting a variable.

diagnostics-report.txt

ronblum commented 2 weeks ago

@arne-henningsen Thank you for raising this! This looks like a duplicate of #14625, which is fixed in the just-published patch, 2024.04.1+748, so I would recommend updating to it. https://posit.co/download/rstudio-desktop/

arne-henningsen commented 2 weeks ago

Thanks a lot! I can confirm that this bug has been fixed in version 2024.04.1+748 :-)