Closed slowkow closed 2 years ago
I don't think R supports MSVC.
IDK if it is possible to use ASAN with MinGW.
Thanks, Gábor! Do you have any advice for how to debug code that is crashing R on Windows but works just fine on macOS and Linux?
I thought ASAN might be one way to do it, but that's just a guess. Maybe there's a better way?
@jeroen is working on better debugging for rtools on Windows. You can already use gdb for debugging. For memory errors you might be able to use Dr memory, although it does not work great for me on Windows 10. Used to be better on Windows 8.
If your code is not actually Windows specific and the same code just happens to crash on Windows, but not on Linux, then ASAN on Linux can uncover the issues as well.
@slowkow for crashes, drmingw often works well! Try in rtools:
pacman -S mingw-w64-x86_64-drmingw
And then install drmingw as the default crash debugger as described here:
drmingw -i -v
You if you make it crash in RGui or RStudio, drmingw will popup and show a stack trace (it will not work in terminal-only Rterm sessions because these will not be able to spawn graphical windows)
Would it be possible to add another platform to rhub?
Specifically, I would be interested in testing my code on Windows with ASAN:
https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/
Thanks for any help or comments!