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

2022-03-08 Thread Sebastian Meyer

Am 08.03.22 um 17:23 schrieb Dirk Eddelbuettel:


On 8 March 2022 at 18:46, Ivan Krylov wrote:
| On Sun, 6 Mar 2022 11:00:43 -0600
| Dirk Eddelbuettel  wrote:
|
| > ==1485886== LEAK SUMMARY:
| > ==1485886==definitely lost: 32 bytes in 1 blocks
|
| > ==1485886== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0
| > from 0)
|
| R CMD check only looks at the exit code of the process.
|
| Valgrind crashes the process on invalid memory access, but doesn't
| consider leaks to be errors, unless you turn on --leak-check=full, and

That is a related problem I did not stress. We can pass debugger arguments to
the debugger used (here: valgrind) when we call R, but we cannot for R CMD 
check.
That should be added.


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. 


Best,

Sebastian



| even then still returns the exit code of the child process by default,
| i.e. zero:
|
| $ cat leak.c
| #include 
|
| int main(void) {
| malloc(42);
| return 0;
| }
| $ cc -o leak -g -O0 leak.c
| $ valgrind ./leak; echo exitcode=$?
| ...
| ==14675==definitely lost: 42 bytes in 1 blocks
| ...
| ==14675== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
| exitcode=0
| $ valgrind --leak-check=full ./leak; echo exitcode=$?
| ...
|
| ==14688==definitely lost: 42 bytes in 1 blocks
| ...
| ==14688== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
| exitcode=0
| $ valgrind --leak-check=full --error-exitcode=42 ./leak; \
|  echo exitcode=$?
| ...
| ==14729==definitely lost: 42 bytes in 1 blocks
| ...
| ==14729== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
| exitcode=42
|
| R CMD check could be patched to run
| R -d 'valgrind --leak-check=full --error-exitcode=255' instead of just
| R -d valgrind to produce warnings on Valgrind-detected leaks.
|
| The problem with this approach is the need for Valgrind suppression
| files. I've run an interactive example of a pure R package under R -d
| 'valgrind --leak-check=full --error-exitcode=255' (a relatively fresh
| SVN build) and got "definitely lost: 15,744 bytes in 41 blocks", mostly
| in plot-related code, allocations originating in Pango and GObject.

I have setup a CI setting using valgrind via R CMD check (and hence lacking
'--leak-check=full' though one could add a wrapper...) and it is a little
frustrating to not have it fail.

But of course it looks like it is a missing feature and we all could work
towards adding it.  All always that would require cooperation by R Core.

Dirk



__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Package accepted, then an error to fix by 3/22

2022-03-08 Thread Simon Urbanek
Michael,

I can replicate the problem on macOS so this is not system-specific - did you 
actually try to re-build the vignette? As can be seen from the output the 
problem is is the following line:

one_rec %>% pull(abstract_text) %>% print   
  

because it is an extremely long output line (4712 characters) that exceeds the 
LaTeX limit. The actual content is quite messy so I wouldn't try to output the 
whole content, but if you really want to, you may need to wrap it first since R 
output is not soft-wrapped.

Cheers,
Simon



> On Mar 9, 2022, at 5:37 AM, Michael Barr  wrote:
> 
> Hi - had my first package accepted yesterday and published on CRAN. 
> Immediately after, I get an auto email from Prof Ripley stating there is an 
> error to be corrected or else the package  will be archived. See the relevant 
> message from check results link below.
> 
> From Google it appears to be related to a graphic in my vignette though not 
> entirely certain of that. I have precisely one image in my vignette; I�ve 
> passed all the checks locally and for the CRAN submission, so I am stumped 
> how to go about reproducing this error or fixing it. Looking for advice.
> 
> Thanks
> Mike
> 
> 
>   ! Dimension too large.
>\lsthk@InitVarsEOL ->\ifdim \lst@currlwidth
>> \lst@maxwidth \global \lst@maxw...
>l.857 ...nt  pharmacologic  approaches."
> 
>Error: processing vignette 'repoRter_nih.Rmd' failed with diagnostics:
>LaTeX failed to compile 
> /data/gannet/ripley/R/packages/tests-clang/repoRter.nih.Rcheck/vign_test/repoRter.nih/vignettes/repoRter_nih.tex.
>  See https://yihui.org/tinytex/r/#debugging for debugging tips. See 
> repoRter_nih.log for more info.
>--- failed re-building �repoRter_nih.Rmd�
> 
>SUMMARY: processing the following file failed:
> �repoRter_nih.Rmd�
> 
>Error: Vignette re-building failed.
>Execution halted
> Flavor: 
> r-devel-linux-x86_64-fedora-clang
> 
> 
> 
> 
> 
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


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

2022-03-08 Thread Dirk Eddelbuettel


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

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Package accepted, then an error to fix by 3/22

2022-03-08 Thread Michael Barr
Hi - thanks for the reply. Yes I built this vignette probably over 150 times 
through the course of working out other NOTES, via rhub::check_for_cran, 
devtools::check, devtools::build_vignette, R CMD CHECK, some other devtools 
function which checks for win devel the exact name of which escapes me atm…

Also this made it past the CRAN submission process, newbies pipeline == higher 
touch as I understand.

I’m curious why I make it past so many different checks prior to publishing. 
Not surprised it is latex related though. I will look up the character limit 
for latex to fix this.

One follow up question - after I make this correction, would the expectation be 
to increment the version for a patch (0.1.1) when I submit to cran?

Thanks
Mike

From: Simon Urbanek 
Sent: Tuesday, March 8, 2022 6:06 PM
To: Michael Barr 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] Package accepted, then an error to fix by 3/22

Michael,

I can replicate the problem on macOS so this is not system-specific - did you 
actually try to re-build the vignette? As can be seen from the output the 
problem is is the following line:

one_rec %>% pull(abstract_text) %>% print

because it is an extremely long output line (4712 characters) that exceeds the 
LaTeX limit. The actual content is quite messy so I wouldn't try to output the 
whole content, but if you really want to, you may need to wrap it first since R 
output is not soft-wrapped.

Cheers,
Simon



> On Mar 9, 2022, at 5:37 AM, Michael Barr  wrote:
>
> Hi - had my first package accepted yesterday and published on CRAN. 
> Immediately after, I get an auto email from Prof Ripley stating there is an 
> error to be corrected or else the package  will be archived. See the relevant 
> message from check results link below.
>
> From Google it appears to be related to a graphic in my vignette though not 
> entirely certain of that. I have precisely one image in my vignette; I�ve 
> passed all the checks locally and for the CRAN submission, so I am stumped 
> how to go about reproducing this error or fixing it. Looking for advice.
>
> Thanks
> Mike
>
>
>   ! Dimension too large.
>\lsthk@InitVarsEOL ->\ifdim \lst@currlwidth
>> \lst@maxwidth \global \lst@maxw...
>l.857 ...nt  pharmacologic  approaches."
>
>Error: processing vignette 'repoRter_nih.Rmd' failed with diagnostics:
>LaTeX failed to compile 
> /data/gannet/ripley/R/packages/tests-clang/repoRter.nih.Rcheck/vign_test/repoRter.nih/vignettes/repoRter_nih.tex.
>  See https://yihui.org/tinytex/r/#debugging for debugging tips. See 
> repoRter_nih.log for more info.
>--- failed re-building �repoRter_nih.Rmd�
>
>SUMMARY: processing the following file failed:
> �repoRter_nih.Rmd�
>
>Error: Vignette re-building failed.
>Execution halted
> Flavor: 
> r-devel-linux-x86_64-fedora-clang
>
>
> 
>
>
>
>
>
>[[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel


[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel