Skip to content
Prev 12003 / 12125 Next

[R-pkg-devel] Reproducing the clang-UBSAN test environment in rhub or somewhere else?

I wanted to circle back on this old thread (from back in November 2025!)

Thanks to the excellent advice received (see previous responses in this
thread), I managed to (a) reproduce the errors and (b) fix them, with the
eventual result that fastTopics is back on CRAN. It was a long road, so I
wanted to briefly share with all of you the steps I took to reproduce the
errors that arose in the "clang USBAN" test environment (I'm ignoring steps
that were specific to fastTopics and therefore unlikely to be of interest
to others). Perhaps these instructions will be useful to others who find
themselves in a similar situation:

# Steps taken to replicate clang USBAN test environment.
# See these links for more details:
# https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-UBSAN/fastTopics/
# https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt
# https://github.com/rocker-org/r-devel-san-clang
docker pull --platform linux/x86_64 rocker/r-devel-ubsan-clang
docker run -lm -v $(pwd):/data -ti rocker/r-devel-ubsan-clang
cd /data
apt-get update
apt-get install cmake
Rdevel --no-save
export UBSAN_OPTIONS="print_stacktrace=1"
Rscriptdevel --vanilla single_cell_rnaseq_basic.R \
  > single_cell_rnaseq_basic.out 2> single_cell_rnaseq_basic.err

I'll note that Ben was correct in his speculation about the source of the
"null pointer" errors, although there was an additional error that arose
from an edge case that I failed to handle.

More generally, my takeaway from this experience is that we (the R package
developers) have been spoiled to have so many user-friendly resources that
mimic the CRAN test environments (e.g., winbuilder), and it was a very
steep learning curve to do this manually with the Docker containers
(generously provided by Dirk).

Peter
On Fri, Nov 7, 2025 at 7:35?PM Dirk Eddelbuettel <edd at debian.org> wrote: