r-hub / rhub

R-hub API client
https://r-hub.github.io/rhub/
Other
353 stars 52 forks source link

Is it possible to add Windows with ASAN? #442

Closed slowkow closed 2 years ago

slowkow commented 3 years ago

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!

gaborcsardi commented 3 years ago

I don't think R supports MSVC.

gaborcsardi commented 3 years ago

IDK if it is possible to use ASAN with MinGW.

slowkow commented 3 years ago

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?

gaborcsardi commented 3 years ago

@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.

jeroen commented 3 years ago

@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)