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

translate function crashing R #364

Open
antonbarchuk opened this issue May 14, 2024 · 6 comments
Open

translate function crashing R #364

antonbarchuk opened this issue May 14, 2024 · 6 comments

Comments

@antonbarchuk
Copy link

'SqlRender::translate("SELECT * from concept", targetDialect = "duckdb")'
is crashing R on my machine from a new R session

> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Amsterdam
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] SqlRender_1.17.0

loaded via a namespace (and not attached):
 [1] compiler_4.4.0    magrittr_2.0.3    cli_3.6.2         duckdb_0.10.1     DBI_1.2.2        
 [6] tools_4.4.0       rstudioapi_0.16.0 vctrs_0.6.5       jsonlite_1.8.8    lifecycle_1.0.4  
[11] rJava_1.0-11      rlang_1.1.3       purrr_1.0.2    

SqlRender::translate("SELECT ", targetDialect = "duckdb") does not crash R and works fine.
operating system is Mac OS Sonoma 14.4.1 (M2 arm chip). I'm using R compiled for ARM.

RJava loads fine.

@ablack3
Copy link
Collaborator

ablack3 commented May 14, 2024

This works fine on my mac

SqlRender::translate("SELECT * from concept", targetDialect = "duckdb")
#> [1] "SELECT * from concept"
#> attr(,"sqlDialect")
#> [1] "duckdb"

Created on 2024-05-14 with reprex v2.1.0

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.1 (2023-06-16)
#>  os       macOS Sonoma 14.0
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Europe/Amsterdam
#>  date     2024-05-14
#>  pandoc   3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  backports     1.4.1   2021-12-13 [1] CRAN (R 4.3.0)
#>  checkmate     2.3.1   2023-12-04 [1] CRAN (R 4.3.1)
#>  cli           3.6.2   2023-12-11 [1] CRAN (R 4.3.1)
#>  digest        0.6.35  2024-03-11 [1] CRAN (R 4.3.1)
#>  evaluate      0.23    2023-11-01 [1] CRAN (R 4.3.1)
#>  fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.3.0)
#>  fs            1.6.4   2024-04-25 [1] CRAN (R 4.3.1)
#>  glue          1.7.0   2024-01-09 [1] CRAN (R 4.3.1)
#>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.3.1)
#>  knitr         1.45    2023-10-30 [1] CRAN (R 4.3.1)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.3.1)
#>  magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.3.0)
#>  purrr         1.0.2   2023-08-10 [1] CRAN (R 4.3.0)
#>  R.cache       0.16.0  2022-07-21 [1] CRAN (R 4.3.0)
#>  R.methodsS3   1.8.2   2022-06-13 [1] CRAN (R 4.3.0)
#>  R.oo          1.26.0  2024-01-24 [1] CRAN (R 4.3.1)
#>  R.utils       2.12.3  2023-11-18 [1] CRAN (R 4.3.1)
#>  reprex        2.1.0   2024-01-11 [1] CRAN (R 4.3.1)
#>  rJava         1.0-11  2024-01-26 [1] CRAN (R 4.3.1)
#>  rlang         1.1.3   2024-01-10 [1] CRAN (R 4.3.1)
#>  rmarkdown     2.26    2024-03-05 [1] CRAN (R 4.3.1)
#>  rstudioapi    0.16.0  2024-03-24 [1] CRAN (R 4.3.1)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.3.0)
#>  SqlRender     1.17.0  2024-03-20 [1] CRAN (R 4.3.1)
#>  styler        1.10.3  2024-04-07 [1] CRAN (R 4.3.1)
#>  vctrs         0.6.5   2023-12-01 [1] CRAN (R 4.3.1)
#>  withr         3.0.0   2024-01-16 [1] CRAN (R 4.3.1)
#>  xfun          0.43    2024-03-25 [1] CRAN (R 4.3.1)
#>  yaml          2.3.8   2023-12-11 [1] CRAN (R 4.3.1)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

@schuemie
Copy link
Member

That is so weird! Also works fine on my Mac (all things same, except older R version). What Java (vendor, version) are you running?

@antonbarchuk
Copy link
Author

java version "1.8.0_411"
Java(TM) SE Runtime Environment (build 1.8.0_411-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.411-b09, mixed mode)

@schuemie
Copy link
Member

That looks fine.

I just updated to R 4.4.0, and still unable to reproduce the issue. I'm sorry, I'm currently at a loss why you are experiencing this.

@antonbarchuk
Copy link
Author

Also works on another M1 Mac, but keeps crashing on this particular M2 machine.

@schuemie
Copy link
Member

I honestly have no clue what could cause this. Could you perhaps try reinstalling Java? It is also odd that one SQL string does cause the crash, while the other doesn't. Is there some regularity to SQL patterns that cause a crash?

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

No branches or pull requests

3 participants