作者 主題: jsoncpp Program terminated with signal 6  (閱讀 5049 次)

0 會員 與 1 訪客 正在閱讀本文。

FIEND

  • 鑽研的研究生
  • *****
  • 文章數: 700
    • 檢視個人資料
    • http://bbs.ecstart.com
jsoncpp Program terminated with signal 6
« 於: 2012-09-06 15:43 »
看起來 jsoncpp 的穩定性也沒很好.

送了 100000000 組 搞了 幾十個併發攻擊 請求後 , 直接把它給弄死了.....

繼續研究~~


[root@FIEND wge_server]# gdb sbin/wge core.30747
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-56.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/cpp/wge_server/sbin/wge...done.
[New Thread 30749]
[New Thread 30750]
[New Thread 30748]
[New Thread 30747]
Missing separate debuginfo for /usr/local/wge/server/boost/lib/libboost_system.so.1.51.0
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/43/e38b856af532331942a23fd0cfd05c3a7eb6b2
Missing separate debuginfo for /usr/local/wge/server/wge/lib/libPhpFpm.so
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/7b/cb561cb29f74b1fd8f6121b1ef8b24babe5890
Missing separate debuginfo for /usr/local/wge/server/wge/lib/libWgeBase64.so
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/1b/1cd9c7370849727662953e57da8d4e5c0e7c78
Missing separate debuginfo for /usr/local/wge/server/wge/lib/libWgeJsoncpp.so
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/b8/1f4d99f40ef14d4dbb56900669dad627d4f09d
Missing separate debuginfo for /usr/local/wge/server/wge/lib/libZlib.so
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/6f/50ef6e38d3cb1e25ba8b37d6bce700e6ee6d0f
Missing separate debuginfo for /usr/local/wge/server/wge/lib/libWgeOpenssl.so
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/a1/6668595410ed1f78e46ce2b00168c58107f102
Missing separate debuginfo for /usr/local/wge/server/poco/lib/libPocoFoundation.so.12
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/9b/d1532f5e378a14a2cd3d2ba460fd79ebae579b
Missing separate debuginfo for
Try: yum --disablerepo='*' --enablerepo='*-debug*' install /usr/lib/debug/.build-id/74/22987f6cfa699f465b0327139aac3fdac4a838
Reading symbols from /usr/local/wge/server/boost/lib/libboost_system.so.1.51.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/wge/server/boost/lib/libboost_system.so.1.51.0
Reading symbols from /usr/local/wge/server/wge/lib/libPhpFpm.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/wge/server/wge/lib/libPhpFpm.so
Reading symbols from /usr/local/wge/server/wge/lib/libWgeBase64.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/wge/server/wge/lib/libWgeBase64.so
Reading symbols from /usr/local/wge/server/wge/lib/libWgeJsoncpp.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/wge/server/wge/lib/libWgeJsoncpp.so
Reading symbols from /usr/local/wge/server/wge/lib/libZlib.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/wge/server/wge/lib/libZlib.so
Reading symbols from /usr/local/wge/server/wge/lib/libWgeOpenssl.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/wge/server/wge/lib/libWgeOpenssl.so
Reading symbols from /usr/lib64/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libstdc++.so.6
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /usr/local/wge/server/poco/lib/libPocoFoundation.so.12...(no debugging symbols found)...done.
Loaded symbols for /usr/local/wge/server/poco/lib/libPocoFoundation.so.12
Reading symbols from /usr/lib64/libcrypto.so.10...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libcrypto.so.10
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libz.so.1
Core was generated by `./sbin/wge'.
Program terminated with signal 6, Aborted.
#0  0x000000342b6328a5 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6_3.3.x86_64 libgcc-4.4.6-4.el6.x86_64 libstdc++-4.4.6-4.el6.x86_64 openssl-1.0.0-25.el6_3.1.x86_64 zlib-1.2.3-27.el6.x86_64
(gdb) bt
#0  0x000000342b6328a5 in raise () from /lib64/libc.so.6
#1  0x000000342b634085 in abort () from /lib64/libc.so.6
#2  0x000000342b62ba1e in __assert_fail_base () from /lib64/libc.so.6
#3  0x000000342b62bae0 in __assert_fail () from /lib64/libc.so.6
#4  0x00002abae62a2e16 in Json::Value::resolveReference(char const*, bool) () from /usr/local/wge/server/wge/lib/libWgeJsoncpp.so
#5  0x00002abae6298217 in wgeJsoncpp::wgeJsoncpp::getUID() () from /usr/local/wge/server/wge/lib/libWgeJsoncpp.so
#6  0x0000000000416d47 in session::readClientRequest (this=0x2abaec008790) at ./src/wge.cpp:613
#7  0x000000000041701d in session::handle_read (this=0x2abaec008790, error=<value optimized out>, bytes_transferred=<value optimized out>) at ./src/wge.cpp:655
#8  0x0000000000409065 in call<boost::shared_ptr<session>, boost::system::error_code const, unsigned long> (owner=<value optimized out>, base=<value optimized out>)
    at /usr/local/wge/server/boost/include/boost/bind/mem_fn_template.hpp:271
#9  operator()<boost::shared_ptr<session> > (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/bind/mem_fn_template.hpp:286
#10 operator()<boost::_mfi::mf2<void, session, const boost::system::error_code&, long unsigned int>, boost::_bi::list2<const boost::system::error_code&, const long unsigned int&> > (owner=<value optimized out>,
    base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/bind/bind.hpp:392
#11 operator()<boost::system::error_code, long unsigned int> (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/bind/bind_template.hpp:102
#12 operator() (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/detail/bind_handler.hpp:118
#13 asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long> > (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/handler_invoke_hook.hpp:64
#14 invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> > > (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/detail/handler_invoke_helpers.hpp:39
#15 boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> > >::do_complete (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/detail/reactive_socket_recv_op.hpp:110
#16 0x0000000000411c75 in complete (this=0x2abaec000910, ec=...) at /usr/local/wge/server/boost/include/boost/asio/detail/task_io_service_operation.hpp:37
#17 do_run_one (this=0x2abaec000910, ec=...) at /usr/local/wge/server/boost/include/boost/asio/detail/impl/task_io_service.ipp:419
#18 boost::asio::detail::task_io_service::run (this=0x2abaec000910, ec=...) at /usr/local/wge/server/boost/include/boost/asio/detail/impl/task_io_service.ipp:160
#19 0x0000000000404d2e in run () at /usr/local/wge/server/boost/include/boost/asio/impl/io_service.ipp:59
#20 startServer () at ./src/wge.cpp:888
#21 0x0000003e978b6470 in ?? () from /usr/lib64/libstdc++.so.6
#22 0x000000342be07851 in start_thread () from /lib64/libpthread.so.0
#23 0x000000342b6e76dd in clone () from /lib64/libc.so.6
(gdb) up
#1  0x000000342b634085 in abort () from /lib64/libc.so.6
(gdb)
#2  0x000000342b62ba1e in __assert_fail_base () from /lib64/libc.so.6
(gdb)
#3  0x000000342b62bae0 in __assert_fail () from /lib64/libc.so.6
(gdb)
#4  0x00002abae62a2e16 in Json::Value::resolveReference(char const*, bool) () from /usr/local/wge/server/wge/lib/libWgeJsoncpp.so
(gdb)
#5  0x00002abae6298217 in wgeJsoncpp::wgeJsoncpp::getUID() () from /usr/local/wge/server/wge/lib/libWgeJsoncpp.so
(gdb)
#6  0x0000000000416d47 in session::readClientRequest (this=0x2abaec008790) at ./src/wge.cpp:613
613                                     uid = wgejson.getUID() ;
(gdb)
#7  0x000000000041701d in session::handle_read (this=0x2abaec008790, error=<value optimized out>, bytes_transferred=<value optimized out>) at ./src/wge.cpp:655
655                            readClientRequest() ; // call readClientRequest()  , and use async_write
(gdb)
#8  0x0000000000409065 in call<boost::shared_ptr<session>, boost::system::error_code const, unsigned long> (owner=<value optimized out>, base=<value optimized out>)
    at /usr/local/wge/server/boost/include/boost/bind/mem_fn_template.hpp:271
271             BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
(gdb)
#9  operator()<boost::shared_ptr<session> > (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/bind/mem_fn_template.hpp:286
286             BOOST_MEM_FN_RETURN call(u, p, a1, a2);
(gdb)
#10 operator()<boost::_mfi::mf2<void, session, const boost::system::error_code&, long unsigned int>, boost::_bi::list2<const boost::system::error_code&, const long unsigned int&> > (owner=<value optimized out>,
    base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/bind/bind.hpp:392
392             unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
(gdb)
#11 operator()<boost::system::error_code, long unsigned int> (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/bind/bind_template.hpp:102
102             BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
(gdb)
#12 operator() (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/detail/bind_handler.hpp:118
118         handler_(static_cast<const Arg1&>(arg1_),
(gdb)
#13 asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long> > (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/handler_invoke_hook.hpp:64
64        function();
(gdb)
#14 invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> >, boost::system::error_code, unsigned long>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> > > (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/detail/handler_invoke_helpers.hpp:39
39        asio_handler_invoke(function, boost::addressof(context));
(gdb)
#15 boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, boost::_bi::bind_t<void, boost::_mfi::mf2<void, session, boost::system::error_code const&, unsigned long>, boost::_bi::list3<boost::_bi::value<boost::shared_ptr<session> >, boost::arg<1> (*)(), boost::arg<2> (*)()> > >::do_complete (owner=<value optimized out>, base=<value optimized out>) at /usr/local/wge/server/boost/include/boost/asio/detail/reactive_socket_recv_op.hpp:110
110           boost_asio_handler_invoke_helpers::invoke(handler, handler.handler_);
(gdb)
#16 0x0000000000411c75 in complete (this=0x2abaec000910, ec=...) at /usr/local/wge/server/boost/include/boost/asio/detail/task_io_service_operation.hpp:37
37          func_(&owner, this, ec, bytes_transferred);
(gdb)
#17 do_run_one (this=0x2abaec000910, ec=...) at /usr/local/wge/server/boost/include/boost/asio/detail/impl/task_io_service.ipp:419
419             o->complete(*this, ec, task_result);
(gdb)
#18 boost::asio::detail::task_io_service::run (this=0x2abaec000910, ec=...) at /usr/local/wge/server/boost/include/boost/asio/detail/impl/task_io_service.ipp:160
160       for (; do_run_one(lock, this_thread, ec); lock.lock())
(gdb)
#19 0x0000000000404d2e in run () at /usr/local/wge/server/boost/include/boost/asio/impl/io_service.ipp:59
59        std::size_t s = impl_.run(ec);
(gdb)
#20 startServer () at ./src/wge.cpp:888
888                     io_service.run();
(gdb)
#21 0x0000003e978b6470 in ?? () from /usr/lib64/libstdc++.so.6
(gdb)
#22 0x000000342be07851 in start_thread () from /lib64/libpthread.so.0
(gdb)
#23 0x000000342b6e76dd in clone () from /lib64/libc.so.6
(gdb)
Initial frame selected; you cannot go up.
你累了嗎? 這樣不行 , 人要比 LINUX 兇 @@ " ......

FIEND

  • 鑽研的研究生
  • *****
  • 文章數: 700
    • 檢視個人資料
    • http://bbs.ecstart.com
Re: jsoncpp Program terminated with signal 6
« 回覆 #1 於: 2012-09-06 15:58 »
沒意外是 jsoncpp 底下的
src/lib_json/json_value.cpp:1025:
Json::Value& Json::Value::resolveReference(const char*, bool): Assertion `type_ == nullValue || type_ == objectValue' failed.

