Peter,

Thanks for this end-of-fix update. I really appreciate when people
report on the "solution" like you do here.

Best,
Kasper

On Thu, Jan 8, 2026 at 2:56 PM Peter Carbonetto <[email protected]>
wrote:

> 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
> > install.packages("rmarkdown")
> > install.packages("remotes")
> > library(remotes)
> > # Now install fastTopics.
> 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 <[email protected]> wrote:
>
> >
> > On 7 November 2025 at 15:14, Peter Carbonetto wrote:
> > | However, I was not able to reproduce the exact errors Dirk obtained by
> > | running the R code purl'ed from the single_cell_rnaseq_basic.Rmd
> > vignette.
> > | I thought that this might work:
> > |
> > | R -d valgrind --vanilla < single_cell_rnaseq_basic.R
> > |
> > | but this did not produce any of the "runtime errors" such as:
> > |
> > |
> >
> /usr/local/lib/R/site-library/RcppArmadillo/include/current/armadillo_bits/Mat_meat.hpp:7043:26:
> > | runtime error: reference binding to null pointer of type 'const double'
> > |
> > | Dirk, could you please share the exact R or Rscript command you ran to
> > | obtain these errors? In addition, do I need to install fastTopics and
> the
> > | other R packages in a specific way as well? That is, are there special
> > | flags (perhaps existing somewhere in
> > | https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt) that are
> needed
> > to
> > | activate these extra debugging checks?
> >
> > You want 'RD', not 'R'.  From the container's github repo README.mdL
> >
> >    Note that the instrumented version of R is available on the path as
> >    Rdevel, symbolically linked as RD, and that the instrumented versions
> of
> >    Rscript is Rscriptdevel with symbolic link RDscript. Based on the
> > R-devel
> >    sources, they use the sanitizer setup that is the focuse here whereas
> > the
> >    R and Rscript binaries come from the standard binary package and
> >    correspond to R-release without any sanitizer instrumentation. So use
> RD
> >    and RDscript to inspect undefined behavior.
> >
> > Also not sure why you added '-d valgrind'. That is a very fine tool, but
> > its
> > use tends to be independent of ASAN/UBSAN and result in separate reports.
> >
> > Best, Dirk
> >
> > --
> > dirk.eddelbuettel.com | @eddelbuettel | [email protected]
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>


-- 
Best,
Kasper

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to