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
fcase() may trigger segfaults in certain cases #4378
I can reproduce in R 3.6.2 on W10. It crashes R every time (not using Rstudio). In Rstudio sometimes I have to run the code 2 or 3 times before it crashes. But it always crashes eventually.
Reacted by Michael Chirico, Xianying Tan and Jan Gorecki
@ChristK You are right. It crashes in R3.6.2 on Windows. I didn't see it because I run it in RStudio. In the terminal, the R session just quits (assumes crashed).
According to my test, it should have been fixed by #4401. However, additional verifications are welcome (install the PR via remotes::install('rdatatable/data.table#4401') )
@fredguinog , you can use kit::nif (look at the news file for more info) until fcase gets fixed. You might be waiting for some times. You might also be interested by kit::vswitch which is an order of magnitude faster.
Thanks for the example and details. Turns out it was fixed by #4629 before fcase was released in 1.13.0. Thanks to static code analysis by the rchk tool in release procedures. Point 2 mentions rework to fifelse.c and the first value not being protected.
Sorry I didn't see your good example, or @shrektan's PR #4401 at the time. Double-checks to be sure in #4401 (comment).
Activity
MichaelChirico commentedon Apr 14, 2020
Working fine for me on Mac / 3.6. Could you share more about the crash? Is it a segfault? Out of memory?
Details
fredguinog commentedon Apr 14, 2020
The rsession just crashes without showing any message. Using the event viewer from windows 10, it generates this log:
shrektan commentedon Apr 14, 2020
I can reproduce this on Windows R3.5.3.
UPDATE: Super weird. Can't reproduce on Windows R3.6.2 so I believe it only occurs on Windows with R versions older than or equal to R3.5.3.On R3.6.2 it crashes as well but needs to run it without RStudio (in RStudio you have to run it repeatedly for 2-3 times before it crashes).
MichaelChirico commentedon Apr 14, 2020
Also works for me on
rocker/r-ver:3.5.3so it must be a windows thingjangorecki commentedon Apr 14, 2020
Unless there will be a report of this issue on windows R > 3.5.3 I think it is safe close.
ChristK commentedon Apr 14, 2020
I can reproduce in R 3.6.2 on W10. It crashes R every time (not using Rstudio). In Rstudio sometimes I have to run the code 2 or 3 times before it crashes. But it always crashes eventually.
MichaelChirico commentedon Apr 14, 2020
this build of
fcase-windowsbranch also failed on appveyorhttps://ci.appveyor.com/project/Rdatatable/data-table/builds/32166226
shrektan commentedon Apr 14, 2020
@ChristK You are right. It crashes in R3.6.2 on Windows. I didn't see it because I run it in RStudio. In the terminal, the R session just quits (assumes crashed).
sindribaldur commentedon Apr 27, 2020
Crashed on first run in Rstudio, R 4.0.0, W10
shrektan commentedon Apr 27, 2020
According to my test, it should have been fixed by #4401. However, additional verifications are welcome (install the PR via
remotes::install('rdatatable/data.table#4401'))fredguinog commentedon May 3, 2020
It worked like a charm
Thank you very much
shrektan commentedon May 12, 2020
Thanks for the response but we need to reopen it as it should be closed after the PR gets merged to the master branch.
2005m commentedon May 12, 2020
@fredguinog , you can use
kit::nif(look at the news file for more info) untilfcasegets fixed. You might be waiting for some times. You might also be interested bykit::vswitchwhich is an order of magnitude faster.[-]fcase crashes my rsession[/-][+]fcase() may trigger segfaults in certain cases[/+]mattdowle commentedon Nov 3, 2020
Thanks for the example and details. Turns out it was fixed by #4629 before
fcasewas released in 1.13.0. Thanks to static code analysis by therchktool in release procedures. Point 2 mentions rework tofifelse.cand the first value not being protected.Sorry I didn't see your good example, or @shrektan's PR #4401 at the time. Double-checks to be sure in #4401 (comment).