造成的.

又要開始痛苦的找問題了 @@"


« 上次編輯: 2012-09-06 16:39 由 FIEND »
你累了嗎? 這樣不行 , 人要比 LINUX 兇 @@ " ......

FIEND

  • 鑽研的研究生
  • *****
  • 文章數: 700
    • 檢視個人資料
    • http://bbs.ecstart.com
Re: jsoncpp Program terminated with signal 6
« 回覆 #2 於: 2012-09-06 16:41 »

呼~這問題比較多人遇到 XD ....

自己一直在~TRACE 半天 CODE 剛才馬上有人貼網址給我~>_<"

http://blog.eaxi.com/jsoncpp%E6%89%A7%E8%A1%8C%E6%97%B6%E9%94%99%E8%AF%AF%EF%BC%9A-json-test-src-lib-json-json-value/

soncpp執行時錯誤:
json_test: src/lib_json/json_value.cpp:1025: Json::Value& Json::Value::resolveReference(const char*, bool): Assertion `type_ == nullValue || type_ == objectValue』 failed.

原因分析:
Jsoncpp解析非法json時,會自動容錯成字符類型。對字符類型取下標時,會觸發assert終止進程。

解決方法:
方案1 對Json::Value取下標前,先判斷(value.type()==Json::objectValue)。
方案2 啟用嚴格模式,讓非法的json解析時直接返回false,不自動容錯。
Json::Features f = Json::Features::strictMode();
Json::Reader reader(f);
你累了嗎? 這樣不行 , 人要比 LINUX 兇 @@ " ......

FIEND

  • 鑽研的研究生
  • *****
  • 文章數: 700
    • 檢視個人資料
    • http://bbs.ecstart.com
Re: jsoncpp Program terminated with signal 6
« 回覆 #3 於: 2012-09-06 16:48 »

經過我瘋狂的 DOS .... JSONCPP 果然 不會掛了...

又學了一招 這次比較快 , 馬上就有善心人事 SKYPE 密我 答案了 @@.  ~XD..


你累了嗎? 這樣不行 , 人要比 LINUX 兇 @@ " ......