2

I ' m developing an c++ application to handle transactions,I'm using JSON SPirit to parse/ generate JSOn's. It works perfectly fine until we try a heavy load of transactions . At that time(more than 30 transactions) it crashes.When I look in to the log , the problem seems to be in the Json spirit library --> Boost.

Have anyone experience the same problem, and could give us some advice, since we have reached a dead end an we are thinking to change to another json parse/generator library Here is one of the examples of the core error log

std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_erase 
(this=this@entry=0x7f8aa1ffa540, __x=0x6d7269666e6f633c) at /usr/include/c++/4.7/bits/stl_tree.h:1082

0x000000000041af99 in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_erase 
(this=0x7f8aa1ffa540, __x=0x7f8ab802d970) at /usr/include/c++/4.7/bits/stl_tree.h:1082

0x000000000041b025 in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::~_Rb_tree (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/4.7/bits/stl_tree.h:646

0x000000000043b9de in ~map (this=0x7f8aa1ffa540, __in_chrg=<optimized out>) at /usr/include/c++/4.7/bits/stl_map.h:90**
r.v
  • 4,697
  • 6
  • 35
  • 57
  • 1
    Can you post any code that generates the error? – sedavidw Jul 09 '13 at 19:52
  • Is it multi-threaded code? – Martin York Jul 09 '13 at 20:41
  • 1
    Most likely explanation is you have multiple threads accessing a data structure that is not protected by a mutex. – brian beuning Jul 09 '13 at 21:25
  • 1
    I have a similar issue. For me it appears if you enable BOOST_SPIRIT_THREADSAFE as suggested by the docs. Obviously without BOOST_SPIRIT_THREADSAFE defined json_spirit wont guarantee any thread safety. For me it just crashes directly without any load right now. However, it could solve your issue if you haven't enabled BOOST_SPIRIT_THREADSAFE yet - do it now :) – Alex Kremer Aug 07 '13 at 13:46

0 Answers0