[R-pkg-devel] clang-san issue with R vignettes using ggplot2

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Wed Oct 30 07:57:29 CET 2024


В Tue, 29 Oct 2024 22:21:16 -0400
Kaifeng Lu <kaifenglu using gmail.com> пишет:

>   ==1429888==ERROR: LeakSanitizer: detected memory leaks
> 
>   Direct leak of 7680 byte(s) in 12 object(s) allocated from:
>       #0 0x55b3e7ff95d0 in realloc
> (/home/hornik/tmp/R-d-clang-xtra/bin/exec/R+0xc65d0) (BuildId:
> 71b7cc9351bcc02083f9df16c056d5fba06ed51c)
>       #1 0x7f61fcbd7d28
> (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x24d28) (BuildId:
> 4b26d8a18d92f6f97cf8eccd56f114fb89e44039)

I found the link to the full test output at
<https://win-builder.r-project.org/incoming_pretest/trtswitch_0.1.1_20241030_031632/>
(it's best to link to the check logs and source code when seeking help
here) and I don't think these are caused by your code. fontconfig leaks
small amounts of memory by itself, without your package:

$ build-san/bin/R -q -s -e 'png("/dev/null"); plot(1,1); dev.off()'
null device
 1

=================================================================                                                    
==22925==ERROR: LeakSanitizer: detected memory leaks            

Direct leak of 6912 byte(s) in 27 object(s) allocated from:                  
    #0 0x7f1154cb89cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
    #1 0x7f1149857431  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x23431)
<...>
SUMMARY: AddressSanitizer: 45733 byte(s) leaked in 1474 allocation(s).

I think that this check may need suppressions at least for fontconfig:
<https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions>.
Alternatively, Prof. Kurt Hornik may set the environment variable
ASAN_OPTIONS="detect_leaks=0" like done by Prof. Brian D. Ripley:
https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list