ultimatesource / denovogear

A program to detect denovo-variants using next-generation sequencing data.
http://www.nature.com/nmeth/journal/v10/n10/full/nmeth.2611.html
GNU General Public License v3.0
49 stars 25 forks source link

CALL_Sample5.3_VCF_ALT fail under release mode but not debug mode #111

Closed stevenhwu closed 8 years ago

stevenhwu commented 8 years ago

BUG

make test - CALL_Sample5.3_VCF_ALT fail under release mode but not debug mode

How to reproduce it

Ran it twice, once in release, once in debug mode. cd build; release mode rm -r *;cmake -DCMAKE_BUILD_TYPE=release ..;make testdata;make dng-call; ctest -VV -R "CALL_Sample5.3_VCF_ALT"

got the following error message

21: #CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  GL-1    GL-2    LB-NA12878:Solexa-135852    LB-NA12891:Solexa-135851    LB-NA12892:Solexa-135853
1/1 Test #21: CALL_Sample5.3_VCF_ALT ...........***Exception: SegFault  0.37 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.37 sec

The following tests FAILED:
     21 - CALL_Sample5.3_VCF_ALT (SEGFAULT)
Errors while running CTest

debug mode rm -r *;cmake -DCMAKE_BUILD_TYPE=debug ..;make testdata;make dng-call; ctest -VV -R "CALL_Sample5.3_VCF_ALT" Pass the test!

The following tests passed:
    CALL_Sample5.3_VCF_ALT

100% tests passed, 0 tests failed out of 1

Cause

line 779-780 in call.cc genotype_index[k] = (j == 0 && ref_index == 4) ? -1 : folded_diploid_genotypes_matrix[n1][n2];

On my machine, when (n1==4 || n2==4) in debug mode, folded_diploid_genotypes_matrix[n1][n2] = -1

in release mode, folded_diploid_genotypes_matrix[n1][n2] = 134744072 (or some random number)

which cause segmentation fault at line 832-834

int n = genotype_index[j];
gl_scores[k++] = (n == -1) ? hts::bcf::float_missing :
                                     stats.genotype_likelihoods[i][n];

Fix

see PR #112

stevenhwu commented 8 years ago

How to get the number for both PR and Issue at the same time? So we don't have to go back and forth and change it.

reedacartwright commented 8 years ago

A pull request is a special type of issue. You can just create a pull request to represent the issue.

reedacartwright commented 8 years ago

Fixed in #112