Morwenn / cpp-sort

Sorting algorithms & related tools for C++14
MIT License
617 stars 57 forks source link

Out-of-bound access in merge_insertion_sorter #182

Closed Morwenn closed 3 years ago

Morwenn commented 3 years ago

When running the test suite with MSVC in Debug mode, some merge_insertion_sorter tests failed because of the creation of out-of-bounds iterators. A few more errors were segfaults but might be related to the same problems.

1 - test every instantiated sorter (SEGFAULT)
10 - test every random-access sorter with vector - cppsort::merge_insertion_sorter (Failed)
32 - test every random-access sorter with deque - cppsort::merge_insertion_sorter (Failed)
64 - test every sorter with a pointer to member function comparison - cppsort::merge_insertion_sorter (SEGFAULT)
85 - test every sorter with long std::string - cppsort::merge_insertion_sorter (Failed)
106 - every sorter with comparison function altered by move - cppsort::merge_insertion_sorter (Failed)
126 - every sorter with projection function altered by move - cppsort::merge_insertion_sorter (Failed)
147 - test every sorter with move-only types - cppsort::merge_insertion_sorter (Failed)
167 - test most sorters with no_post_iterator - cppsort::merge_insertion_sorter (SEGFAULT)
189 - test extended compatibility with LWG 3031 - cppsort::merge_insertion_sorter (Failed)
211 - test every sorter with temporary span - cppsort::merge_insertion_sorter (Failed)
386 - every sorter with verge_adapter - cppsort::merge_insertion_sorter (Failed)
704 - merge_insertion_sorter tests with projections (SEGFAULT)
Morwenn commented 3 years ago

The out-of-bounds iterator issue is fixed, but now merge_insertion_sort segfaults with all of the tests above. It seems to be a different issue, so I've opened #184 as a followup.