Running IBDLD (IBDLDv3.004.3) on the Norfolk Island dataset (chromosome 1) on our big processing server produced a strange abort message:
Ridge regression: SNP point 31400
Ridge regression: SNP point 31600
Ridge regression: SNP point 31800
Ridge regression: SNP point 32000
Ridge regression: SNP point 32200
Ridge regression: SNP point 32400
Have output Total number: 32501
Finish ridge regression coefficient computaion for part 1 !
Step2 Finished!
Run step3 (IBD Estimation)!
Used method and parameter in step 2: LD-RR 20 2
Available analysis chromosome: 1 in the step 2!
Run IBD estimation for chromosome 1 !
terminate called after throwing an instance of 'std::length_error'
what(): vector::_M_fill_insert
Program received signal SIGABRT, Aborted.
0x00007ffff70d2475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007ffff70d2475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff70d56f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff7b3b89d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff7b39996 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff7b399c3 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff7b39bee in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff7b8b67d in std::__throw_length_error(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x0000000000422852 in std::vector<float, std::allocator<float> >::_M_check_len (this=<optimized out>, __n=__n@entry=17623985436588245430,
__s=__s@entry=0x4d23dc "vector::_M_fill_insert") at /usr/include/c++/4.7/bits/stl_vector.h:1306
#8 0x0000000000422a59 in std::vector<float, std::allocator<float> >::_M_fill_insert (this=0x455dab8, __position=..., __n=17623985436588245430, __x=<optimized out>)
at /usr/include/c++/4.7/bits/vector.tcc:479
#9 0x000000000045c717 in insert (__x=@0x7fffffffbf40: 0, __position=..., __n=<optimized out>, this=<optimized out>) at /usr/include/c++/4.7/bits/stl_vector.h:1004
#10 resize (__new_size=17623985436588245430, this=<optimized out>, __x=<optimized out>) at /usr/include/c++/4.7/bits/stl_vector.h:687
#11 RegCoeffInformationBinaryInput (AllDependentLoci=..., fRegCoeff=..., OutReg=...) at ./IBDFold/BinaryFileInputOutput.cpp:553
#12 0x000000000047f60c in MultiplyMethodsComputaionResultOutput (infileMarkerList=..., OutFile=..., lmdaFile=..., backgroundLDFile=..., inFile_StudyPair=...,
iStudyPair=0, iStep=0, iPreviousLoci=20, ibcCheck=1, iHBDCheck=1, fMoveDistance=2, iCheckIBD=1, iIBDType=2, iIBD1Segment=@0x7fffffffdc3a: true,
iIBD2Segment=@0x7fffffffdc3b: false, fMin=0.5, fMax=1.10000002, ilmda=0, ibackgroundLD=0, iSNP=1, fLength=0, iMarkerFile=0, iMethod=3, sChromosome=...,
fErrorRate=0.00999999978, LogFile=..., iTolerateMemory=@0x7fffffffded0: 1000, iPrint=@0x7fffffffdc50: 1) at ./IBDFold/TriCoreProgram.cpp:1833
#13 0x0000000000405df9 in main (argc=1008981770, argv=0x7fff00000003) at ./IBDFold/IBDEstimationMain.cpp:126
It seems like it's trying to allocate an array of size 17623985436588245430 (1.7 * 10^19), which seems a bit excessive. Code lines in the backtrace are as follows:
./IBDFold/IBDEstimationMain.cpp:126 (main function)
./IBDFold/TriCoreProgram.cpp:1833 (MultiplyMethodsComputaionResultOutput function)
./IBDFold/BinaryFileInputOutput.cpp:553 (RegCoeffInformationBinaryInput function)
Looking at the last function, here's the surrounding lines of code:
$ cat -n BinaryFileInputOutput.cpp | grep -A 10 -B 10 '[[:space:]]553[[:space:]]'
543 fileendR.read((char*) &AllSNPNum, sizeof(size_t));
544 fileendR.seekg (0, ios::beg);
545 fileendR.clear();
546 fRegCoeff.resize(AllSNPNum);
547 AllDependentLoci.resize(AllSNPNum);
548 size_t iCoeffNum;
549 for(size_t ii=0;ii<AllSNPNum;ii++)
550 {
551 fileendR.read((char *)(&iCoeffNum),sizeof(size_t));
552 size_t iDimension=4*iCoeffNum+2;
553 fRegCoeff[ii].resize(iDimension);
554
555 if(iCoeffNum!=0)//Added it on 03_30_2012
556 {
557 AllDependentLoci[ii].resize(iCoeffNum);
558 fileendR.read((char*)&AllDependentLoci[ii][0], iCoeffNum*sizeof(size_t));
559 }
560 fileendR.read((char*)&fRegCoeff[ii][0], iDimension*sizeof(float));
561 }
562 fileendR.close();
563 }
I'm going to hazard a guess that this is due to unexpected input, because it doesn't make sense to put a number that's even a quarter of 17623985436588245430 into a file.
I have sloved the problems in IBDLDv3.004.4.Thanks!