algbio / ggcat

Compacted and colored de Bruijn graph construction and querying
MIT License
72 stars 10 forks source link

Interaction between `-m 0` and `--prefer-memory` causes a crash #36

Closed tmaklin closed 5 months ago

tmaklin commented 7 months ago

Hi, I've been playing with ggcat and noticed that running

ggcat build -k 31 -m 0 --prefer-memory input.fa.gz

causes ggcat to crash. Presumably this is due to -m 0 because increasing the value or removing --prefer-memory prevents the crash. It might be good to prevent this combination or require a positive value for -m.

Log from running the above command with real inputs: ``` temaklin@xps13:~/Projects/African_E_colis$ ggcat build -k 31 -m 0 --prefer-memory assemblies/SRR13687106.fa.gz Allocator initialized: mem: 0 octets chunks: 8192 log2: 8 Using m: 12 with k: 31 Started phase: reads bucketing prev stats: Temp buckets files size: 6.11 MiB Finished phase: reads bucketing. phase duration: 432.93ms gtime: 432.94ms Started phase: kmers merge prev stats: Thread panicked at location: libs-crates/parallel-processor-rs/src/buckets/readers/generic_binary_reader.rs:106:9 Backtrace: 0: 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: start_thread 27: clone3 ```
Guilucand commented 5 months ago

Hi, the crash was due to the chunk size with 0 memory being too small for madvise, I just fixed it