[R-pkg-devel] Failing Valgrind Passing R CMD check

J C Nash pro|jcn@@h @end|ng |rom gm@||@com
Wed Mar 9 18:15:28 CET 2022


I've not used valgrind before, but by request have installed it and
run R CMD check with and without --use-valgrind on the lbfgsb3c package
that Matt Fidler maintains and I contributed to. Using my own rmaiib.pl
to clear out what did NOT change between the two (ReMove from A If In
B -- a tool that strips dirtree A of content that byte-for-byte matches
that in B on basis of file size, not names), I then compared what was
left using meld. As far as I can tell, there are no valgrind complaints,
so nothing that should trip a "check" message here. Or am I missing
something? I'll be happy to rerun with changes if requested. Below is
output from inxi detailing my linux setup

System:
   Host: HP21 Kernel: 5.13.0-27-generic x86_64 bits: 64 Desktop: MATE 1.26.0
   Distro: Linux Mint 20.3 Una
Machine:
   Type: Laptop System: HP product: HP Laptop 14-fq1xxx v: N/A
   serial: <superuser/root required>
   Mobo: HP model: 887C v: 59.08 serial: <superuser/root required> UEFI: AMI
   v: F.03 date: 03/09/2021
CPU:
   Topology: 8-Core model: AMD Ryzen 7 5700U with Radeon Graphics bits: 64
   type: MT MCP L2 cache: 4096 KiB
   Speed: 1929 MHz min/max: 1400/1800 MHz Core speeds (MHz): 1: 1690 2: 1603
   3: 1397 4: 1397 5: 1397 6: 1394 7: 1397 8: 1397 9: 4342 10: 3677 11: 1721
   12: 1930 13: 1930 14: 1427 15: 1397 16: 1397
Drives:
   Local Storage: total: 1.16 TiB used: 469.07 GiB (39.6%)
   ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLQ1T0HALB-000H1
   size: 953.87 GiB
   ID-2: /dev/sda type: USB model: Multiple Card Reader size: 231.81 GiB
Info:
   Processes: 344 Uptime: 30m Memory: 14.98 GiB used: 2.00 GiB (13.4%)
   Shell: bash inxi: 3.0.38

Here is the typical extra material at the end of a check of a test in the pkg,
in this case the cyq test (Chebyquad function minimized with lbfgsb3c).

> ==4111== 
> ==4111== HEAP SUMMARY:
> ==4111==     in use at exit: 61,844,734 bytes in 9,151 blocks
> ==4111==   total heap usage: 28,318 allocs, 19,167 frees, 122,346,551 bytes allocated
> ==4111== 
> ==4111== LEAK SUMMARY:
> ==4111==    definitely lost: 0 bytes in 0 blocks
> ==4111==    indirectly lost: 0 bytes in 0 blocks
> ==4111==      possibly lost: 0 bytes in 0 blocks
> ==4111==    still reachable: 61,844,734 bytes in 9,151 blocks
> ==4111==         suppressed: 0 bytes in 0 blocks
> ==4111== Rerun with --leak-check=full to see details of leaked memory
> ==4111== 
> ==4111== For lists of detected and suppressed errors, rerun with: -s
> ==4111== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Cheers,

John Nash



On 2022-03-08 16:24, Dirk Eddelbuettel wrote:
> 
> On 8 March 2022 at 18:01, Sebastian Meyer wrote:
> | Not an expert here, but that does seem to be possible, according to WRE
> | (Section 4.3.2):
> |
> | > It is possible to run all the examples, tests and vignettes covered by R CMD check under valgrind by using the option --use-valgrind. If you do this you will need to select the valgrind options some other way, for example by having a ~/.valgrindrc file containing
> | >
> | > --leak-check=full
> | > --track-origins=yes
> | >
> | > or setting the environment variable VALGRIND_OPTS. As from R 4.2.0, --use-valgrind also uses valgrind when re-building the vignettes.
> 
> Oh, a most excellent find, thank you.
> 
> I completely missed that towards the end of Section 4.3.2 in WRE.
> 
> Dirk
>



More information about the R-package-devel mailing list