randy3k / radian

A 21 century R console
MIT License
2.02k stars 75 forks source link

Radian 0.6.13 crashes after calling reticulate. #489

Open camsique opened 1 month ago

camsique commented 1 month ago
radian --version
radian version: 0.6.13
r executable: /usr/local/lib64/R/bin/R
r version: 4.3.1
python executable: /usr/bin/python
python version: 3.9.18

Case 1) No crash, but does not work.

r$> library(reticulate)
r$> pd <- import("pandas")
Error: C stack usage  7973712 is too close to the limit

Case 2) Crashes

r$> library(reticulate)
r$> use_python("/usr/bin/python")
Error: C stack usage  7975088 is too close to the limit
Error: C stack usage  7974544 is too close to the limit

 *** caught segfault ***
address (nil), cause 'memory not mapped'
Segmentation fault (core dumped)

Case 3) No problem calling this in plain R console.

This used to work in radian prior to upgrading to development version.

randy3k commented 1 month ago

It seems that reticulate 1.39 introduces some changes that break how radian interacts with it.

Downgrading reticulate to 1.38 is a workaround for now before I have time to investigate the exact cause.

remotes::install_version("reticulate", version="1.38")
randy3k commented 1 month ago

At the first glace, it is most likely caused by https://github.com/rstudio/reticulate/pull/1641 where it changes how the python is initialated.

camsique commented 1 month ago

Dear randy3k, the workaround with reticulate downgrade works. Thank you. Also thank you for the amazing package!

randy3k commented 1 month ago

I have found the culprit and reported to upstream. Hopefully they will be able to fix it soon.

camsique commented 1 month ago

Thank you.

randy3k commented 1 month ago

It should be fixed in the next reticulate release.