我知道它在strcmp失敗。我在下面提供了運算符<,它調用了strcmp。幫忙解釋這個棧跟蹤
在行#1上有值@ 0xbfffeeac。 @是什麼意思?
#0 0x00212bd8 in strcmp() from /lib/libc.so.6
#1 0x0012ed2f in Json::Value::CZString::operator< (this=0x8317300, [email protected])
at src/lib_json/json_value.cpp:221
#2 0x001361b0 in std::less<Json::Value::CZString>::operator() (this=0x83173a0, [email protected],
[email protected])
at /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_function.h:230
#3 0x00136101 in std::_Rb_tree<Json::Value::CZString, std::pair<Json::Value::CZString const, Json::Value>, std::_Select1st<std::pair<Json::Value::CZString const, Json::Value> >, std::less<Json::Value::CZString>, std::allocator<std::pair<Json::Value::CZString const, Json::Value> > >::_M_lower_bound (this=0x83173a0,
__x=0x83172f0, __y=0x83173a4, [email protected])
at /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_tree.h:986
#4 0x001348da in std::_Rb_tree<Json::Value::CZString, std::pair<Json::Value::CZString const, Json::Value>, std::_Select1st<std::pair<Json::Value::CZString const, Json::Value> >, std::less<Json::Value::CZString>, std::allocator<std::pair<Json::Value::CZString const, Json::Value> > >::find (this=0x83173a0, [email protected])
at /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_tree.h:1421
#5 0x0013383a in std::map<Json::Value::CZString, Json::Value, std::less<Json::Value::CZString>, std::allocator<std::pair<Json::Value::CZString const, Json::Value> > >::find (this=0x83173a0, [email protected])
at /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_map.h:659
#6 0x00131779 in Json::Value::operator[] (this=0x8317280, key=0xbfffef74 "col1")
at src/lib_json/json_value.cpp:1055
#7 0x00131ba8 in Json::Value::isMember (this=0x8317280, key=0xbfffef74 "col1")
at src/lib_json/json_value.cpp:1169
#8 0x0805cf4d in CFG::CFG_Fetch_Raw (this=0x825846c, section=0x8317280, key=0xbfffef74 "col1", defval=0x0)
at CFG.cpp:48
#9 0x08050e5b in Generic::CFGSetup (this=0x825846c, k=0x8255e2c "display_qt") at Generic.cpp:89
#10 0x0804df6a in LCDControl::ConfigSetup (this=0xbffff2a8) at LCDControl.cpp:81
#11 0x0804d93b in LCDControl::Start (this=0xbffff2a8, argc=1, argv=0xbffff404) at LCDControl.cpp:15
#12 0x0804f224 in main (argc=1, argv=0xbffff404) at Main.cpp:7
bool
Value::CZString::operator<(const CZString &other) const
{
if (cstr_)
return strcmp(cstr_, other.cstr_) < 0; //src/lib_json/json_value.cpp:221
return index_ < other.index_;
}
是的,你說得對。看起來像庫中的一個bug。謝謝。 – Scott 2009-10-14 01:22:56
@Scott其實我在回答之前意外提交了。我不認爲空檢查(或缺乏)與* this *問題有關,只是它可能是* a *問題。 – 2009-10-14 01:30:37
嗯,我剛剛發了一封電子郵件給jsoncpp的郵件列表,裏面提到了你剛纔陳述的內容。我會跟進你的其他評論。 – Scott 2009-10-14 01:33:30