You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[R] Using dplyr::tally with an Arrow FileSystemDataset crashes R #33807
Describe the bug, including details regarding any error messages, version, and platform.
The following code snippet crashes R. I'm using arrow 10.0.1
library(dplyr)
arrow::write_dataset(cars, here::here("cars.feather"), format = "feather")
a <- arrow::open_dataset(here::here("cars.feather"), format = "feather")
a %>% tally()
Platform information
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] arrow_10.0.1 testthat_3.1.6
loaded via a namespace (and not attached):
[1] assertthat_0.2.1 brio_1.1.3 R6_2.5.1 lifecycle_1.0.3 magrittr_2.0.3 rlang_1.0.6
[7] cli_3.5.0 rstudioapi_0.14 vctrs_0.5.1 tools_4.2.2 bit64_4.0.5 glue_1.6.2
[13] purrr_1.0.0 bit_4.0.5 compiler_4.2.2 tidyselect_1.2.0
We've had some problems with MacOS and illegal opcodes (#28343, #14826 most recently)...it seems that the way we detect the SIMD level is sometimes not working for Intel MacOS.
Out of curiosity, are you on M1 running a x86_64 version of R? (Or are you on an Intel-based Mac?)
Out of curiosity, are you on M1 running a x86_64 version of R? (Or are you on an Intel-based Mac?)
I am on an M1 running a x86_64 version of R. I used to run the arm version of R but had issues with odbc drivers not working with arm so had to move my R installation to x86_64 via Rosetta.
This is still crashing R on my machine. I'm using arrow v11.0.0.2
Sys.setenv(ARROW_USER_SIMD_LEVEL="NONE")
library(dplyr)
arrow::write_dataset(cars, here::here("cars.feather"), format = "feather")
a <- arrow::open_dataset(here::here("cars.feather"), format = "feather")
a %>% tally()
changed the title [-]Using dplyr::tally with an Arrow FileSystemDataset crashes R[/-][+][R] Using dplyr::tally with an Arrow FileSystemDataset crashes R[/+]on Mar 10, 2023
We ran into something like this a few times at @thisisnic and @stephhazlitt 's workshop. What happened was that some folks using Apple ARM-based machines were using R built for x86 (running under Rosetta emulation), and therefore received Arrow package binaries intended for x86, which will crash with illegal op codes.
R has had native builds for R for a long time now (and there are native ARM builds for arrow which work well), so if people are using ARM-based macs, we recommend installing native R and native arrow.
I will also send a PR shortly that adds a detection + warning on package load for arrow if we detect this so that folks know that they should run native R and things will work fine.
Activity
ablack3 commentedon Jan 20, 2023
This might be a clue
thisisnic commentedon Jan 25, 2023
Hi @ablack3, thanks for reporting this! I haven't been able to reproduce this myself, though I am using Ubuntu 22.04 and not macOS. You could get more verbose output by attaching the C++ debugger before running R via the instructions here: https://arrow.apache.org/docs/dev/r/articles/developers/debugging.html
Can you show me the output of running
arrow::arrow_info()? There might be some clues there.paleolimbot commentedon Jan 25, 2023
We've had some problems with MacOS and illegal opcodes (#28343, #14826 most recently)...it seems that the way we detect the SIMD level is sometimes not working for Intel MacOS.
Out of curiosity, are you on M1 running a x86_64 version of R? (Or are you on an Intel-based Mac?)
ianmcook commentedon Jan 25, 2023
It might be useful to see the output of
sysctl machdep.cpufrom your macOS terminalablack3 commentedon Feb 16, 2023
Sorry for the delay. Here is
arrow::arrow_info()Created on 2023-02-16 with reprex v2.0.2
Thanks for the debugging instructions @thisisnic.
I am on an M1 running a x86_64 version of R. I used to run the arm version of R but had issues with odbc drivers not working with arm so had to move my R installation to x86_64 via Rosetta.
paleolimbot commentedon Feb 16, 2023
Thank you for this! I am guessing that whatever runtime detection mechanism we're using might not be working with rosetta.
Do we know if there's any way to force Arrow to pretend that SIMD doesn't exist at runtime?
westonpace commentedon Feb 17, 2023
You can try and set the environment variable
ARROW_USER_SIMD_LEVELtoNONE.ablack3 commentedon Mar 9, 2023
This is still crashing R on my machine. I'm using arrow v11.0.0.2
[-]Using dplyr::tally with an Arrow FileSystemDataset crashes R[/-][+][R] Using dplyr::tally with an Arrow FileSystemDataset crashes R[/+]jonkeane commentedon Sep 18, 2023
We ran into something like this a few times at @thisisnic and @stephhazlitt 's workshop. What happened was that some folks using Apple ARM-based machines were using R built for x86 (running under Rosetta emulation), and therefore received Arrow package binaries intended for x86, which will crash with illegal op codes.
R has had native builds for R for a long time now (and there are native ARM builds for arrow which work well), so if people are using ARM-based macs, we recommend installing native R and native arrow.
I will also send a PR shortly that adds a detection + warning on package load for arrow if we detect this so that folks know that they should run native R and things will work fine.
GH-33807: [R] Add a message if we detect running under emulation (#37777
apacheGH-33807: [R] Add a message if we detect running under emulation (
apacheGH-33807: [R] Add a message if we detect running under emulation (