You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(5) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(10) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
|
May
(30) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Stephan B. <sg...@go...> - 2010-04-08 14:44:26
|
My appologies if this hits the list twice... the jsoncpp docs say to send comments to the list but don't say it is a subscriber-only list.... ---------- Forwarded message ---------- From: Stephan Beal <sg...@go...> Date: Thu, Apr 8, 2010 at 4:41 PM Subject: Fwd: jsoncpp and libs11n To: jso...@li... i finally found the dev list address at the bottom/right of the doxygen docs, so i'm re-sending this to the list... ---------- Forwarded message ---------- From: Stephan Beal <sg...@go...> Date: Thu, Apr 8, 2010 at 3:17 PM Subject: jsoncpp and libs11n To: bl...@us... Hi, Babtiste! i am the author of the libs11n project (http://s11n.net), a generic serialization framework for C++, and i wanted to take a moment to tell you how i'm using jsoncpp... Brief overview: s11n is, unlike most serialization frameworks, ignorant of any data types. Like jsoncpp, it uses a DOM-like structure, and arbitrary i/o formatters can be written which use those DOM-like structures. s11n currently has 6 or 8 different data formats, and was the first serialization library ever (AFAIK) to be able to serialize C++ objects directly to email ( http://blog.s11n.net/?p=17). Anyway... i only came across jsoncpp yesterday, during my semi-monthly searches for C/C++-based JSON i/o handlers. So far jsoncpp is the only one where i've look at it and said, "yes! This is an API i can enjoy using!" Last night i started writing an i/o handler based on your code (with only 1 small patch), and we can now serialize near-arbitrary C++ objects to json :). Over the weekend i'll get the input support working. i was going to suggest the addition of an event-based parser (it would significantly cut the memory costs for deserialization in my case), but i see you've added it to your jsoncpp roadmap :). As a demonstration, here we'll serialize a std::vector< std::list<T> > ... int main() { using namespace Json; namespace sio = s11n::io; namespace sli = s11nlite; typedef s11n::Detail::variant Var; if(1) { typedef Var ValueT; typedef std::list<ValueT> LT; LT list; int i = 0; for( i = 0; i < 5; ++i ) { list.push_back( "Var #"+Var(i).str() ); list.push_back( Var(i*1.33) ); list.push_back( Var(i) ); } sli::node_type no; typedef sio::json_serializer<sli::node_type> SerT; s11nlite::serialize( no, list ); SerT ser; //ser.serialize( no, std::cout ); typedef std::vector< LT > VT; VT vec; for( i = 0; i < 2; ++i ) { vec.push_back( list ); } //sli::node_traits::clear( no ); //s11nlite::serialize( no, list ); sli::node_traits::clear( no ); s11nlite::serialize( no, vec ); ser.serialize( no, std::cout ); } return 0; } that produces output like: {"s11nIoJsonSerializer": {"name":"s11n_node", "s11nClass":"vector", "children":[ {"name":"s11n_node", "s11nClass":"list", "properties":{ "x00":"Var #0", "x01":0, "x02":0, "x03":"Var #1", "x04":1.330, "x05":1, "x06":"Var #2", "x07":2.660, "x08":2, "x09":"Var #3", "x0a":3.990, "x0b":3, "x0c":"Var #4", "x0d":5.320, "x0e":4 } } ] ... } } (the 'x' prefixes on the properties are there for long historical reasons involving requirements for 'key' elements for certain data formats... only array/list-like classes do that.) Not only that, but we can easily convert between any of s11n's supported formats (i think it now has 7 or 8) and json by using s11nconvert ( http://s11n.net/s11nconvert/) or the C++ API (it only takes a couple lines of code to convert arbitrary serialized objects). i have a couple tiny additions to jsoncpp i would like to submit for your consideration. What channel do you prefer for that? Is here a mailing list or google group? Anyway... i thought you might like to know that someone's getting some good use out of your code. Happy hacking!! And THANK YOU VERY MUCH for releasing jsoncpp into the Public Domain (http://s11n.net/license.php). -- ----- stephan beal http://wanderinghorse.net/home/stephan/ -- ----- stephan beal http://wanderinghorse.net/home/stephan/ -- ----- stephan beal http://wanderinghorse.net/home/stephan/ |
From: Stephan B. <sg...@go...> - 2010-04-08 14:41:49
|
i finally found the dev list address at the bottom/right of the doxygen docs, so i'm re-sending this to the list... ---------- Forwarded message ---------- From: Stephan Beal <sg...@go...> Date: Thu, Apr 8, 2010 at 3:17 PM Subject: jsoncpp and libs11n To: bl...@us... Hi, Babtiste! i am the author of the libs11n project (http://s11n.net), a generic serialization framework for C++, and i wanted to take a moment to tell you how i'm using jsoncpp... Brief overview: s11n is, unlike most serialization frameworks, ignorant of any data types. Like jsoncpp, it uses a DOM-like structure, and arbitrary i/o formatters can be written which use those DOM-like structures. s11n currently has 6 or 8 different data formats, and was the first serialization library ever (AFAIK) to be able to serialize C++ objects directly to email ( http://blog.s11n.net/?p=17). Anyway... i only came across jsoncpp yesterday, during my semi-monthly searches for C/C++-based JSON i/o handlers. So far jsoncpp is the only one where i've look at it and said, "yes! This is an API i can enjoy using!" Last night i started writing an i/o handler based on your code (with only 1 small patch), and we can now serialize near-arbitrary C++ objects to json :). Over the weekend i'll get the input support working. i was going to suggest the addition of an event-based parser (it would significantly cut the memory costs for deserialization in my case), but i see you've added it to your jsoncpp roadmap :). As a demonstration, here we'll serialize a std::vector< std::list<T> > ... int main() { using namespace Json; namespace sio = s11n::io; namespace sli = s11nlite; typedef s11n::Detail::variant Var; if(1) { typedef Var ValueT; typedef std::list<ValueT> LT; LT list; int i = 0; for( i = 0; i < 5; ++i ) { list.push_back( "Var #"+Var(i).str() ); list.push_back( Var(i*1.33) ); list.push_back( Var(i) ); } sli::node_type no; typedef sio::json_serializer<sli::node_type> SerT; s11nlite::serialize( no, list ); SerT ser; //ser.serialize( no, std::cout ); typedef std::vector< LT > VT; VT vec; for( i = 0; i < 2; ++i ) { vec.push_back( list ); } //sli::node_traits::clear( no ); //s11nlite::serialize( no, list ); sli::node_traits::clear( no ); s11nlite::serialize( no, vec ); ser.serialize( no, std::cout ); } return 0; } that produces output like: {"s11nIoJsonSerializer": {"name":"s11n_node", "s11nClass":"vector", "children":[ {"name":"s11n_node", "s11nClass":"list", "properties":{ "x00":"Var #0", "x01":0, "x02":0, "x03":"Var #1", "x04":1.330, "x05":1, "x06":"Var #2", "x07":2.660, "x08":2, "x09":"Var #3", "x0a":3.990, "x0b":3, "x0c":"Var #4", "x0d":5.320, "x0e":4 } } ] ... } } (the 'x' prefixes on the properties are there for long historical reasons involving requirements for 'key' elements for certain data formats... only array/list-like classes do that.) Not only that, but we can easily convert between any of s11n's supported formats (i think it now has 7 or 8) and json by using s11nconvert ( http://s11n.net/s11nconvert/) or the C++ API (it only takes a couple lines of code to convert arbitrary serialized objects). i have a couple tiny additions to jsoncpp i would like to submit for your consideration. What channel do you prefer for that? Is here a mailing list or google group? Anyway... i thought you might like to know that someone's getting some good use out of your code. Happy hacking!! And THANK YOU VERY MUCH for releasing jsoncpp into the Public Domain (http://s11n.net/license.php). -- ----- stephan beal http://wanderinghorse.net/home/stephan/ -- ----- stephan beal http://wanderinghorse.net/home/stephan/ |
From: Baptiste L. <bap...@gm...> - 2010-03-12 10:12:47
|
Announce blurb: JsonCpp provides an easy to use API for reading, writing and manipulating JSON values. It is written to be highly portable as long as your C++ compiler supports namespace and has "basic" STL support. JsonCpp has been around since 2005 and it is way past the time to make an official release. Notes: the release procedure is (mostly) automated by makerelease.py script: it handle tagging, tarball generation, tarball decompression and build check, version bumping, documentation upload. The build system has been modified to retrieve the version number from the file "version" at the root of the project. Baptiste. |
From: Baptiste L. <bap...@gm...> - 2010-02-23 16:01:33
|
Hi all, I've been getting a lot of positive feedbacks on JsonCpp lately and many contributions in the last 3 months. I've also got a few "where can I download JsonCpp" questions... So, I think it is well past time to actually publish a tarball to make the sources more accessible. Current release plans are: - remove the "experimental" nature of the iterator API (many users feedback indicate that it works even though we still lack tests to prove it) - tag the source with release-0.5.0 - makes a tarball of a svn export - publish the source and doc tarball on sourceforge The current doc have already been published to http://jsoncpp.sf.net/. Does anyone see any "MUST DO before release" items? I plan to make the release this week-end, unless a serious show stopper appears. Baptiste. |
From: Baptiste L. <bap...@gm...> - 2010-02-22 08:58:59
|
Hi all, just a head up to let you know that I modified the build system. Doxygen documentation is no longer generated from the Scons script. To replace it, a small python script named doxybuild.py is invoked from the command-line. It uses doc/doxyfile.in as a template, does substitution (version number & directories), and optionaly generates the tarball. This solves all the (build) issues related to having doxygen generation in Scons, and makes development workflow easier when working on the doc (e.g. you can opt out of graph generation to reduce doc generation time and are assurred that the doc is regenerated). * Building the documentation: =========================== Run the python script doxybuild.py from the top directory: python doxybuild.py --open --with-dot See doxybuild.py --help for options. E:\prg\vc\Lib\jsoncpp-trunk>python doxybuild.py -h Usage: doxybuild.py Generates doxygen documentation in build/doxygen. Optionaly makes a tarball of the documentation to dist/. Must be started in the project top directory. Options: -h, --help show this help message and exit --with-dot Enable usage of DOT to generate collaboration diagram --dot=DOT_PATH Path to GraphViz dot tool. Must be full qualified path. [Default: c:\wut\files\Graphviz\bin\dot.exe] --doxygen=DOXYGEN_PATH Path to Doxygen tool. [Default: C:\wut\prg\doxygen\bin\doxygen.exe] --with-html-help Enable generation of Microsoft HTML HELP --no-uml-look Generates DOT graph without UML look [Default: False] --open Open the HTML index in the web browser after generation --tarball Generates a tarball of the documentation in dist/ directory |
From: Baptiste L. <bap...@gm...> - 2010-02-18 16:15:06
|
You can only get the code from the SVN repository at the current time. There is no embedded support for XML conversion, but it should be easy to do as you can easily walk the object tree (test already to serialization in a flat format for comparison against expected output). Baptiste. 2010/2/17 sking <sk...@we...> > Hi, > > I can’t seem to find the link to download the code? > > Any install script needed. > > I am looking for a c++ version of json to xml convertor. > > Thanks > > > > Sam > |
From: sking <sk...@we...> - 2010-02-17 17:38:35
|
Hi, I can't seem to find the link to download the code? Any install script needed. I am looking for a c++ version of json to xml convertor. Thanks Sam |
From: Leonardo M. <leo...@gm...> - 2009-12-14 03:43:33
|
Hello, I'm using jsoncpp in a project of mine and I love it. It compiles and runs fine with the windows compiler but in linux it is failing to compile in what should be an easily fixable problem. Output of gcc/g++: (Lines selected by me not occured in that order but they are the same problem) son_reader.cpp:(.text+0x6f4): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()' Release/json/json_reader.o: In function `Json::Reader::getLocationLineAndColumn(char const*) const': json_reader.cpp:(.text+0x995): undefined reference to `std::allocator<char>::allocator()' Release/json/json_reader.o: In function `Json::Reader::decodeUnicodeEscapeSequence(Json::Reader::Token&, char const*&, char const*, unsigned int&)': json_reader.cpp:(.text+0xe15): undefined reference to `std::allocator<char>::allocator()' Searches in google lead me to add "-lstdc++" to the linking process but the same happens and I confirm that a simple use of the Standard Library without json compiles. I know that this is not a problem in json code but the fact is that I can't resolve it. |
From: Baptiste L. <bap...@gm...> - 2009-11-18 22:26:30
|
Test added and code fixed. Thanks for signaling this, Baptiste. Le 18 novembre 2009 15:27, Frédéric SURLEAU <fre...@ar...> a écrit : > Hi, > > Example : > > { > "test": > [ > { "a" : "aaa" }, // Comment for a > { "b" : "bbb" }, // Comment for b > { "c" : "ccc" } // Comment for c > ] > } > > With this example you get an error : "Missing ',' or ']' in array > declaration" for "// Comment for c" > > I fixed the problem by reading tokens in the same way readObject() does. > > Fixed version of readArray() : > > bool > Reader::readArray( Token &tokenStart ) > { > currentValue() = Value( arrayValue ); > skipSpaces(); > if ( *current_ == ']' ) // empty array > { > Token endArray; > readToken( endArray ); > return true; > } > int index = 0; > while ( true ) > { > Value &value = currentValue()[ index++ ]; > nodes_.push( &value ); > bool ok = readValue(); > nodes_.pop(); > if ( !ok ) // error already set > return recoverFromError( tokenArrayEnd ); > > Token token; > * // Accept Comment after last item in the array. > ok = readToken( token ); > while ( token.type_ == tokenComment && ok ) > ok = readToken( token ); > if( ! ok > * || ( token.type_ != tokenArraySeparator && > token.type_ != tokenArrayEnd ) ) > { > return addErrorAndRecover( "Missing ',' or ']' in array > declaration", > > token, > > tokenArrayEnd ); > } > if ( token.type_ == tokenArrayEnd ) > break; > } > return true; > } > > > Regards, > Frédéric SURLEAU. > |
From: Baptiste L. <bap...@gm...> - 2009-11-18 22:03:26
|
I just added the tests from jsonchecker (http://json.org/JSON_checker/). The good news is that we only have missing failures, all the "pass" tests pass... Failure details can be found below. I have modified the reader to allow support of a "strict" mode. The Reader now accept a Features instance which describes which extension are allowed. JsonCpp supports for comments and non array/object as root value (see features.h) for instance. The failures fall into a few categories: 1. Extra text after root JSON value 2. Forbidden control character inside string 3. Bad real number 4. Too deep nesting of values My take on this would be to make 1 & 4 extensions (features that can be turned off), and 2 & 3 always fail. 1 makes is already supported by python JSON API 4 makes sense for portability, but can be handy (assuming the nesting limitation is not only for array) Has anyone a different mind on this? Anyone willing to tackle some of the failure? (on a side note, I fixed unit tests execution when running with scons). * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail10.json Parsing should have failed: {"Extra value after close": true} "misplaced quoted value" * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail13.json Parsing should have failed: {"Numbers cannot have leading zeroes": 013} * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail18.json Parsing should have failed: [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail25.json Parsing should have failed: [" tab character in string "] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail27.json Parsing should have failed: ["line break"] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail29.json Parsing should have failed: [0e] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail30.json Parsing should have failed: [0e+] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail31.json Parsing should have failed: [0e+-1] * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail7.json Parsing should have failed: ["Comma after the close"], * Test E:\prg\vc\Lib\jsoncpp-trunk\test\jsonchecker\fail8.json Parsing should have failed: ["Extra close"]] Test results: 29 passed, 10 failed. |
From: Frédéric S. <fre...@ar...> - 2009-11-18 14:43:39
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#000000"> Hi,<br> <br> Example :<br> <br> {<br> "test":<br> [<br> { "a" : "aaa" }, // Comment for a<br> { "b" : "bbb" }, // Comment for b<br> { "c" : "ccc" } // Comment for c<br> ]<br> }<br> <br> With this example you get an error : "Missing ',' or ']' in array declaration" for "// Comment for c"<br> <br> I fixed the problem by reading tokens in the same way readObject() does.<br> <br> Fixed version of readArray() :<br> <br> <tt>bool<br> Reader::readArray( Token &tokenStart )<br> {<br> currentValue() = Value( arrayValue );<br> skipSpaces();<br> if ( *current_ == ']' ) // empty array<br> {<br> Token endArray;<br> readToken( endArray );<br> return true;<br> }<br> int index = 0;<br> while ( true )<br> {<br> Value &value = currentValue()[ index++ ];<br> nodes_.push( &value );<br> bool ok = readValue();<br> nodes_.pop();<br> if ( !ok ) // error already set<br> return recoverFromError( tokenArrayEnd );<br> <br> Token token;<br> <font color="#3333ff"><b> // Accept Comment after last item in the array.<br> ok = readToken( token );<br> while ( token.type_ == tokenComment && ok )<br> ok = readToken( token );<br> if( ! ok<br> </b></font> || ( token.type_ != tokenArraySeparator &&<br> token.type_ != tokenArrayEnd ) )<br> {<br> return addErrorAndRecover( "Missing ',' or ']' in array declaration",<br> token,<br> tokenArrayEnd );<br> }<br> if ( token.type_ == tokenArrayEnd )<br> break;<br> }<br> return true;<br> }<br> </tt><br> <br> Regards,<br> Frédéric SURLEAU.<br> <br> </body> </html> |
From: Baptiste L. <bap...@gm...> - 2009-11-12 16:04:30
|
You can get the code from the subversion repository. See the following page for detail: https://sourceforge.net/scm/?type=svn&group_id=144446 Baptiste. 2009/11/12 Lewis Alan <Ala...@uk...> > Hello > > I am doing a proof of concept and I think that jsoncpp would be very > helpful. Can I use the code? If so, please let me know from where it can be > downloaded. > > > Kind regards, > > Alan Lewis > Customer Solution Architect > mob: 07867 826076 > > |
From: Lewis A. <Ala...@uk...> - 2009-11-12 11:35:06
|
Hello I am doing a proof of concept and I think that jsoncpp would be very helpful. Can I use the code? If so, please let me know from where it can be downloaded. Kind regards, Alan Lewis Customer Solution Architect mob: 07867 826076 |
From: Scott S. <sis...@gm...> - 2009-10-15 07:52:25
|
I figured it out. I had deleted the root object. I left a comment in the code below explaining. for(unsigned int row = 0; row < LROWS; row++ ) { sprintf(str, "row%d", row); Json::Value *cfg_row = CFG_Fetch_Raw(layout, (const char*)str); if(!cfg_row) continue; for(unsigned int col = 0; col < LCOLS; col++ ) { sprintf(str, "col%d", col); Json::Value *cfg_col = CFG_Fetch_Raw(cfg_row, (const char*)str); if(!cfg_col || !cfg_col->isString()) { // right here I had deleted cfg_row, so the next pass gave CFG_Fetch_Raw garbage for its root Json::Value. // The first step CFG_Fetch_Raw does is to check if str is a member of cfg_row. That's where the crash came in. if(cfg_col) delete cfg_col; continue; } //std::cout << cfg_col->asCString() << std::endl; widget_template w = widget_template(); w.key = (char *)malloc(cfg_col->asString().size() + 1); memcpy((void *)w.key, (void *)const_cast<char *>(cfg_col->asCString()), cfg_col->asString().capacity() + 1); w.row = row; w.col = col; widget_templates[layouts[i]].push_back(w); delete cfg_col; } delete cfg_row; } On Thu, Oct 15, 2009 at 2:43 AM, Baptiste Lepilleur < bl...@us...> wrote: > This is strange. The only way other.c_str_ can be null is for other to be > an array index: > > Value::CZString::CZString( int index ) > > : cstr_( 0 ) > > , index_( index ) > > { > > } > > > > But trying to access an objectValue or an arrayValue with the "wrong" type > should be detected before we even go to the comparison level: > > Value & > > Value::operator[]( const char *key ) > > { > > return resolveReference( key, false ); > > } > > > > > > Value & > > Value::resolveReference( const char *key, > > bool isStatic ) > > { > > *JSON_ASSERT( type_ == nullValue || type_ == objectValue );* > > > > Do you have any idea what is content of you value and what access you are > doing? > > > > ----- Original Message ----- > *From:* Scott Sibley <sis...@gm...> > *To:* jso...@li... > *Sent:* Wednesday 14 October 2009 03:27 > *Subject:* [Jsoncpp-devel] Bug? > > Looks like other.cstr_ should be checked as well. > > #0 0x00212bd8 in strcmp () from /lib/libc.so.6 > #1 0x0012ed2f in Json::Value::CZString::operator< (this=0x8317300, other=@0xbfffeeac) > > at src/lib_json/json_value.cpp:221 > #2 0x001361b0 in std::less<Json::Value::CZString>::operator() (this=0x83173a0, __x=@0x8317300, > __y <__y=@0xbfffeeac>=@0xbfffeeac) > > 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, __k=@0xbfffeeac) > > 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, __k=@0xbfffeeac) > > 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, __x=@0xbfffeeac) > > 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_; > } > > ------------------------------ > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > > ------------------------------ > > _______________________________________________ > Jsoncpp-devel mailing list > Jso...@li... > https://lists.sourceforge.net/lists/listinfo/jsoncpp-devel > > |
From: Baptiste L. <bl...@us...> - 2009-10-15 07:43:59
|
This is strange. The only way other.c_str_ can be null is for other to be an array index: Value::CZString::CZString( int index ) : cstr_( 0 ) , index_( index ) { } But trying to access an objectValue or an arrayValue with the "wrong" type should be detected before we even go to the comparison level: Value & Value::operator[]( const char *key ) { return resolveReference( key, false ); } Value & Value::resolveReference( const char *key, bool isStatic ) { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); Do you have any idea what is content of you value and what access you are doing? ----- Original Message ----- From: Scott Sibley To: jso...@li... Sent: Wednesday 14 October 2009 03:27 Subject: [Jsoncpp-devel] Bug? Looks like other.cstr_ should be checked as well.#0 0x00212bd8 in strcmp () from /lib/libc.so.6#1 0x0012ed2f in Json::Value::CZString::operator< (this=0x8317300, other=@0xbfffeeac) at src/lib_json/json_value.cpp:221 #2 0x001361b0 in std::less<Json::Value::CZString>::operator() (this=0x83173a0, __x=@0x8317300, __y=@0xbfffeeac) 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, __k=@0xbfffeeac) 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, __k=@0xbfffeeac) 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, __x=@0xbfffeeac) 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 boolValue::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_; } ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ------------------------------------------------------------------------------ _______________________________________________ Jsoncpp-devel mailing list Jso...@li... https://lists.sourceforge.net/lists/listinfo/jsoncpp-devel |
From: Scott S. <sis...@gm...> - 2009-10-14 05:43:14
|
Turns out this was my fault. I freed a pointer in the wrong scope, which on the next pass was garbage. On Tue, Oct 13, 2009 at 8:35 PM, Scott Sibley <sis...@gm...> wrote: > I had opened a question about this on Stackoverflow. Someone pointed out > that the other value wasn't being checked, but he followed up with the > following comments later on. > > "That's not the problem, however, since other is not null in this case. > Rather it looks like the other object may have been deleted. How are you > managing the lifetimes of the objects in the std::map container? Is it > possible that one of the values was deleted without being removed from the > map?" > > > On Tue, Oct 13, 2009 at 8:27 PM, Scott Sibley <sis...@gm...> wrote: > >> Looks like other.cstr_ should be checked as well. >> >> #0 0x00212bd8 in strcmp () from /lib/libc.so.6 >> #1 0x0012ed2f in Json::Value::CZString::operator< (this=0x8317300, other=@0xbfffeeac) >> >> >> at src/lib_json/json_value.cpp:221 >> #2 0x001361b0 in std::less<Json::Value::CZString>::operator() (this=0x83173a0, __x=@0x8317300, >> __y=@0xbfffeeac) >> >> 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, __k=@0xbfffeeac) >> >> 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, __k=@0xbfffeeac) >> >> >> 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, __x=@0xbfffeeac) >> >> >> 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_; >> } >> >> > |
From: Scott S. <sis...@gm...> - 2009-10-14 01:42:43
|
I had opened a question about this on Stackoverflow. Someone pointed out that the other value wasn't being checked, but he followed up with the following comments later on. "That's not the problem, however, since other is not null in this case. Rather it looks like the other object may have been deleted. How are you managing the lifetimes of the objects in the std::map container? Is it possible that one of the values was deleted without being removed from the map?" On Tue, Oct 13, 2009 at 8:27 PM, Scott Sibley <sis...@gm...> wrote: > Looks like other.cstr_ should be checked as well. > > #0 0x00212bd8 in strcmp () from /lib/libc.so.6 > #1 0x0012ed2f in Json::Value::CZString::operator< (this=0x8317300, other=@0xbfffeeac) > > at src/lib_json/json_value.cpp:221 > #2 0x001361b0 in std::less<Json::Value::CZString>::operator() (this=0x83173a0, __x=@0x8317300, > __y=@0xbfffeeac) > > 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, __k=@0xbfffeeac) > > 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, __k=@0xbfffeeac) > > 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, __x=@0xbfffeeac) > > 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_; > } > > |
From: Scott S. <sis...@gm...> - 2009-10-14 01:27:42
|
Looks like other.cstr_ should be checked as well. #0 0x00212bd8 in strcmp () from /lib/libc.so.6 #1 0x0012ed2f in Json::Value::CZString::operator< (this=0x8317300, other=@0xbfffeeac) at src/lib_json/json_value.cpp:221 #2 0x001361b0 in std::less<Json::Value::CZString>::operator() (this=0x83173a0, __x=@0x8317300, __y=@0xbfffeeac) 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, __k=@0xbfffeeac) 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, __k=@0xbfffeeac) 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, __x=@0xbfffeeac) 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_; } |