ctSkennerton / crass

The CRISPR assembler
http://ctskennerton.github.io/crass
GNU General Public License v3.0
35 stars 11 forks source link

Seg fault for JCVI_SMPL_1103283000005.fa #35

Closed ctSkennerton closed 12 years ago

ctSkennerton commented 12 years ago

==6066== Memcheck, a memory error detector ==6066== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==6066== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==6066== Command: crass -o killme -l 4 -k 10 -K 9 JCVI_SMPL_1103283000005.fa ==6066== [crass_longReadFinder]: Processed 100000 [crass_longReadFinder]: Processed 142352 [crass_singletonFinder]: Processed 100000 [crass_singletonFinder]: Processed 142352 [crassclusterCore]: 4338 variants mapped to 3664 clusters ==6066== Invalid read of size 1 ==6066== at 0x444D67: smithWaterman(std::string&, std::string&, int, int, int, int, double) (SmithWaterman.cpp:201) ==6066== by 0x43EAE4: ReadHolder::updateStartStops(int, std::string, options const) (ReadHolder.cpp:304) ==6066== by 0x431D33: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1657) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Address 0xc3b0515 is 0 bytes after a block of size 1,061 alloc'd ==6066== at 0x4C27CC1: operator new(unsigned long) (vg_replace_malloc.c:261) ==6066== by 0x731ED98: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator const&) (in /usr/lib/libstdc++.so.6.0.13) ==6066== by 0x731F8B4: ??? (in /usr/lib/libstdc++.so.6.0.13) ==6066== by 0x731FA52: std::basic_string<char, std::char_traits, std::allocator >::basicstring(char const, std::allocator const&) (in /usr/lib/libstdc++.so.6.0.13) ==6066== by 0x40F245: reverseComplement(std::string) (SeqUtils.cpp:81) ==6066== by 0x43E879: ReadHolder::reverseComplementSeq() (ReadHolder.cpp:446) ==6066== by 0x42B748: WorkHorse::populateCoverageArray(std::string, int, std::map<int, int, std::less, std::allocator<std::pair<int const, int> > >, int, int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >_, int, int, bool, int, bool, int) (WorkHorse.cpp:768) ==6066== by 0x42F85B: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1224) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== ==6066== Conditional jump or move depends on uninitialised value(s) ==6066== at 0x444DBC: smithWaterman(std::string&, std::string&, int, int, int, int, double) (SmithWaterman.cpp:201) ==6066== by 0x43EAE4: ReadHolder::updateStartStops(int, std::string, options const) (ReadHolder.cpp:304) ==6066== by 0x431D33: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int_) (WorkHorse.cpp:1657) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Uninitialised value was created by a heap allocation ==6066== at 0x4C27CC1: operator new(unsigned long) (vg_replace_malloc.c:261) ==6066== by 0x731ED98: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator const&) (in /usr/lib/libstdc++.so.6.0.13) ==6066== by 0x731F8B4: ??? (in /usr/lib/libstdc++.so.6.0.13) ==6066== by 0x731FA52: std::basic_string<char, std::char_traits, std::allocator >::basicstring(char const, std::allocator const&) (in /usr/lib/libstdc++.so.6.0.13) ==6066== by 0x4343C8: WorkHorse::clusterDRReads(int, int, std::map<std::string, int, std::less, std::allocator<std::pair<std::string const, int> > >, std::map<int, std::map<std::string, int, std::less, std::allocator<std::pair<std::string const, int> > >, std::less, std::allocator<std::pair<int const, std::map<std::string, int, std::less, std::allocator<std::pair<std::string const, int> > >> > >) (WorkHorse.cpp:1877) ==6066== by 0x435585: WorkHorse::mungeDRs() (WorkHorse.cpp:496) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== ==6066== Conditional jump or move depends on uninitialised value(s) ==6066== at 0x42E405: WorkHorse::calculateDRConsensus(std::map<int, int, std::less, std::allocator<std::pair<int const, int> > >, int, std::map<char, int, std::less, std::allocator<std::pair<char const, int> > >, std::map<int, bool, std::less, std::allocator<std::pair<int const, bool> > >, int, int, int**, char, float, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1069) ==6066== by 0x42F963: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1233) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Uninitialised value was created by a stack allocation ==6066== at 0x4353CA: WorkHorse::mungeDRs() (WorkHorse.cpp:481) ==6066== ==6066== Conditional jump or move depends on uninitialised value(s) ==6066== at 0x42E838: WorkHorse::calculateDRConsensus(std::map<int, int, std::less, std::allocator<std::pair<int const, int> > >, int, std::map<char, int, std::less, std::allocator<std::pair<char const, int> > >, std::map<int, bool, std::less, std::allocator<std::pair<int const, bool> > >, int, int*, int**, char, float, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1069) ==6066== by 0x42F963: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1233) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Uninitialised value was created by a stack allocation ==6066== at 0x4353CA: WorkHorse::mungeDRs() (WorkHorse.cpp:481) ==6066== ==6066== Use of uninitialised value of size 8 ==6066== at 0x42E900: WorkHorse::calculateDRConsensus(std::map<int, int, std::less, std::allocator<std::pair<int const, int> > >, int, std::map<char, int, std::less, std::allocator<std::pair<char const, int> > >, std::map<int, bool, std::less, std::allocator<std::pair<int const, bool> > >, int, int, int, char, float, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1072) ==6066== by 0x42F963: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1233) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Uninitialised value was created by a stack allocation ==6066== at 0x4353CA: WorkHorse::mungeDRs() (WorkHorse.cpp:481) ==6066== ==6066== Conditional jump or move depends on uninitialised value(s) ==6066== at 0x42EA10: WorkHorse::calculateDRConsensus(std::map<int, int, std::less, std::allocator<std::pair<int const, int> > >, int, std::map<char, int, std::less, std::allocator<std::pair<char const, int> > >, std::map<int, bool, std::less, std::allocator<std::pair<int const, bool> > >, int, int, int**, char, float, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1089) ==6066== by 0x42F963: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1233) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Uninitialised value was created by a stack allocation ==6066== at 0x4353CA: WorkHorse::mungeDRs() (WorkHorse.cpp:481) ==6066== ==6066== Conditional jump or move depends on uninitialised value(s) ==6066== at 0x42EA2A: WorkHorse::calculateDRConsensus(std::map<int, int, std::less, std::allocator<std::pair<int const, int> > >, int, std::map<char, int, std::less, std::allocator<std::pair<char const, int> > >, std::map<int, bool, std::less, std::allocator<std::pair<int const, bool> > >, int, int*, int**, char, float, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1093) ==6066== by 0x42F963: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int) (WorkHorse.cpp:1233) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Uninitialised value was created by a stack allocation ==6066== at 0x4353CA: WorkHorse::mungeDRs() (WorkHorse.cpp:481) ==6066== ==6066== Invalid read of size 4 ==6066== at 0x42AEC6: WorkHorse::populateCoverageArray(std::string, int, std::map<int, int, std::less, std::allocator<std::pair<int const, int> > >, int, int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >, int*, int, bool, int, bool, int) (WorkHorse.cpp:702) ==6066== by 0x42F85B: WorkHorse::parseGroupedDRs(int, std::vector<std::string, std::allocator >, std::vector<int, std::allocator >_, int*) (WorkHorse.cpp:1224) ==6066== by 0x4360DD: WorkHorse::mungeDRs() (WorkHorse.cpp:537) ==6066== by 0x436921: WorkHorse::parseSeqFiles(std::vector<std::string, std::allocator >) (WorkHorse.cpp:362) ==6066== by 0x43A4D2: WorkHorse::doWork(std::vector<std::string, std::allocator >) (WorkHorse.cpp:164) ==6066== by 0x40AF4B: main (crass.cpp:553) ==6066== Address 0xd79d574 is not stack'd, malloc'd or (recently) free'd ==6066== --6066-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting --6066-- si_code=1; Faulting address: 0x10D608968; sp: 0x40928be60

