I followed these steps, more or less, to configure and use valgrind on the 
Bioconductor docker image.

  https://gist.github.com/mtmorgan/77f9d92d81830eeb7f254809b445874d

For this particular use I

- added the valgrind system dependency
- installed trackViewer and it's 'Suggests' dependencies in a standard R session
- made a git clone --depth 1 https://git.bioconductor.org/packages/trackViewer
- made an R script from the vignette via cd vignettes && R CMD Stangle...
- ran once with

  root@8dd16a8006a1:/tmp/trackViewer/vignettes# R -f plotInteractionData.R

  as a sanity check, then

  root@8dd16a8006a1:/tmp/trackViewer/vignettes# R -d valgrind -f 
plotInteractionData.R

This lead to a single suspicious valgrind message

> importGInteractions(file=hic, format="hic",
+                     ranges=GRanges("22", IRanges(50000000, 100000000)),
+                     out = "GInteractions")
==29679== Conditional jump or move depends on uninitialised value(s)
==29679==    at 0x48428EC: memset (in 
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==29679==    by 0x212D08FF: memset (string_fortified.h:71)
==29679==    by 0x212D08FF: select_hits (Hits_class.c:324)
==29679==    by 0x4944EB3: R_doDotCall (dotcode.c:614)
==29679==    by 0x4945464: do_dotcall (dotcode.c:1281)
==29679==    by 0x498AC35: bcEval (eval.c:7072)
==29679==    by 0x4999DA7: Rf_eval (eval.c:727)
==29679==    by 0x499BBDE: R_execClosure (eval.c:1897)
==29679==    by 0x499CAD1: Rf_applyClosure (eval.c:1823)
==29679==    by 0x4987DBD: bcEval (eval.c:7083)
==29679==    by 0x4999DA7: Rf_eval (eval.c:727)
==29679==    by 0x499BBDE: R_execClosure (eval.c:1897)
==29679==    by 0x499CAD1: Rf_applyClosure (eval.c:1823)
==29679==

Hits_class.c:324 is in S4Vectors

        if (nodup0) {
                is_used = _new_CharAE(get_nnode(nRnode, "R"));
                memset(is_used->elts, 0, is_used->_buflength);
        }

I re-ran under gdb

  root@8dd16a8006a1:/tmp/trackViewer/vignettes# R -d valgrind -f 
plotInteractionData.R
  ...
  (gdb) break Hits_class.c:324
  (gdb) run
  ...
  (gdb) continue
  ...
  > importGInteractions(file=hic, format="hic",
  +                     ranges=GRanges("22", IRanges(50000000, 100000000)),
  +                     out = "GInteractions")

    Thread 1 "R" hit Breakpoint 1, select_hits (from=<optimized out>,
      to=<optimized out>, nLnode=<optimized out>, nRnode=0x56071b51d5e8,
      select=<optimized out>, nodup=<optimized out>) at Hits_class.c:327
  327   in Hits_class.c
  (gdb) p *is_used
  $2 = {_buflength = 0, _nelt = 0, elts = 0x0}

I guess the complaint is about elts = 0x0, but I'm not really sure if this is 
enough to cause a fault during package build -- it seems like the code writes 
nothing nowhere, but ...

Martin Morgan

On 4/7/21, 8:08 AM, "Bioc-devel on behalf of Jianhong Ou, Ph.D." 
<bioc-devel-boun...@r-project.org on behalf of jianhong...@duke.edu> wrote:

    Hi Herv�,

    Thank you for the information. I will try to figure out.

    Jianhong.
    ________________________________
    From: Herv� Pag�s <hpages.on.git...@gmail.com>
    Sent: Wednesday, April 7, 2021 1:54 AM
    To: Jianhong Ou, Ph.D. <jianhong...@duke.edu>; bioc-devel@r-project.org 
<bioc-devel@r-project.org>
    Subject: Re: [Bioc-devel] Ask for help to debug the error on riesling1

    Hi Jianhong,

    Memory leaks and other memory errors are bugs in native code that often
    exist on all platforms but typically manifest themselves in different
    ways depending on the platform where it runs. Running your code thru a
    tool like Valgrind should reveal these problems even if you do this on a
    non-Windows machine. See
    
https://urldefense.com/v3/__https://bioconductor.org/developers/how-to/c-debugging/__;!!OToaGQ!6X7J1i17XSPaKkNmZMcdEY24rEjchLfeQ8YTdhLB68dZII3WDxYfoPTTpGr2AOjQ4ds$
    for more information.

    Best,
    H.


    On 4/6/21 6:46 AM, Jianhong Ou, Ph.D. wrote:
    > Hi,
    >
    > The trackViewer package got error on Windows Server since version 1.27.4. 
I am totally lost to figure it out by myself. The current error message listed 
in building system is:
    >
    >
    > * creating vignettes ... ERROR
    > --- re-building 'changeTracksStyles.Rmd' using rmarkdown
    > --- finished re-building 'changeTracksStyles.Rmd'
    >
    > --- re-building 'dandelionPlot.Rmd' using rmarkdown
    > --- finished re-building 'dandelionPlot.Rmd'
    >
    > --- re-building 'lollipopPlot.Rmd' using rmarkdown
    > --- finished re-building 'lollipopPlot.Rmd'
    >
    > --- re-building 'plotInteractionData.Rmd' using rmarkdown
    >
    > I suppose this is a memory leak error. But I don't have windows server to 
repeat the error. What is the best way to fix the issue? Thank you in advance 
for your help.
    >
    >
    > Yours Sincerely,
    >
    > Jianhong Ou
    >
    > Email: jianhong...@duke.edu
    > Bioinformatician II
    > Department of Cell Biology
    > Duke University School of Medicine
    > Durham, NC, 27710
    >
    > Confidentiality Notice:\ This e-mail message, including ...{{dropped:12}}
    >
    > _______________________________________________
    > Bioc-devel@r-project.org mailing list
    > 
https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/bioc-devel__;!!OToaGQ!6X7J1i17XSPaKkNmZMcdEY24rEjchLfeQ8YTdhLB68dZII3WDxYfoPTTpGr2_rFwouU$
    >

    --
    Herv� Pag�s

    Bioconductor Core Team
    hpages.on.git...@gmail.com

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to