samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
678 stars 239 forks source link

seg fault for reheader -o #2311

Open Ahuiting opened 2 weeks ago

Ahuiting commented 2 weeks ago

Hello, I want to change the sample name of .g.vcf.gz files, and it threw seg fault. bcftools reheader -s <(echo "old_name" "new_name") -o folder/output.g,vcf.gz input.g.vcf.gz But i found the problem is permission denied by 'folder', i also tested it with no existing folder path, it threw seg fault too.

The bcftools version is : bcftools 1.21 Using htslib 1.21 Copyright (C) 2024 Genome Research Ltd. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

pd3 commented 2 weeks ago

I am unable to reproduce the problem. Can you provide a small test case? This works just fine for me

$ mkdir xx
$ chmod -rxw xx
$ bcftools reheader -s <(echo old_name new_name) rmme.vcf -o xx/rmme.vcf
xx/rmme.vcf: Permission denied
Ahuiting commented 1 week ago

I am unable to reproduce the problem. Can you provide a small test case? This works just fine for me

$ mkdir xx
$ chmod -rxw xx
$ bcftools reheader -s <(echo old_name new_name) rmme.vcf -o xx/rmme.vcf
xx/rmme.vcf: Permission denied

Thanks for replying, I tried same commands, but i still get seg fault.

mkdir test
bcftools reheader -s <(echo 'old' 'new')  -o test/new_name.g.vcf.gz test.g.vcf.gz   

this works for me, but after i changed permission, it threw Seg fault.

chmod -rxw test                                                                                                                       
bcftools reheader -s <(echo 'old' 'new')  -o test/new_name.g.vcf.gz test.g.vcf.gz
Segmentation fault 

I also tried same commands on my own laptop.

bcftools reheader -s <(echo 'old' 'new')  test.g.vcf.gz -o test/new_name.g.vcf.gz 
zsh: segmentation fault  bcftools reheader -s <(echo 'old' 'new') test.g.vcf.gz -o 
pd3 commented 1 week ago

It seems the problem is not with permissions but with something else. Any chance you could share a small test case to reproduce the problem?