stephenslab / mashr

An R package for multivariate adaptive shrinkage.
https://stephenslab.github.io/mashr
Other
87 stars 19 forks source link

segfault when cov_ed log file cannot be created or written to #94

Open pcarbo opened 3 years ago

pcarbo commented 3 years ago

When there is a failure writing to the log file when using the logfile option in cov_ed, the error looks like this:

 *** caught segfault ***
address (nil), cause 'memory not mapped'
Traceback:
 1: extreme_deconvolution_rcpp(ydata, tycovar, projection, logweights,     xamp, xmean, unlist(lapply(xcovar, t)), fixamp, fixmean,     fixcovar, tol, maxiter, likeonly, w, clog, splitnmerge, clog2,     noprojection, diagerrors, noweight)
 2: extreme_deconvolution(data$Bhat[subset, ], ycovar, xamp = pi_init,     xmean = matrix(0, nrow = K, ncol = R), xcovar = Ulist_init,     fixmean = TRUE, ...)
 3: bovy_wrapper(data, Ulist_init, subset, ...)
 4: cov_ed(mash_data, c(U.flash, U.pca, list(XX = t(X.center) %*%     X.center/nrow(X.center))), logfile = "/project/mstephens/fmorgante/mr_mash_test/output/mvreg_all_genes_prior_GTExrealX_indepV_B_1causalrespr10_indepReps_missing_Y_inter/rep1/prior/matrices/mvreg_all_genes_prior_GTExrealX_indepV_B_1causalrespr10_indepReps_missing_Y.EZ.FL_PC3")

We should add a check for log file failures in cov_ed so that we don't end up with a segfault—i.e., we should handle this error more gracefully.

gaow commented 3 years ago

@pcarbo where does that failure come from in the first place? The path does not exist, or filename too long? I never ran into this in my applications (which has long file names generated from bioinformatics workflows) so perhaps this is also machine dependent?

I'm not sure if we want to fix it at this point because we'll use udr to replace this implementation anyways. I think many people are still having issue installing gsl (that the old ED uses) on their computer. Might be better to prioritize on udr development.

pcarbo commented 3 years ago

I agree it is not high priority, but I thought it would be good to keep track of this issue here.