Skip to content

[Bioc-devel] Ask for help to debug the error on riesling1

5 messages · Hervé Pagès, Martin Morgan, Jianhong Ou, Ph.D.

#
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.ou at 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}}
#
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://bioconductor.org/developers/how-to/c-debugging/
for more information.

Best,
H.
On 4/6/21 6:46 AM, Jianhong Ou, Ph.D. wrote:

  
    
#
Hi Herv?,

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

Jianhong.
#
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 at 8dd16a8006a1:/tmp/trackViewer/vignettes# R -f plotInteractionData.R

  as a sanity check, then

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

This lead to a single suspicious valgrind message
+                     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 at 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-bounces at r-project.org on behalf of jianhong.ou at duke.edu> wrote:

    Hi Herv?,

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

    Jianhong.
#
Hi Martin,

Thank you for going so deep. I tried

R -d "valgrind --leak-check=full --track-origins=yes" -f plotInteractionData.R

to locate the exact line where initialed the possible leak.

Is there any other possibility that killed the process and did not leave any error log information?

Jianhong.