posit-dev / positron

Positron, a next-generation data science IDE
Other
2.41k stars 73 forks source link

Positron R exits session (exit code 0) and requests restart when running code, verified that it works in RStudio #4738

Open cpilat97 opened 20 hours ago

cpilat97 commented 20 hours ago

Type: Bug

Hi there, when i run the following code, the R session exits with exit code 0, I get a message that R 4.3.1 restarted, and then i have to start from the beginnig. I tried running the same code in RStudio ( RStudio 2024.04.0+735 for Windows), where it works as expected.

Weirdly, if i break the code into steps, it runs as you'd expect. It's only when piped together that it consistently stops and i need to restart the session. I cannot get past this part of the code.

Positron Version:

Positron Version: 2024.08.0 (system setup) build 48
Code - OSS Version: 1.91.0
Commit: ed616b36655fb24d116108bdd833f1321704315b
Date: 2024-08-19T03:30:12.447Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045

Steps to Reproduce Issue:

library(tidyverse)
# similar to the code i was running

mtcar_vars <- mtcars |> 
  filter(mpg > 14, !is.na(cyl)) |> 
  mutate_at("drat", as.character) |> 
  pull(drat)

# Trying the following doesn't work either 
mtcar_vars <- mtcars |> 
  filter(mpg > 14, !is.na(cyl)) |> 
  mutate(across(c(drat), as.character)) |> 
  pull(drat)

What i'm seeing:

image

Can i get it to work?

If i break it into two sub-steps it works:

library(tidyverse)

mtcar_1 <- mtcars |> 
  filter(mpg > 14, !is.na(cyl)) |> 
  mutate_at("drat", as.character)

mtcar_vec <- mtcar_1 |> 
  pull(drat)

What it looks like if i break into 2 processes:

image

Running on RStudio:

image

library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 4.3.3
#> Warning: package 'ggplot2' was built under R version 4.3.3
#> Warning: package 'tidyr' was built under R version 4.3.3
#> Warning: package 'readr' was built under R version 4.3.3
#> Warning: package 'dplyr' was built under R version 4.3.3

mtcar_vars <- mtcars |> 
  filter(mpg > 14, !is.na(cyl)) |> 
  mutate_at("drat", as.character) |> 
  pull(drat)

print(mtcar_vars)
#>  [1] "3.9"  "3.9"  "3.85" "3.08" "3.15" "2.76" "3.21" "3.69" "3.92" "3.92"
#> [11] "3.92" "3.07" "3.07" "3.07" "3.23" "4.08" "4.93" "4.22" "3.7"  "2.76"
#> [21] "3

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.1 (2023-06-16 ucrt)
#>  os       Windows 10 x64 (build 19045)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language (EN)
#>  collate  English_United States.utf8
#>  ctype    English_United States.utf8
#>  tz       America/New_York
#>  date     2024-09-18
#>  pandoc   3.1.11 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#> 

What i saw happen:

My R console stops, prints R 4.3.1 exited (exit code 0) and then i need to restart R.

What i expected to happen

The code to run and provide a vector of the variable i choose via pull. This code does work as expected in RStudio.

Dev Logs (can also attach):

