できる限りこれを絞り込みましたが、バグのようです...
#include <algorithm>
#include <vector>
int main(int argc, char *argv[])
{
// Crashes
std::vector<uint8_t> bs{1, 0, 0};
std::search_n(bs.begin(), bs.end(), 3, 1);
// Does not crash
std::vector<uint8_t> bs{1, 0};
std::search_n(bs.begin(), bs.end(), 2, 1);
return 0;
}
私は得る
Segmentation fault: 11
std::search_n を間違って使用していないことを願っています:)
LLDB を使用して STL 実装をステップ実行することは、現時点では不可能のようです。
バージョン情報:
$clang --version
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
証拠 ;)
13:06:47 ~/bug$ cat bug.cc
#include <algorithm>
#include <vector>
int main(int argc, char *argv[])
{
std::vector<uint8_t> bs{1, 0, 0};
std::search_n(bs.begin(), bs.end(), 3, 1);
// std::vector<uint8_t> bs{1, 0};
// std::search_n(bs.begin(), bs.end(), 2, 1);
return 0;
}
13:06:52 ~/bug$ clang++ -std=c++11 -stdlib=libc++ bug.cc -o bug
13:07:36 ~/bug$ ./bug
Segmentation fault: 11
13:07:42 ~/bug$