DavidsonGroup / flexiplex

The Flexible Demultiplexer
https://davidsongroup.github.io/flexiplex/
MIT License
23 stars 2 forks source link

Segfault when running with process substitution on MacOS #26

Closed ChangqingW closed 8 months ago

ChangqingW commented 8 months ago

Not sure if this is worth investigating, but flexiplex seems to fail with segfault when running with process substitution on MacOS: ./flexiplex -e 2 -f 8 -k <(curl -sL https://raw.githubusercontent.com/mritchielab/FLAMES/devel/inst/extdata/bc_allow.tsv.gz | zcat) <(curl -sL https://raw.githubusercontent.com/mritchielab/FLAMES/devel/inst/extdata/fastq/musc_rps24.fastq.gz | zcat) This could be reproduced from commit 27194e9 . I can't do backtrace and debugging with the WEHI managed laptop.

olliecheng commented 8 months ago

I suspect it might be an issue with using a temporary pipe. I can reproduce the error (except, oddly, with a precompiled flexiplex binary I already had from v0.97 - not sure why that one works!) but found that it worked every time when I saved the files first and then called them.

Can you try this?

curl -sL https://raw.githubusercontent.com/mritchielab/FLAMES/devel/inst/extdata/bc_allow.tsv.gz | zcat > wl.txt
curl -sL https://raw.githubusercontent.com/mritchielab/FLAMES/devel/inst/extdata/fastq/musc_rps24.fastq.gz | zcat > fq.txt
./flexiplex -e 2 -f 8 -k wl.txt fq.txt
ChangqingW commented 8 months ago

Yeah saving them works, the segfault only occurs with bash process substitution on MacOS. The same line of code works fine on Linux.

olliecheng commented 8 months ago

And Zsh process substitution.

It seems particularly to be an error with the -k flag, as this works fine:


./flexiplex -e 2 -f 8 -k wl.txt <(curl -sL https://raw.githubusercontent.com/mritchielab/FLAMES/devel/inst/extdata/fastq/musc_rps24.fastq.gz | zcat)```