orkbench.desktop.main.js:131176  INFO Restarting session 'Session R 4.3.1 (r-0a285c66) from runtime bfd0a6f2aa2e55ca67da684a2798c0c8 (language: R name: R 4.3.1 version: 4.3.1)' (Source: Restart requested from activity in the Console tab)
workbench.desktop.main.js:131176  INFO Starting session for language runtime bfd0a6f2aa2e55ca67da684a2798c0c8 (language: R name: R 4.3.1 version: 4.3.1) (Source: 'Restart Interpreter' command invoked)
workbench.desktop.main.js:131166 DEBUG [Ext host 0] Runtime manager for 'R 4.3.1': true
workbench.desktop.main.js:131176  INFO Creating positron.variables client 'positron-variables-r-24-c3c747d7'...
workbench.desktop.main.js:131176  INFO Creating positron.ui client 'positron-ui-r-25-d3fd35a5'...
workbench.desktop.main.js:131176  INFO Creating positron.help client 'positron-help-r-26-d73b2d8e'...
workbench.desktop.main.js:131196   ERR [Extension Host] Sending request failed.
workbench.desktop.main.js:62370 [Extension Host] Sending request failed. (at console.<anonymous> (c:\Program Files\Positron\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:64057:26))
log @ workbench.desktop.main.js:62370
$logExtensionHostMessage @ workbench.desktop.main.js:359639
S @ workbench.desktop.main.js:360338
Q @ workbench.desktop.main.js:360323
M @ workbench.desktop.main.js:360264
L @ workbench.desktop.main.js:360191
(anonymous) @ workbench.desktop.main.js:360054
B @ workbench.desktop.main.js:17771
fire @ workbench.desktop.main.js:17800
fire @ workbench.desktop.main.js:95609
port.onmessage @ workbench.desktop.main.js:383586
workbench.desktop.main.js:62370 [Extension Host] rejected promise not handled within 1 second: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed (at console.<anonymous> (c:\Program Files\Positron\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:64057:26))
log @ workbench.desktop.main.js:62370
$logExtensionHostMessage @ workbench.desktop.main.js:359639
S @ workbench.desktop.main.js:360338
Q @ workbench.desktop.main.js:360323
M @ workbench.desktop.main.js:360264
L @ workbench.desktop.main.js:360191
(anonymous) @ workbench.desktop.main.js:360054
B @ workbench.desktop.main.js:17771
fire @ workbench.desktop.main.js:17800
fire @ workbench.desktop.main.js:95609
port.onmessage @ workbench.desktop.main.js:383586
workbench.desktop.main.js:62370 [Extension Host] stack trace: Error: Cannot call write after a stream was destroyed
    at NodeError (node:internal/errors:406:5)
    at _write (node:internal/streams/writable:380:11)
    at Writable.write (node:internal/streams/writable:393:10)
    at c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:125041
    at new Promise (<anonymous>)
    at a.write (c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:124959)
    at y.doWrite (c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:112577)
    at c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:112472 (at console.<anonymous> (c:\Program Files\Positron\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:64057:26))
log @ workbench.desktop.main.js:62370
$logExtensionHostMessage @ workbench.desktop.main.js:359639
S @ workbench.desktop.main.js:360338
Q @ workbench.desktop.main.js:360323
M @ workbench.desktop.main.js:360264
L @ workbench.desktop.main.js:360191
(anonymous) @ workbench.desktop.main.js:360054
B @ workbench.desktop.main.js:17771
fire @ workbench.desktop.main.js:17800
fire @ workbench.desktop.main.js:95609
port.onmessage @ workbench.desktop.main.js:383586
workbench.desktop.main.js:491782 [vscode.positron-r]Cannot call write after a stream was destroyed
$onExtensionRuntimeError @ workbench.desktop.main.js:491782
S @ workbench.desktop.main.js:360338
Q @ workbench.desktop.main.js:360323
M @ workbench.desktop.main.js:360264
L @ workbench.desktop.main.js:360191
(anonymous) @ workbench.desktop.main.js:360054
B @ workbench.desktop.main.js:17771
fire @ workbench.desktop.main.js:17800
fire @ workbench.desktop.main.js:95609
port.onmessage @ workbench.desktop.main.js:383586
workbench.desktop.main.js:491783 Error: Cannot call write after a stream was destroyed
    at NodeError (node:internal/errors:406:5)
    at _write (node:internal/streams/writable:380:11)
    at Writable.write (node:internal/streams/writable:393:10)
    at c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:125041
    at new Promise (<anonymous>)
    at a.write (c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:124959)
    at y.doWrite (c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:112577)
    at c:\Program Files\Positron\resources\app\extensions\positron-r\dist\extension.js:1:112472
$onExtensionRuntimeError @ workbench.desktop.main.js:491783
S @ workbench.desktop.main.js:360338
Q @ workbench.desktop.main.js:360323
M @ workbench.desktop.main.js:360264
L @ workbench.desktop.main.js:360191
(anonymous) @ workbench.desktop.main.js:360054
B @ workbench.desktop.main.js:17771
fire @ workbench.desktop.main.js:17800
fire @ workbench.desktop.main.js:95609
port.onmessage @ workbench.desktop.main.js:383586
workbench.desktop.main.js:131166 DEBUG Comments: URIs of continue on comments to add to storage .
workbench.desktop.main.js:131166 DEBUG Comments: URIs of continue on comments to add to storage .

