C++ C+中的腐败+;建造师

C++ C+中的腐败+;建造师,c++,gcc,stl,C++,Gcc,Stl,我面临着建造师的腐败。有人能帮我吗 2873 int rc = _db->fetch_custom_sql_query(rwc.GetQueryName(),selectConstruct, HandleCustomSqlQueryResponse, (void*)&holder); (gdb) p selectConstruct $1 = {distinct = false, colsToBeSelected = {cols = {&

我面临着建造师的腐败。有人能帮我吗

    2873            int rc = _db->fetch_custom_sql_query(rwc.GetQueryName(),selectConstruct, HandleCustomSqlQueryResponse, (void*)&holder);
    (gdb) p selectConstruct
    $1 = {distinct = false, colsToBeSelected = {cols = {<std::_Vector_base<dbCol,     std::allocator<dbCol> >> = {_M_impl = {<std::allocator<dbCol>> = {<__gnu_cxx::new_allocator<dbCol>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}, tableName = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x3dd36f32d8 ""}}, where = {whereExprs = {<std::_Vector_base<whereExpr, std::allocator<whereExpr> >> = {_M_impl = {<std::allocator<whereExpr>> = {<__gnu_cxx::new_allocator<whereExpr>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}, ops = {<std::_Vector_base<adjoinOperator, std::allocator<adjoinOperator> >> = {_M_impl = {<std::allocator<adjoinOperator>> = {<__gnu_cxx::new_allocator<adjoinOperator>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}, namespaceCounts = {<std::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {_M_impl = {<std::allocator<unsigned int>> = {<__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}, useAsON = false}, groupBy = {cols = {<std::_Vector_base<dbCol, std::allocator<dbCol> >> = {_M_impl = {<std::allocator<dbCol>> = {<__gnu_cxx::new_allocator<dbCol>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}, orders = {orders = {<std::_Vector_base<orderingTerm, std::allocator<orderingTerm> >> = {_M_impl = {<std::allocator<orderingTerm>> = {<__gnu_cxx::new_allocator<orderingTerm>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}, limit = -1}
   (gdb) stepi
    0x00007ffff0df9b49      2873            int rc = _db-   >fetch_custom_sql_query(rwc.GetQueryName(),selectConstruct, HandleCustomSqlQueryResponse, (void*)&holder);
   (gdb) stepi
   0x00007ffff0df9b50      2873            int rc = _db->fetch_custom_sql_query(rwc.GetQueryName(),selectConstruct, HandleCustomSqlQueryResponse, (void*)&holder);
   (gdb) stepi
   0x00007ffff0df9b53      2873            int rc = _db->fetch_custom_sql_query(rwc.GetQueryName(),selectConstruct, HandleCustomSqlQueryResponse, (void*)&holder);
  (gdb) stepi
   0x00007ffff0df9b5b      2873            int rc = _db->fetch_custom_sql_query(rwc.GetQueryName(),selectConstruct, HandleCustomSqlQueryResponse, (void*)&holder);
   (gdb) stepi
   0x00007ffff0df9b5e      2873            int rc = _db->fetch_custom_sql_query(rwc.GetQueryName(),selectConstruct, HandleCustomSqlQueryResponse, (void*)&holder);
   (gdb) stepi
    0x00007ffff0da8000 in simpleSelectConstruct::simpleSelectConstruct () from   /opt/OV/lbin/OpsAgt/libDMLSegment.so
   (gdb) stepi
   simpleSelectConstruct::simpleSelectConstruct (this=0x7fffdbffdbb0) at /home/parakkal/COLLABNET_11.10_NEW/hpsw-oa/AgentFramework/cpp/src/include/OpsAgt/DBsupports.h:170
   170     class simpleSelectConstruct{
   /include/OpsAgt/DBsupports.h:170
   170     class simpleSelectConstruct{
  (gdb) p *this
   $2 = {distinct = false, colsToBeSelected = {cols = {<std::_Vector_base<dbCol,   std::allocator<dbCol> >> = {_M_impl = {<std::allocator<dbCol>> =  {<__gnu_cxx::new_allocator<dbCol>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}, tableName = {static npos = 18446744073709551615, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x0}}, where = {whereExprs = {<std::_Vector_base<whereExpr, std::allocator<whereExpr> >> = {_M_impl = {<std::allocator<whereExpr>> = {<__gnu_cxx::new_allocator<whereExpr>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}, ops = {<std::_Vector_base<adjoinOperator, std::allocator<adjoinOperator> >> = {_M_impl = {<std::allocator<adjoinOperator>> = {<__gnu_cxx::new_allocator<adjoinOperator>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x3dd34bd704, _M_end_of_storage = 0x7ffff7ca52b0}}, <No data fields>}, namespaceCounts = {<std::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {_M_impl = {<std::allocator<unsigned int>> = {<__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No data fields>}, _M_start = 0x7fffdbffe910, _M_finish = 0x6, _M_end_of_storage = 0x4e}}, <No data fields>}, useAsON = false}, groupBy = {cols = {<std::_Vector_base<dbCol, std::allocator<dbCol> >> = {_M_impl = {<std::allocator<dbCol>> = {<__gnu_cxx::new_allocator<dbCol>> = {<No data fields>}, <No data fields>}, _M_start = 0x7fffdbffe910, _M_finish = 0x0, _M_end_of_storage = 0x7ffff6f54d1f}}, <No data fields>}}, orders = {orders = {<std::_Vector_base<orderingTerm, std::allocator<orderingTerm> >> = {_M_impl = {<std::allocator<orderingTerm>> = {<__gnu_cxx::new_allocator<orderingTerm>> = {<No data fields>}, <No data fields>}, _M_start = 0x7ffff7ca52b0, _M_finish = 0x7ffff6f5584d, _M_end_of_storage = 0x5509f0}}, <No data fields>}}, limit = -603988688}
  (gdb) stepi
我已将完整信息发布在

我看不到腐败的迹象。我看到您打印出一个未损坏的变量selectConstruct,进入
simpleSelectConstruct
构造函数,打印即将构造的
simpleSelectConstruct
,执行四个步骤,然后打印只构造了一半的
simpleSelectConstruct
。(两者都不是
selectConstruct
变量)。您是否尝试等到构造函数完成后再执行

当构造函数开始时:

distinct = false
colsToBeSelected = 
    cols = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0 ...
tableName = ..._M_p = 0x0 ...
where = 
    whereExprs = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0...
    ops = ..._M_start = 0x0, _M_finish = 0x3dd34bd704, _M_end_of_storage = 0x7ffff7ca52b0...
    namespaceCounts = ..._M_start = 0x7fffdbffe910, _M_finish = 0x6, _M_end_of_storage = 0x4e...
    useAsON = false
groupBy = 
    cols = ..._M_start = 0x7fffdbffe910, _M_finish = 0x0, _M_end_of_storage = 0x7ffff6f54d1f...
orders = ..._M_start = 0x7ffff7ca52b0, _M_finish = 0x7ffff6f5584d, _M_end_of_storage = 0x5509f0...
limit = -603988688
在构造函数中执行四个步骤后:

distinct = false
colsToBeSelected = 
    cols = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0 ...
tableName = ..._M_p = 0x0...
where = 
    whereExprs = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0...
    ops = ..._M_start = 0x0, _M_finish = 0x3dd34bd704, _M_end_of_storage = 0x7ffff7ca52b0...
    namespaceCounts = ..._M_start = 0x7fffdbffe910, _M_finish = 0x6, _M_end_of_storage = 0x4e...
    useAsON = false
groupBy = 
    cols = ..._M_start = 0x7fffdbffe910, _M_finish = 0x0, _M_end_of_storage = 0x7ffff6f54d1f...
orders = ..._M_start = 0x7ffff7ca52b0, _M_finish = 0x7ffff6f5584d, _M_end_of_storage = 0x5509f0...
limit = -603988688

构造函数显然还没有完成执行。这似乎是相当早的建设过程仍然。我假设这四个操作是assingfalse,然后是
cols
,因此下一步是构造
tableName

对我来说就像加密一样。我的指导老师曾经用他给我们的代码来做这件事,这样我们就可以看到最终的程序应该是什么样子,而不用给我们代码,用于测试和测试stuff@NavinParakkal:尽管构造函数是观察到的损坏的直接原因,但构造函数不是问题所在。问题是(A)有东西在不应该调用构造函数的地方调用构造函数,或者(B)堆栈已损坏,导致构造函数在不应该调用的地方和时间都被调用。在这两种情况下,如果没有更多的细节,我都无能为力,因为我不理解gdb的输出。我希望有人对此有更多的了解:(将您的整个代码(甚至没有正确对齐)转储到某个地方,并发布一个指向它的链接,这看起来不像是在发布问题之前认真分析问题的工作。找到导致问题的相关代码,并在此处发布(例如,您在该链接上发布的内容甚至没有一个
main
函数形式的入口点,那么您希望任何人如何能够对其进行调查?)。此外,我没有看到损坏的迹象。我看到您打印出一个未损坏的变量
selectConstruct
,进入
simpleSelectConstruct
构造函数,打印即将构建的
simpleSelectConstruct
,执行四个步骤,然后打印打开的
simpleSelectConstruct
只构造了一半。(两者都不是
selectConstruct
变量)。然后您会抱怨它没有完全构造。您是否尝试等到构造函数完成后再尝试?它似乎已初始化
distinct、colstobeselect、tableName
,但尚未初始化
where、groupBy、orders、limit
distinct = false
colsToBeSelected = 
    cols = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0 ...
tableName = ..._M_p = 0x0 ...
where = 
    whereExprs = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0...
    ops = ..._M_start = 0x0, _M_finish = 0x3dd34bd704, _M_end_of_storage = 0x7ffff7ca52b0...
    namespaceCounts = ..._M_start = 0x7fffdbffe910, _M_finish = 0x6, _M_end_of_storage = 0x4e...
    useAsON = false
groupBy = 
    cols = ..._M_start = 0x7fffdbffe910, _M_finish = 0x0, _M_end_of_storage = 0x7ffff6f54d1f...
orders = ..._M_start = 0x7ffff7ca52b0, _M_finish = 0x7ffff6f5584d, _M_end_of_storage = 0x5509f0...
limit = -603988688
distinct = false
colsToBeSelected = 
    cols = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0 ...
tableName = ..._M_p = 0x0...
where = 
    whereExprs = ..._M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0...
    ops = ..._M_start = 0x0, _M_finish = 0x3dd34bd704, _M_end_of_storage = 0x7ffff7ca52b0...
    namespaceCounts = ..._M_start = 0x7fffdbffe910, _M_finish = 0x6, _M_end_of_storage = 0x4e...
    useAsON = false
groupBy = 
    cols = ..._M_start = 0x7fffdbffe910, _M_finish = 0x0, _M_end_of_storage = 0x7ffff6f54d1f...
orders = ..._M_start = 0x7ffff7ca52b0, _M_finish = 0x7ffff6f5584d, _M_end_of_storage = 0x5509f0...
limit = -603988688