I'm quite sure that it is an interaction between something that xlsxjars does and edgeR's C code. The example I gave is a reduction from my actual script, and I finally figured out that loading the xlsxjars package is what triggers the crash. If I comment out the line that loads xlsxjars, then everything runs just fine for me.

My current solution is to use the parallel package to load and use the xlsx package only in subprocesses, so the main R process never uses java.

-Ryan

On Mon Dec 16 13:19:53 2013, Martin Morgan wrote:
Crashes for me in locfit's C code but in a pretty weird way -- the
variable 'd' is not accessible.

(gdb) p d
Cannot access memory at address 0x7fffffef3b30

but d has been allocated on the stack. backtrace below. valgrind
reports many invalid writes associated with Java, but I think this is
somehow not unexpected for technical reasons I don't understand.
valgrind terminates with

> message("CRASH WILL HAPPEN HERE!")
CRASH WILL HAPPEN HERE!
> dge.crasher <- estimateDisp(dge.crasher)
==18065== Can't extend stack to 0x7feef4da0 during signal delivery for
thread 1:
==18065==   too small or bad protection modes
==18065==
==18065== Process terminating with default action of signal 11 (SIGSEGV)
==18065==  Access not within mapped region at address 0x7FEEF4DA0
==18065==    at 0x5795CFDD: atree_grow (ev_atree.c:95)
==18065==  If you believe this happened as a result of a stack
==18065==  overflow in your program's main thread (unlikely but
==18065==  possible), you can try to increase the size of the
==18065==  main thread stack using the --main-stacksize= flag.
==18065==  The main thread stack size used in this run was 8388608.
==18065==
==18065== HEAP SUMMARY:

I think this is a stack overflow associated with embedding Java in R,
and I bet it's challenging / impossible to fix.

Martin

> sessionInfo()
R Under development (unstable) (2013-12-01 r64371)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] edgeR_3.5.22         limma_3.19.12        xlsxjars_0.5.0
[4] rJava_0.9-5          BiocInstaller_1.13.3

loaded via a namespace (and not attached):
[1] tools_3.1.0

...
> dge.crasher <- estimateDisp(dge.crasher)

Program received signal SIGSEGV, Segmentation fault.
0x00007fffd287cfdd in atree_grow (des=0x7fffd2ab4988,
lf=0x7fffd2ab42d0, ce=0x7ffffff13c70, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:95
(gdb) bt

#0  0x00007fffd276afdd in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x7ffffff13c70, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:95
#1  0x00007fffd276b32d in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x7ffffff33da0, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:123
#2  0x00007fffd276b46c in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x7ffffff53ed0, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:129
#3  0x00007fffd276b46c in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x7ffffff74000, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:129
#4  0x00007fffd276b32d in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x7ffffff94130, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:123
#5  0x00007fffd276b32d in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x7ffffffb4260, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:123
#6  0x00007fffd276b46c in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x7ffffffd4390, ct=0x0, term=0x0,
ll=0x7fffffff44a0, ur=0x7fffffff4420) at ev_atree.c:129
#7  0x00007fffd276b32d in atree_grow (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, ce=0x5a2517b8, ct=0x0, term=0x0, ll=0x7fffffff44a0,
ur=0x7fffffff4420) at ev_atree.c:123
#8  0x00007fffd276b75d in atree_start (des=0x7fffd29a2988,
lf=0x7fffd29a22d0) at ev_atree.c:166
#9  0x00007fffd2797a45 in startlf (des=0x7fffd29a2988,
lf=0x7fffd29a22d0, vfun=0x7fffd278e1d0 <procv>, nopc=0) at startlf.c:160
#10 0x00007fffd275c9f3 in slocfit (x=0x5a0b1518, y=0x5a139f88,
c=0x5a17ec98, w=0x5a1c31e8, b=0x5a207738, lim=0x460a6928,
mi=0x5a0b0278, dp=0x5a0b01d0, str=0x460a6858, sca=0x58c16eb8,
xev=0x5a24d3c8, wdes=0x7fff93e66038,
    wtre=0x5a24e2f8, wpc=0x460a68c0, nvc=0x5a0a8a28, iwk1=0x5a2517b8,
iwk2=0x5a2528a8, lw=0x5a0a89e0, mg=0x5a24c870, L=0x5a24c7e0,
kap=0x5a24c750, dv=0x5a274fa8, nd=0x5a24c720, sty=0x5a24c660,
bs=0x58c16fd0) at S_enter.c:301
#11 0x00007ffff786815d in do_dotCode (call=0x3b517718, op=0x626618,
args=0x5a0b1198, env=0x5a03f898) at
/home/mtmorgan/src/R-devel/src/main/dotcode.c:1809
... (R evaluator)

On 12/16/2013 11:02 AM, Dan Tenenbaum wrote:


----- Original Message -----
From: "Steve Lianoglou" <lianoglou.st...@gene.com>
To: "Ryan C. Thompson" <r...@thompsonclan.org>
Cc: bioc-devel@r-project.org
Sent: Monday, December 16, 2013 10:57:44 AM
Subject: Re: [Bioc-devel] edgeR crashes when xlsxjars is loaded

Hi Ryan,

I ran this code w/ the data you sent, and my system does not crash in
either case ... perhaps you're barking up the wrong tree?

sessionInof is below,


It didn't crash for me either. It might be helpful to include your
sessionInfo.

Mine is:

sessionInfo()
R Under development (unstable) (2013-10-12 r64048)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] splines   stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
[1] locfit_1.5-9.1       xlsxjars_0.5.0       rJava_0.9-5
[4] edgeR_3.5.22         limma_3.19.12        BiocInstaller_1.13.3

loaded via a namespace (and not attached):
[1] grid_3.1.0      lattice_0.20-24

Dan


-steve

sessionInfo()
  R version 3.0.2 (2013-09-25)
  Platform: x86_64-apple-darwin10.8.0 (64-bit)

  locale:
  [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

  attached base packages:
  [1] splines   stats     graphics  grDevices utils     datasets
   methods   base

  other attached packages:
  [1] locfit_1.5-9.1 xlsxjars_0.5.0 rJava_0.9-5    edgeR_3.4.2
limma_3.18.5   devtools_1.4.1

  loaded via a namespace (and not attached):
   [1] compiler_3.0.2  digest_0.6.4    evaluate_0.5.1  grid_3.0.2
httr_0.2        lattice_0.20-24 memoise_0.1     parallel_3.0.2
RCurl_1.95-4.1  stringr_0.6.2   tools_3.0.2     whisker_0.3-2

On Mon, Dec 16, 2013 at 10:45 AM, Ryan C. Thompson
<r...@thompsonclan.org> wrote:
Hello,

I have found an issue where having the xlsxjars package loaded
kills the
entire R session with a segfault when "edgeR::estimateDisp" is
called on my
dataset. The issue seems to be specific to my data, since a random
integer
matrix of identical dimension does not trigger the bug. Other than
being
derived from ChIP-Seq input samples, there is nothing special about
my data
that I know of.

I have prepared a test case with a subset of my data that
reproducibly
triggers the crash. You can find the data and script to reproduce
here:

https://www.dropbox.com/sh/e4qbd8txll5vysj/NE8xsa6bxo

Thanks,

-Ryan

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



--
Steve Lianoglou
Computational Biologist
Genentech

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


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




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

Reply via email to