VS Code version: Positron 1.91.0 (ed616b36655fb24d116108bdd833f1321704315b, 2024-08-19T03:30:12.447Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz (12 x 2712)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.73GB (15.88GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (23) Extension|Author (truncated)|Version ---|---|--- jupyter|ms-|2024.6.0 js-debug-companion|ms-|1.1.3 better-comments|aar|3.0.2 auto-dark-mode-windows|dan|1.0.11 vscode-markdownlint|Dav|0.56.0 vsc-material-theme|Equ|34.4.0 vsc-material-theme-icons|equ|3.6.1 gitlab-workflow|Git|5.11.0 gc-excelviewer|Gra|4.2.58 rainbow-csv|mec|3.3.0 vscode-docker|ms-|1.29.2 vscode-dotnet-runtime|ms-|2.1.6 powershell|ms-|2024.2.2 indent-rainbow|ode|8.3.1 oracledevtools|Ora|23.4.1 publisher|pos|1.1.6 shiny|Pos|1.1.0 shinyuieditor|pos|0.5.0 vscode-xml|red|0.27.2024082510 vscode-yaml|red|1.15.0 rust-analyzer|rus|0.3.2112 rewrap|stk|1.16.3 pdf|tom|1.2.2
jennybc commented 19 hours ago

FWIW I cannot reproduce this on Windows.

petetronic commented 17 hours ago

Hi @cpilat97, I was able to reproduce this issue with Positron 2024.08.0 build 48 (which includes ARK 0.1.126) and using R 4.3.1 on Windows 11.

When I upgraded to Positron 2024.09.0 build 45 (which includes ARK 0.1.135) and using R 4.3.1, or 4.4.1, on windows 11, just as @jennybc mentioned, I also could no longer reproduce this issue.

zerodel commented 5 hours ago

I'm having a similar issue running the following code . it returns error R 4.4.1 exited (exit code 0) in postitron, but works fine in Rstudio .

Code to reproduce issue:

if(!require(BiocManager)){
  install.packages(BiocManager)
}

if(!require(pasilla)){

  BiocManager::install("pasilla")
}

library("pasilla")

pasCts <- system.file("extdata",
                    "pasilla_gene_counts.tsv",
                    package="pasilla", mustWork=TRUE)
pasAnno <- system.file("extdata",
                     "pasilla_sample_annotation.csv",
                     package="pasilla", mustWork=TRUE)
cts <- as.matrix(read.csv(pasCts,sep="\t",row.names="gene_id"))
coldata <- read.csv(pasAnno, row.names=1)
coldata <- coldata[,c("condition","type")]
coldata$condition <- factor(coldata$condition)
coldata$type <- factor(coldata$type)

rownames(coldata) <- sub("fb", "", rownames(coldata))

cts <- cts[, rownames(coldata)]

library("DESeq2")
dds <- DESeqDataSetFromMatrix(countData = cts,
                            colData = coldata,
                            design = ~ condition)

## everything is ok now
dds

dds <- DESeq(dds) ## error here
resultsNames(dds) # lists the coefficients

session info :

─ Session info ──────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.4.1 (2024-06-14 ucrt)
 os       Windows 11 x64 (build 22631)
 system   x86_64, mingw32
 ui       Rgui
 language (EN)
 collate  English_United States.utf8
 ctype    English_United States.utf8
 tz       Asia/Shanghai
 date     2024-09-19
 pandoc   3.2 @ C:\\PROGRA~1\\Quarto\\bin\\tools\\pandoc.exe

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────
 package              * version   date (UTC) lib source
 abind                  1.4-5     2016-07-21 [1] CRAN (R 4.4.0)
 annotate               1.82.0    2024-05-10 [1] Bioconductor 3.19 (R 4.4.0)
 AnnotationDbi        * 1.66.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 Biobase              * 2.64.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 BiocFileCache          2.12.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 BiocGenerics         * 0.50.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 BiocManager          * 1.30.25   2024-08-28 [1] CRAN (R 4.4.1)
 BiocParallel         * 1.38.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 biomaRt                2.60.1    2024-06-26 [1] Bioconductor 3.19 (R 4.4.0)
 Biostrings             2.72.1    2024-06-02 [1] Bioconductor 3.19 (R 4.4.0)
 bit                    4.0.5     2022-11-15 [1] CRAN (R 4.4.1)
 bit64                  4.0.5     2020-08-30 [1] CRAN (R 4.4.1)
 bitops                 1.0-8     2024-07-29 [1] CRAN (R 4.4.1)
 blob                   1.2.4     2023-03-17 [1] CRAN (R 4.4.1)
 cachem                 1.1.0     2024-05-16 [1] CRAN (R 4.4.1)
 cli                    3.6.3     2024-06-21 [1] CRAN (R 4.4.1)
 codetools              0.2-20    2024-03-31 [2] CRAN (R 4.4.1)
 colorspace             2.1-1     2024-07-26 [1] CRAN (R 4.4.1)
 crayon                 1.5.3     2024-06-20 [1] CRAN (R 4.4.1)
 curl                   5.2.2     2024-08-26 [1] CRAN (R 4.4.1)
 data.table             1.16.0    2024-08-27 [1] CRAN (R 4.4.1)
 DBI                    1.2.3     2024-06-02 [1] CRAN (R 4.4.1)
 dbplyr                 2.5.0     2024-03-19 [1] CRAN (R 4.4.1)
 DelayedArray           0.30.1    2024-05-08 [1] Bioconductor 3.19 (R 4.4.0)
 DESeq2               * 1.44.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 DEXSeq               * 1.50.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 digest                 0.6.37    2024-08-19 [1] CRAN (R 4.4.1)
 dplyr                  1.1.4     2023-11-17 [1] CRAN (R 4.4.1)
 fansi                  1.0.6     2023-12-08 [1] CRAN (R 4.4.1)
 fastmap                1.2.0     2024-05-15 [1] CRAN (R 4.4.1)
 filelock               1.0.3     2023-12-11 [1] CRAN (R 4.4.1)
 genefilter             1.86.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 geneplotter            1.82.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 generics               0.1.3     2022-07-05 [1] CRAN (R 4.4.1)
 GenomeInfoDb         * 1.40.1    2024-06-16 [1] Bioconductor 3.19 (R 4.4.0)
 GenomeInfoDbData       1.2.11    2024-08-14 [1] Bioconductor
 GenomicRanges        * 1.56.1    2024-06-12 [1] Bioconductor 3.19 (R 4.4.0)
 ggplot2                3.5.1     2024-04-23 [1] CRAN (R 4.4.1)
 glue                   1.7.0     2024-01-09 [1] CRAN (R 4.4.1)
 gtable                 0.3.5     2024-04-22 [1] CRAN (R 4.4.1)
 hms                    1.1.3     2023-03-21 [1] CRAN (R 4.4.1)
 httr                   1.4.7     2023-08-15 [1] CRAN (R 4.4.1)
 httr2                  1.0.3     2024-08-22 [1] CRAN (R 4.4.1)
 hwriter                1.3.2.1   2022-04-08 [1] CRAN (R 4.4.0)
 IRanges              * 2.38.1    2024-07-03 [1] Bioconductor 3.19 (R 4.4.1)
 jsonlite               1.8.8     2023-12-04 [1] CRAN (R 4.4.1)
 KEGGREST               1.44.1    2024-06-19 [1] Bioconductor 3.19 (R 4.4.0)
 lattice                0.22-6    2024-03-20 [2] CRAN (R 4.4.1)
 lifecycle              1.0.4     2023-11-07 [1] CRAN (R 4.4.1)
 locfit                 1.5-9.10  2024-06-24 [1] CRAN (R 4.4.1)
 magrittr               2.0.3     2022-03-30 [1] CRAN (R 4.4.1)
 Matrix                 1.7-0     2024-04-26 [2] CRAN (R 4.4.1)
 MatrixGenerics       * 1.16.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 matrixStats          * 1.4.1     2024-09-08 [1] CRAN (R 4.4.1)
 memoise                2.0.1     2021-11-26 [1] CRAN (R 4.4.1)
 munsell                0.5.1     2024-04-01 [1] CRAN (R 4.4.1)
 pasilla              * 1.32.0    2024-05-02 [1] Bioconductor 3.19 (R 4.4.1)
 pillar                 1.9.0     2023-03-22 [1] CRAN (R 4.4.1)
 pkgconfig              2.0.3     2019-09-22 [1] CRAN (R 4.4.1)
 png                    0.1-8     2022-11-29 [1] CRAN (R 4.4.0)
 prettyunits            1.2.0     2023-09-24 [1] CRAN (R 4.4.1)
 progress               1.2.3     2023-12-06 [1] CRAN (R 4.4.1)
 R6                     2.5.1     2021-08-19 [1] CRAN (R 4.4.1)
 rappdirs               0.3.3     2021-01-31 [1] CRAN (R 4.4.1)
 RColorBrewer         * 1.1-3     2022-04-03 [1] CRAN (R 4.4.0)
 Rcpp                   1.0.13    2024-07-17 [1] CRAN (R 4.4.1)
 rlang                  1.1.4     2024-06-04 [1] CRAN (R 4.4.1)
 Rsamtools              2.20.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 RSQLite                2.3.7     2024-05-27 [1] CRAN (R 4.4.1)
 S4Arrays               1.4.1     2024-05-20 [1] Bioconductor 3.19 (R 4.4.0)
 S4Vectors            * 0.42.1    2024-07-03 [1] Bioconductor 3.19 (R 4.4.1)
 scales                 1.3.0     2023-11-28 [1] CRAN (R 4.4.1)
 sessioninfo            1.2.2     2021-12-06 [1] CRAN (R 4.4.1)
 SparseArray            1.4.8     2024-06-02 [1] Bioconductor 3.19 (R 4.4.0)
 statmod                1.5.0     2023-01-06 [1] CRAN (R 4.4.1)
 stringi                1.8.4     2024-05-06 [1] CRAN (R 4.4.0)
 stringr                1.5.1     2023-11-14 [1] CRAN (R 4.4.1)
 SummarizedExperiment * 1.34.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 survival               3.7-0     2024-06-05 [1] CRAN (R 4.4.1)
 tibble                 3.2.1     2023-03-20 [1] CRAN (R 4.4.1)
 tidyselect             1.2.1     2024-03-11 [1] CRAN (R 4.4.1)
 UCSC.utils             1.0.0     2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 utf8                   1.2.4     2023-10-22 [1] CRAN (R 4.4.1)
 vctrs                  0.6.5     2023-12-01 [1] CRAN (R 4.4.1)
 XML                    3.99-0.17 2024-06-25 [1] CRAN (R 4.4.1)
 xml2                   1.3.6     2023-12-04 [1] CRAN (R 4.4.1)
 xtable                 1.8-4     2019-04-21 [1] CRAN (R 4.4.1)
 XVector                0.44.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
 zlibbioc               1.50.0    2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)

 [1] C:/Users/zerod/AppData/Local/R/win-library/4.4
 [2] C:/Program Files/R/R-4.4.1/library

positron information:

Positron Version: 2024.09.0 (user setup) build 27
Code - OSS Version: 1.92.0
Commit: d996153f3be6bcc9af460300e61103425323b973
Date: 2024-09-11T02:44:17.677Z
Electron: 30.1.2
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

What i found interesting :

when loading "pasilla", this separate window appeared.

image

This window does not appear when running this code in Rstudio, or R gui .

when i click the menu , the R session clashed , and return error : "R 4.4.1 exited (exit code 0)"

the message shown when loading "pasilla":

> library("pasilla")
Loading required package: DEXSeq
Loading required package: BiocParallel
Loading required package: Biobase
Loading required package: BiocGenerics

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, aperm, append, as.data.frame, basename, cbind, colnames, dirname, do.call,
    duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply, Map,
    mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce,
    rownames, sapply, setdiff, table, tapply, union, unique, unsplit, which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: SummarizedExperiment
Loading required package: MatrixGenerics
Loading required package: matrixStats

Attaching package: ‘matrixStats’

The following objects are masked from ‘package:Biobase’:

    anyMissing, rowMedians

Attaching package: ‘MatrixGenerics’

The following objects are masked from ‘package:matrixStats’:

    colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, colCounts, colCummaxs, colCummins,
    colCumprods, colCumsums, colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, colMads,
    colMaxs, colMeans2, colMedians, colMins, colOrderStats, colProds, colQuantiles, colRanges,
    colRanks, colSdDiffs, colSds, colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
    colWeightedMeans, colWeightedMedians, colWeightedSds, colWeightedVars, rowAlls, rowAnyNAs,
    rowAnys, rowAvgsPerColSet, rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
    rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, rowMadDiffs, rowMads, rowMaxs,
    rowMeans2, rowMedians, rowMins, rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
    rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, rowWeightedMads,
    rowWeightedMeans, rowWeightedMedians, rowWeightedSds, rowWeightedVars

The following object is masked from ‘package:Biobase’:

    rowMedians

Loading required package: GenomicRanges
Loading required package: stats4
Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following object is masked from ‘package:utils’:

    findMatches

The following objects are masked from ‘package:base’:

    expand.grid, I, unname

Loading required package: IRanges

Attaching package: ‘IRanges’

The following object is masked from ‘package:grDevices’:

    windows

Loading required package: GenomeInfoDb
Loading required package: DESeq2
Loading required package: AnnotationDbi
Loading required package: RColorBrewer
petetronic commented 5 hours ago

Thank you @zerodel for the report, interestingly I wasn't able to reproduce this on Positron 2024.08.0 build 48 but was able to reproduce this on Positron 2024.09.0 build 45.

[Positron] All 5 sockets disconnected; kernel exited
[R] R backtrace:
[R] 0. try_catch_handler(structure(list(message = "bad binding access", 
[R]        call = NULL), class = c("simpleError", "error", "condition"
[R]    )))
[R] 1. h(simpleError(msg, call))
[R] 2. .handleSimpleError(function (cond) 
[R]    .Internal(C_tryCatchHelper(addr, 1L, cond)), "bad binding access", 
[R]        base::quote(NULL))
[R] 
[R] 
[R] R thread backtrace:
[R]    0: <unknown>
[R]    1: <unknown>
[R]    2: <unknown>
[R]    3: do_Rprofmem
[R]    4: R_ParseEvalString
[R]    5: Rf_eval
[R]    6: Rf_eval
[R]    7: R_ParseEvalString
[R]    8: R_ParseEvalString
[R]    9: R_ParseEvalString
[R]   10: Rf_eval
[R]   11: Rf_eval
[R]   12: R_ParseEvalString
[R]   13: Rf_error
[R]   14: Rf_errorcall
[R]   15: Rf_error
[R]   16: CAR
[R]   17: <unknown>
[R]   18: <unknown>
[R]   19: <unknown>
[R]   20: <unknown>
[R]   21: <unknown>
[R]   22: <unknown>
[R]   23: <unknown>
[R]   24: <unknown>
[R]   25: <unknown>
[R]   26: <unknown>
[R]   27: R_withCallingErrorHandler
[R]   28: <unknown>
[R]   29: R_ToplevelExec
[R]   30: <unknown>
[R]   31: <unknown>
[R]   32: <unknown>
[R]   33: <unknown>
[R]   34: <unknown>
[R]   35: <unknown>
[R]   36: R_withCallingErrorHandler
[R]   37: <unknown>
[R]   38: R_ToplevelExec
[R]   39: <unknown>
[R]   40: <unknown>
[R]   41: Rf_ReplIteration
[R]   42: Rf_ReplIteration
[R]   43: run_Rmainloop
[R]   44: <unknown>
[R]   45: <unknown>
[R]   46: <unknown>
[R]   47: <unknown>
[R]   48: <unknown>
[R]   49: <unknown>
[R]   50: tree_sitter_r
[R]   51: BaseThreadInitThunk
[R]   52: RtlUserThreadStart
[R] 
[R] 
[R] Backtrace of calling thread:
[R] 
[R]    0: <unknown>
[R]    1: <unknown>
[R]    2: <unknown>
[R]    3: <unknown>
[R]    4: <unknown>
[R]    5: <unknown>
[R]    6: <unknown>
[R]    7: <unknown>
[R]    8: BaseThreadInitThunk
[R]    9: RtlUserThreadStart
[R] 
[R] 
[R] Backtrace:
[R]    0: <unknown>
[R]    1: <unknown>
[R]    2: <unknown>
[R]    3: <unknown>
[R]    4: <unknown>
[R]    5: <unknown>
[R]    6: <unknown>
[R]    7: <unknown>
[R]    8: tree_sitter_r
[R]    9: <unknown>
[R]   10: <unknown>
[R]   11: <unknown>
[R]   12: <unknown>
[R]   13: <unknown>
[R]   14: <unknown>
[R]   15: BaseThreadInitThunk
[R]   16: RtlUserThreadStart
[R] 
[R]     at crates\ark\src/main.rs:482
[R] 
[R] 
[Positron] R kernel status changed: idle => exited
[Positron] Last line of log file C:\Users\user\AppData\Local\Temp\kernel-ys4dt3\kernel.log does't name an exit code: Process exit code -1073740791 
petetronic commented 4 hours ago

I'll split this out to a new issue and ask Triage to take a look.

dfalbel commented 4 hours ago

I think this is related to #4686, which should be fixed once we get a release that contains ark 0.1.136.

petetronic commented 3 hours ago

Thanks @dfalbel, I tested locally on Windows 11 with ARK 0.1.136 and this scenario no longer crashes when run in the Console.

petetronic commented 3 hours ago

Actually, I can still make it crash by interacting with the unexpected Vignettes process window that pops up and provides a menu as shown in @zerodel screenshot, even with the latest ARK. I'll move this to a new issue to track.

petetronic commented 3 hours ago

Moved second issue to https://github.com/posit-dev/positron/issues/4748

petetronic commented 1 hour ago

For the original issue from cpilat97, we should be able to consider that fixed by the later Positron/ARK builds from 2024.09.