Wanting to generate sequences from a newick tree having 1449 taxa, I had a seg fault.
It appeared that while reading a new tip (readTip function) the checkcapacity function was called before incrementing the tree numtips. Then at the moment of the capacity increase, the current taxon was "forgotten", thus having a null name and a null sequence and provoking the segfault at writeSequences.
You can reproduce the error with the attached tree.txt file:
./seq-gen -of -a0.441 -g4 -mWAG -l527 -z $RANDOM tree.txt > seq.fasta
Hi,
Wanting to generate sequences from a newick tree having 1449 taxa, I had a seg fault. It appeared that while reading a new tip (readTip function) the checkcapacity function was called before incrementing the tree numtips. Then at the moment of the capacity increase, the current taxon was "forgotten", thus having a null name and a null sequence and provoking the segfault at writeSequences.
You can reproduce the error with the attached tree.txt file:
./seq-gen -of -a0.441 -g4 -mWAG -l527 -z $RANDOM tree.txt > seq.fasta
tree.txt
I propose to add "+1" to checkCapacity called in the readTip function. I don't know if the proposed modification may break other parts of your code,
Best,
Frederic