ctSkennerton commented 12 years ago

Note as well that the final thing that caused the seg fault was at 1294 WorkHorse.cpp delete[] coverage_array[i];

ctSkennerton commented 12 years ago

Added in a print statement at 1069 in WorkHorse.cpp: std::cout<<_collapsed_pos << " : "<< dr_zone_start << " : " << (_DR_offset_map)[_dr_iter2] <<" : "<< collapsed_pos + dr_zone_start - (_DR_offset_map)[dr_iter2] <<" : "<<(int)tmp_DR.length()<<std::endl;

and I got the following numbers. The really big ones are the most concerning

1 : 997 : 1002 : -4 : 26 0 : 997 : 1007 : -10 : 25 0 : 997 : 1002 : -5 : 26 4416158 : 997 : 1007 : 4416148 : 25 4416158 : 997 : 1002 : 4416153 : 26 0 : 997 : 1007 : -10 : 25 0 : 997 : 1002 : -5 : 26 6700136 : 997 : 1007 : 6700126 : 25 6700136 : 997 : 1002 : 6700131 : 26 0 : 997 : 1007 : -10 : 25 0 : 997 : 1002 : -5 : 26 38761456 : 997 : 1007 : 38761446 : 25 38761456 : 997 : 1002 : 38761451 : 26 0 : 997 : 1007 : -10 : 25 0 : 997 : 1002 : -5 : 26 -10413 : 997 : 1007 : -10423 : 25 -10413 : 997 : 1002 : -10418 : 26 0 : 997 : 1007 : -10 : 25 0 : 997 : 1002 : -5 : 26 38678000 : 997 : 1007 : 38677990 : 25 38678000 : 997 : 1002 : 38677995 : 26 0 : 997 : 1007 : -10 : 25 0 : 997 : 1002 : -5 : 26 -10320 : 997 : 1007 : -10330 : 25 -10320 : 997 : 1002 : -10325 : 26 32767 : 997 : 1007 : 32757 : 25 32767 : 997 : 1002 : 32762 : 26 0 : 997 : 1007 : -10 : 25 0 : 997 : 1002 : -5 : 26 32767 : 997 : 1007 : 32757 : 25 32767 : 997 : 1002 : 32762 : 26 38789984 : 997 : 1007 : 38789974 : 25 38789984 : 997 : 1002 : 38789979 : 26

ctSkennerton commented 12 years ago

pretty sure that it's *collapsed_pos since that it's also on 1089 & 1093

ctSkennerton commented 12 years ago

version 0.2.2 solves this