{"action":"created","issue":{"url":"https://api.github.com/repos/iqbal-lab/gramtools/issues/28","repository_url":"https://api.github.com/repos/iqbal-lab/gramtools","labels_url":"https://api.github.com/repos/iqbal-lab/gramtools/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/iqbal-lab/gramtools/issues/28/comments","events_url":"https://api.github.com/repos/iqbal-lab/gramtools/issues/28/events","html_url":"https://github.com/iqbal-lab/gramtools/issues/28","id":168495432,"number":28,"title":"Valgrind finds Invalid read (means bad memory access) in BackwardSearchTest.NoVariants1","user":{"login":"iqbal-lab","id":6476513,"avatar_url":"https://avatars.githubusercontent.com/u/6476513?v=3","gravatar_id":"","url":"https://api.github.com/users/iqbal-lab","html_url":"https://github.com/iqbal-lab","followers_url":"https://api.github.com/users/iqbal-lab/followers","following_url":"https://api.github.com/users/iqbal-lab/following{/other_user}","gists_url":"https://api.github.com/users/iqbal-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbal-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbal-lab/subscriptions","organizations_url":"https://api.github.com/users/iqbal-lab/orgs","repos_url":"https://api.github.com/users/iqbal-lab/repos","events_url":"https://api.github.com/users/iqbal-lab/events{/privacy}","received_events_url":"https://api.github.com/users/iqbal-lab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"iqbal-lab","id":6476513,"avatar_url":"https://avatars.githubusercontent.com/u/6476513?v=3","gravatar_id":"","url":"https://api.github.com/users/iqbal-lab","html_url":"https://github.com/iqbal-lab","followers_url":"https://api.github.com/users/iqbal-lab/followers","following_url":"https://api.github.com/users/iqbal-lab/following{/other_user}","gists_url":"https://api.github.com/users/iqbal-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbal-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbal-lab/subscriptions","organizations_url":"https://api.github.com/users/iqbal-lab/orgs","repos_url":"https://api.github.com/users/iqbal-lab/repos","events_url":"https://api.github.com/users/iqbal-lab/events{/privacy}","received_events_url":"https://api.github.com/users/iqbal-lab/received_events","type":"User","site_admin":false},"assignees":[{"login":"iqbal-lab","id":6476513,"avatar_url":"https://avatars.githubusercontent.com/u/6476513?v=3","gravatar_id":"","url":"https://api.github.com/users/iqbal-lab","html_url":"https://github.com/iqbal-lab","followers_url":"https://api.github.com/users/iqbal-lab/followers","following_url":"https://api.github.com/users/iqbal-lab/following{/other_user}","gists_url":"https://api.github.com/users/iqbal-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbal-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbal-lab/subscriptions","organizations_url":"https://api.github.com/users/iqbal-lab/orgs","repos_url":"https://api.github.com/users/iqbal-lab/repos","events_url":"https://api.github.com/users/iqbal-lab/events{/privacy}","received_events_url":"https://api.github.com/users/iqbal-lab/received_events","type":"User","site_admin":false},{"login":"sm0179","id":7533058,"avatar_url":"https://avatars.githubusercontent.com/u/7533058?v=3","gravatar_id":"","url":"https://api.github.com/users/sm0179","html_url":"https://github.com/sm0179","followers_url":"https://api.github.com/users/sm0179/followers","following_url":"https://api.github.com/users/sm0179/following{/other_user}","gists_url":"https://api.github.com/users/sm0179/gists{/gist_id}","starred_url":"https://api.github.com/users/sm0179/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sm0179/subscriptions","organizations_url":"https://api.github.com/users/sm0179/orgs","repos_url":"https://api.github.com/users/sm0179/repos","events_url":"https://api.github.com/users/sm0179/events{/privacy}","received_events_url":"https://api.github.com/users/sm0179/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-07-31T01:04:28Z","updated_at":"2016-07-31T01:26:54Z","closed_at":null,"body":"At this commit:\r\n\r\n[master a7c1d1e] Fixed bugs in references to data files, and fixed buggy mask input file.\r\n\r\nI ran valgrind on the fast unit tests:\r\n\r\nvalgrind --leak-check=yes ./unittest_bidir_search_bwd_fwd\r\n\r\n[==========] Running 9 tests from 1 test case.\r\n[----------] Global test environment set-up.\r\n[----------] 9 tests from BackwardSearchTest\r\n[ RUN      ] BackwardSearchTest.NoVariants1\r\n==78121== Invalid read of size 1\r\n==78121==    at 0x43547E: bidir_search_fwd(sdsl::csa_wt<sdsl::wt_int<sdsl::int_vector<(unsigned char)1>, sdsl::rank_support_v5<(unsigned char)1, (unsigned char)1>, sdsl::select_support_mcl<(unsigned char)1, (unsigned char)1>, sdsl::select_support_mcl<(unsigned char)0, (unsigned char)1> >, 2u, 16777216u, sdsl::sa_order_sa_sampling<(unsigned char)0>, sdsl::isa_sampling<(unsigned char)0>, sdsl::int_alphabet<sdsl::sd_vector<sdsl::int_vector<(unsigned char)1>, sdsl::select_support_mcl<(unsigned char)1, (unsigned char)1>, sdsl::select_support_mcl<(unsigned char)0, (unsigned char)1> >, sdsl::rank_support_sd<(unsigned char)1, sdsl::int_vector<(unsigned char)1>, sdsl::select_support_mcl<(unsigned char)1, (unsigned char)1>, sdsl::select_support_mcl<(unsigned char)0, (unsigned char)1> >, sdsl::select_support_sd<(unsigned char)1, sdsl::int_vector<(unsigned char)1>, sdsl::select_support_mcl<(unsigned char)1, (unsigned char)1>, sdsl::select_support_mcl<(unsigned char)0, (unsigned char)1> >, sdsl::int_vector<(unsigned char)0> > >&, unsigned long, unsigned long, unsigned long, unsigned long, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, std::list<std::pair<unsigned long, unsigned long>, std::allocator<std::pair<unsigned long, unsigned long> > >&, std::list<std::pair<unsigned long, unsigned long>, std::allocator<std::pair<unsigned long, unsigned long> > >&, std::list<std::vector<std::pair<unsigned int, std::vector<int, std::allocator<int> > >, std::allocator<std::pair<unsigned int, std::vector<int, std::allocator<int> > > > >, std::allocator<std::vector<std::pair<unsigned int, std::vector<int, std::allocator<int> > >, std::allocator<std::pair<unsigned int, std::vector<int, std::allocator<int> > > > > > >&, std::vector<int, std::allocator<int> >&, unsigned long, bool&, bool) (bidir_search_fwd.cpp:134)\r\n==78121==    by 0x4360AE: BackwardSearchTest_NoVariants1_Test::TestBody() (unittest_bidir_search_bwd_fwd.cpp:78)\r\n==78121==    by 0x4815C7: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x47CA91: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x464042: testing::Test::Run() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x46481F: testing::TestInfo::Run() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x464EB9: testing::TestCase::Run() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x46B67F: testing::internal::UnitTestImpl::RunAllTests() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x4828C7: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x47D7C9: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x46A2A5: testing::UnitTest::Run() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x43F343: RUN_ALL_TESTS() (gtest.h:2288)\r\n==78121==  Address 0x5341b61 is 0 bytes after a block of size 1 alloc'd\r\n==78121==    at 0x4A08EB6: operator new(unsigned long) (vg_replace_malloc.c:287)\r\n==78121==    by 0x42981B: __gnu_cxx::new_allocator<unsigned char>::allocate(unsigned long, void const*) (new_allocator.h:94)\r\n==78121==    by 0x427BE2: std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_allocate(unsigned long) (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x440955: void std::vector<unsigned char, std::allocator<unsigned char> >::_M_emplace_back_aux<unsigned char>(unsigned char&&) (vector.tcc:402)\r\n==78121==    by 0x440186: void std::vector<unsigned char, std::allocator<unsigned char> >::emplace_back<unsigned char>(unsigned char&&) (vector.tcc:102)\r\n==78121==    by 0x43F95B: std::vector<unsigned char, std::allocator<unsigned char> >::push_back(unsigned char&&) (stl_vector.h:900)\r\n==78121==    by 0x4359CB: BackwardSearchTest_NoVariants1_Test::TestBody() (unittest_bidir_search_bwd_fwd.cpp:59)\r\n==78121==    by 0x4815C7: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x47CA91: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x464042: testing::Test::Run() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x46481F: testing::TestInfo::Run() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121==    by 0x464EB9: testing::TestCase::Run() (in /Net/fs1/home/zam/dev/git/gramtools/src/unittest_bidir_search_bwd_fwd)\r\n==78121== \r\n[       OK ] BackwardSearchTest.NoVariants1 (64701 ms)\r\n[ RUN      ] BackwardSearchTest.OneSNP\r\n[       OK ] BackwardSearchTest.OneSNP (34704 ms)\r\n..etc\r\n\r\n\r\nThe bad access happens here\r\n\r\n`\r\n                while (it!=sa_intervals.end() && it_rev!=sa_intervals_rev.end() && it_s!=sites.end()) {\r\n\r\n                        //calculate sum to return- can do this in top fcns                                                                         \r\n\r\n                        if (bidir_search(csa_rev,(*it).first,(*it).second,(*it_rev).first,(*it_rev).second,c)>0) {\r\n\r\n                                ++it;\r\n\r\n                                ++it_rev;\r\n\r\n                                ++it_s;\r\n                        }\r\n                        else {\r\n                                if (it==sa_intervals.begin()) first_del=true;\r\n                                //might need to see first_del from top fcns to check if there are matches in the reference                         \r\n                                it=sa_intervals.erase(it);\r\n                                it_rev=sa_intervals_rev.erase(it_rev);\r\n                                it_s=sites.erase(it_s);\r\n                        }\r\n                }\r\n                ++pat_it;  \r\n                c=*pat_it;   <<<<<<<<<<<< HERE!!\r\n`\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/iqbal-lab/gramtools/issues/comments/236401431","html_url":"https://github.com/iqbal-lab/gramtools/issues/28#issuecomment-236401431","issue_url":"https://api.github.com/repos/iqbal-lab/gramtools/issues/28","id":236401431,"user":{"login":"iqbal-lab","id":6476513,"avatar_url":"https://avatars.githubusercontent.com/u/6476513?v=3","gravatar_id":"","url":"https://api.github.com/users/iqbal-lab","html_url":"https://github.com/iqbal-lab","followers_url":"https://api.github.com/users/iqbal-lab/followers","following_url":"https://api.github.com/users/iqbal-lab/following{/other_user}","gists_url":"https://api.github.com/users/iqbal-lab/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbal-lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbal-lab/subscriptions","organizations_url":"https://api.github.com/users/iqbal-lab/orgs","repos_url":"https://api.github.com/users/iqbal-lab/repos","events_url":"https://api.github.com/users/iqbal-lab/events{/privacy}","received_events_url":"https://api.github.com/users/iqbal-lab/received_events","type":"User","site_admin":false},"created_at":"2016-07-31T01:26:54Z","updated_at":"2016-07-31T01:26:54Z","body":"I think this is because there is just one byte here, and incrementing the iterator goes off the end somehow"}}
{"actor":{"display_login":"iqbal-lab"}}