Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LORDstar batch setting leads to error: caught segfault address 0x7f9b307d3500, cause 'memory not mapped' #52

Closed
aaronjfisher opened this issue Oct 14, 2021 · 1 comment

Comments

@aaronjfisher
Copy link

aaronjfisher commented Oct 14, 2021

Thanks so much for this package!

I have been having trouble with the batch settings of LORDstar & SAFFRONstar. Here is a quick example that throws an error on my local computer. I also tried it on an amazon EC2 instance and got the same error.

Is there any other info I can/should provide to help reproduce it?

library(onlineFDR)
set.seed(1)

tmax <- 1000

null_hyp <- (1:tmax) %in% sample(tmax, 
	ceiling((0.8)*tmax),
	replace = FALSE)

mu <- rep(3, tmax)
mu[null_hyp] <- 0

n_per_block <- 50
n_blocks <- tmax / n_per_block
block_ids <- rep(1:n_blocks, each = n_per_block)
batch_sizes <- rep(n_per_block, n_blocks)
stopifnot(sum(batch_sizes) == tmax)

z_base <- rnorm(tmax, 0, 1)
z_corr <- rnorm(n_blocks, 0, 1)
rho_s <- 0.3
z_s <- z_base * sqrt(1-rho_s) + 
	 z_corr[block_ids] * sqrt(rho_s) +
	 mu

p <- pnorm(-z_s)

sessionInfo()
# R version 4.0.3 (2020-10-10)
# Platform: x86_64-apple-darwin17.0 (64-bit)
# Running under: macOS Catalina 10.15.7

# Matrix products: default
# BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
# LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

# 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] stats     graphics  grDevices utils     datasets  methods   base     

# other attached packages:
# [1] onlineFDR_2.1.0

# loaded via a namespace (and not attached):
# [1] compiler_4.0.3 Rcpp_1.0.6  

fdr_df <- LORDstar(d=p,
	alpha=0.05,
	batch.sizes = batch_sizes,
	version='batch')

#  *** caught segfault ***
# address 0x7f9b307d3500, cause 'memory not mapped'

# Traceback:
#  1: lordstar_batch_faster(pval, batch, batchsum, gammai, w0 = w0,     alpha = alpha, display_progress = display_progress)
#  2: LORDstar(d = p, alpha = 0.05, batch.sizes = batch_sizes, version = "batch")

# Possible actions:
# 1: abort (with core dump, if enabled)
# 2: normal R exit
# 3: exit R without saving workspace
# 4: exit R saving workspace
@dsrobertson dsrobertson mentioned this issue Oct 30, 2021
@dsrobertson
Copy link
Owner

Thanks for finding these errors with LORDstar and SAFFRONstar. They should now be fixed with the latest commit (#54).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants