-
Notifications
You must be signed in to change notification settings - Fork 88
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
memory crash with CreateFragmentObject #723
Comments
Please include the full code and output of |
Here's the session info: R version 4.0.2 (2020-06-22) Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): And here's the code:
where md.x is:
|
This should be fixed in the latest Signac release, please update the package and reopen if you still have issues when using the latest version |
We found another memory crash. Our fragments files contain merged CBs in atac_tmp <- CreateSeuratObject(atac_tmp_data_subset, assay='ATAC')
# annotation=annotations)tmp, slot = "counts", assay='ATAC'),)),
Attaching SeuratObject
Attaching sp
Registered S3 method overwritten by 'SeuratDisk':
method from
as.sparse.H5Group Seurat
Class: loom
Filename: BIO_ddseq_1.FIXEDCELLS__cto.scrublet0-4.fmx.singlets.loom
Access type: H5F_ACC_RDONLY
Attributes: last_modified
Listing:
name obj_type dataset.dims dataset.type_class
attrs H5I_GROUP <NA> <NA>
col_attrs H5I_GROUP <NA> <NA>
col_graphs H5I_GROUP <NA> <NA>
layers H5I_GROUP <NA> <NA>
matrix H5I_DATASET 5942 x 1706245 H5T_INTEGER
row_attrs H5I_GROUP <NA> <NA>
row_graphs H5I_GROUP <NA> <NA>
Reading in /matrix
Storing /matrix as counts
Saving /matrix to assay 'ATAC'
Computing hash
Checking for 5942 cell barcodes
*** caught segfault ***
address (nil), cause 'memory not mapped'
Traceback:
1: validateCells(fragments = filepath, cells = cells, find_n = find_n, max_lines = max.lines, verbose = verbose)
2: ValidateCells(object = frags, verbose = verbose, ...)
3: CreateFragmentObject(path = fragments, cells = cells, validate.fragments = validate.fragments, verbose = verbose, ...)
4: CreateChromatinAssay(counts = GetAssayData(atac_tmp, slot = "counts", assay = "ATAC"), fragments = f_frag, ranges = regions, verbose = TRUE)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
Selection:
Selection: I think somewhere in validate outdated variables are used after the vectors are reallocated if they are too small. The following solves the problem for the files we had, but does not solve the core issue, I believe. diff --git a/src/validate.cpp b/src/validate.cpp
index ea31b25..4907d26 100644
--- a/src/validate.cpp
+++ b/src/validate.cpp
@@ -29,7 +29,7 @@ bool validateCells(
char* cb_char;
size_t line_counter {1};
size_t total_seen {0};
- uint32_t buffer_length = 256;
+ uint32_t buffer_length = 4096;
char *buffer = new char[buffer_length];
// Hash Map storing the barcodes to look for
@@ -47,7 +47,7 @@ bool validateCells(
// char * to string extraction
std::string cb_seq, line_seq;
- cb_seq.reserve(32);
+ cb_seq.reserve(4096);
line_seq.reserve(buffer_length);
// skip header if present |
Hi @ghuls, thanks for reporting. This should now be fixed on the develop branch, and I added some additional error checking to avoid a crash if the buffer size is exceeded. |
Hi,
When I ran
CreateFragmentObject
on Jupyter notebook, the kernel dies, even when I set the memory to:options(future.globals.maxSize = 150000 * 1024^2)
# for 150 Gb RAMThen I tried R in Mobaxterm without Jupyter, and I get:
*** caught segfault *** address (nil), cause 'memory not mapped'
How can I resolve this issue?
Thank you.
The text was updated successfully, but these errors were encountered: