Answers.Body: <p>Oh you silly sausage!</p>
  <p>This obviously means that you are running out of stack memory. <a href="https://github.com/freebayes/freebayes/issues/344#issuecomment-273276797" rel="nofollow noreferrer">Apparently</a>...</p>
  <blockquote>
  <p>freebayes is creating a single string containing the entire vcf header, which gets quite big when the reference has a lot of contigs with long names, causing stack space depletion.</p>
  </blockquote>
  <p>Try increasing the maximum stack size (in this example to 128M) and running your command again.</p>
  <pre><code>ulimit -S -s 131072 
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-25T01:09:26.200Z
Answers.Text: +1 silly sausage.
Answers.UserDisplayName: Maximilian Press
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-18T17:26:49.960Z
Answers.LastActivityDate: 2021-01-18T17:26:49.960Z
Answers.UserDisplayName: Kamil S Jaron
Body: <p>I have a draft, Illumina-based, genome and bunch of reseq samples. I generated bam files using <code>bowtie2</code> and marked duplicates using <code>picard</code>.</p>
  <p>Now, when I tried to call SNPs using freebayes, I got cryptic <code>Segmentation fault (core dumped)</code> even when I tried to run it in verbose debugging mode (<code>-dd</code>). Do you have an idea where might be a problem?</p>
  <pre><code>freebayes -f data/Afus1/genome.fa -b reseq1.sorted.rmdup.bam reseq2.sorted.rmdup.bam -dd                                                                                                                    
    loading fasta reference data/Afus1/genome.fa                                                                                              
                                                                           Opening 2 BAM format alignment input files                         
                                                                                                                                              
       done                                                                                                                                   
  Number of ref seqs: 821466                                                                                                                  
  Number of target regions: 0                                                                                                                 
  no sample list file given, reading sample names from bam file                                                                               
  found 2 samples in BAM file                                                                                                                 
  Segmentation fault (core dumped)   
  <span class="math-container">```</span>
  </code></pre>
  
Tags: <snp>
Title: freebayes segmentation fault
ThreadText: # freebayes segmentation fault
  
  (Asked by: username_0 on 2021-01-18)
  
  I have a draft, Illumina-based, genome and bunch of reseq samples. I generated bam files using `bowtie2` and marked duplicates using `picard`.
  
  Now, when I tried to call SNPs using freebayes, I got cryptic `Segmentation fault (core dumped)` even when I tried to run it in verbose debugging mode (`-dd`). Do you have an idea where might be a problem?
  
  ```
  freebayes -f data/Afus1/genome.fa -b reseq1.sorted.rmdup.bam reseq2.sorted.rmdup.bam -dd                                                                                                                    
    loading fasta reference data/Afus1/genome.fa                                                                                              
                                                                           Opening 2 BAM format alignment input files                         
                                                                                                                                              
       done                                                                                                                                   
  Number of ref seqs: 821466                                                                                                                  
  Number of target regions: 0                                                                                                                 
  no sample list file given, reading sample names from bam file                                                                               
  found 2 samples in BAM file                                                                                                                 
  Segmentation fault (core dumped)   
  ```
  
  ```
  
  **Tags:** snp
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-01-18. Score: 2
  
  Oh you silly sausage!
  
  This obviously means that you are running out of stack memory. [Apparently](https://github.com/freebayes/freebayes/issues/344#issuecomment-273276797)...
  
  > freebayes is creating a single string containing the entire vcf header, which gets quite big when the reference has a lot of contigs with long names, causing stack space depletion.
  
  Try increasing the maximum stack size (in this example to 128M) and running your command again.
  
  ```
  ulimit -S -s 131072 
  
  ```
  
  > **Comments:**
  > **username_1**: +1 silly sausage.  
  
  ---
  
  