Building the R interface with address sanitizer

I can build the R interface with the instructions here: https://github.com/igraph/rigraph/blob/dev/CONTRIBUTING.md#making-more-involved-changes

@Gabor, have you ever managed to compile R/igraph with Address Sanitizer on macOS? Generally, one needs -fsanitize=address -fno-omit-frame-pointer when compiling/linking and additionally the ASan libraries would need to be loaded early, which could be achieved by starting R as

DYLD_INSERT_LIBRARIES=/path/to/asan/lib R

However, the devtools package seems to launch additional R processes which don’t have this library loaded.

You don’t need devtools to compile an R package, I am not sure how devtools is involved here.

I would do this in a container, like this one: https://github.com/wch/r-debug

Thanks!

Are there any other build instructions than what I quoted, and which involve devtools? If not, could you give a short outline?

For now I am just looking for an easier way to understand which bugs reported for R/igraph are actually bugs in the C core. There’s e.g. this one which involved a specific seed for R’s RNG.

Run make and you’ll get a source R package.