0

Segmentation fault私は自分のコードで受け取ります。ここにgdbバックトラックがあります:

(gdb) backtrace 
#0  __copy_m<crest::SymbolicPred* const*, crest::SymbolicPred const**> (__first=<optimized out>, __result=<optimized out>, 
    __last=<optimized out>) at /usr/include/c++/4.4/bits/stl_algobase.h:343
#1  __copy_move_a<false, crest::SymbolicPred* const*, crest::SymbolicPred const**> (__last=<optimized out>, __first=0x0, 
    __result=<optimized out>) at /usr/include/c++/4.4/bits/stl_algobase.h:397
#2  __copy_move_a2<false, __gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > >, crest::SymbolicPred const**> (__first=..., __result=<optimized out>, __last=...)
    at /usr/include/c++/4.4/bits/stl_algobase.h:436
#3  copy<__gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > >, crest::SymbolicPred const**> (__first=..., __result=<optimized out>, __last=...) at /usr/include/c++/4.4/bits/stl_algobase.h:468
#4  uninitialized_copy<__gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > >, crest::SymbolicPred const**> (__first=..., __result=<optimized out>, __last=...)
    at /usr/include/c++/4.4/bits/stl_uninitialized.h:93
#5  uninitialized_copy<__gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > >, crest::SymbolicPred const**> (__first=..., __result=<optimized out>, __last=...)
    at /usr/include/c++/4.4/bits/stl_uninitialized.h:117
#6  __uninitialized_copy_a<__gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > >, crest::SymbolicPred const**, crest::SymbolicPred const*> (__result=<optimized out>, __first=..., __last=...)
    at /usr/include/c++/4.4/bits/stl_uninitialized.h:257
#7  _M_range_initialize<__gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > > > (__first=..., __last=..., this=<optimized out>) at /usr/include/c++/4.4/bits/stl_vector.h:1024
#8  _M_initialize_dispatch<__gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > > > (__last=..., this=<optimized out>, __first=...) at /usr/include/c++/4.4/bits/stl_vector.h:1002
#9  vector<__gnu_cxx::__normal_iterator<crest::SymbolicPred* const*, std::vector<crest::SymbolicPred*, std::allocator<crest::SymbolicPred*> > > > (__a=..., __last=..., __first=..., this=<optimized out>) at /usr/include/c++/4.4/bits/stl_vector.h:303
#10 crest::Search::SolveAtBranch (this=0x839ef80, ex=..., branch_idx=0, input=0xbffff704) at run_crest/concolic_search.cc:325
#11 0x0807efa3 in crest::SharkSearch::makeNextInput (this=0x839ef80, input=0xbffff704) at run_crest/concolic_search.cc:1536
#12 0x080866c0 in crest::SharkSearch::Run (this=0x839ef80) at run_crest/concolic_search.cc:1418
#13 0x0807be4c in main (argc=4, argv=0xbffff834) at run_crest/run_crest.cc:64

ここにコードの一部がありSolveAtBranchます:

bool Search::SolveAtBranch(const SymbolicExecution& ex, size_t branch_idx, vector<value_t>* input) {
  const vector<SymbolicPred*>& constraints = ex.path().constraints();

  vector<const SymbolicPred*> cs(constraints.begin(),
                                 constraints.begin()+branch_idx+1);
  /// ...

エラー行(325)はvector<const SymbolicPred*> cs(constraints.begin(), constraints.begin()+branch_idx+1);ベクトル定義でエラーが発生しています。

コードを変更して再度コンパイルすると、エラーが変化し、他の stl 定義でエラーがスローされます。これの何が問題なのかわからない?

4

0 に答える 0