看板 EE_DSnP 關於我們 聯絡資訊
執行testBdd時segmentation fault 用gdb看是在bddMgr.cpp 中 BddNode::_one = BddNode(BddNodeInt::_terminal, BDD_POS_EDGE); 在進行operator = 中的 decRefCount()時crash display時 gdb因為避免無限recursion而不能display _refCount display _one則出現 2: this->_one = {static _one = {static _one = <same as static member of an already seen type>, static _zero = {static _one = <same as static member of an already seen type>, static _zero = <same as static member of an already seen type>, static _debugBddAddr = false, static _debugRefCount = false, _nodeV = 0, static _BddMgr = 0x8055a80}, static _debugBddAddr = false, static _debugRefCount = false, _nodeV = 0, static _BddMgr = 0x8055a80}, static _zero = <same as static member of an already seen type>, static _debugBddAddr = false, static _debugRefCount = false, _nodeV = 0, static _BddMgr = 0x8055a80} 而在BddNodeInt::decRefCount() 中有 (this = 0x0) 在~BddNode中 我本來想if(*this != 0 )時才進行getBddNodeInt()->decRefCount() 但我以為的if的判斷條件似乎不起作用...總是會進到decRefCount(),然後就crash ... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.166.233.130
dostaevsky:我原本以為跟#1AG4HdeA有關 06/23 18:04
sa901119:要確認nodeV不是NULL 才能操作 06/23 18:08
dostaevsky:我在~BddNode中 06/23 18:13
dostaevsky:if (_nodeV) getBddNodeInt()->decRefCount(); 06/23 18:13
dostaevsky:還是會進入decRedCount() 06/23 18:13
dostaevsky:另外我滿想知道_one 跟_terminal照顧的時候要小心什麼 06/23 18:17
sa901119:nodeV 是不是只能取前面幾位? 因為後面是存bubble 06/23 18:26
dostaevsky:我改用getBddNodeInt()取出 但仍然依舊 06/23 18:35
ric2k1:if (*this != 0) 是不行的哦, 因為它會去呼叫 != operator 06/23 18:51
ric2k1:所以當 _nodeV == 0 這個 if () 就 crash 了! 06/23 18:52
ric2k1:提示一下: _nodeV 可能 = 1, 但是 getNodeInt() == 0... 06/23 18:54
muxiv: 要確認nodeV不是N http://yaxiv.com 07/12 00:19