Giter VIP home page Giter VIP logo

Comments (7)

nlohmann avatar nlohmann commented on June 18, 2024

Can you please try the latest version?

from json.

Johnny-Martin avatar Johnny-Martin commented on June 18, 2024

Hi nlohmann, thanks for your reply.
I'am afraid we can't just upgrade to the latest version before we figure out the rootcause.
Our product is a SDK, not an application. We offerd this SDK to our customer and the customer develop the final application with the SDK. Upgrade to latest version maybe fix this crash, and maybe not, we can't tell our customer that the crash MAYBE fixd.

I did some troubleshooting and I would be very greatful if you can give me some advise.

class parser{
....
 void parse(const bool strict, BasicJsonType& result)
{
            json_sax_dom_parser<BasicJsonType> sdp(result, allow_exceptions);
            sax_parse_internal(&sdp);
.......
}
.......
bool sax_parse_internal(SAX* sax)
{
        ........
        if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string))
        {
             return sax->parse_error(m_lexer.get_position(),
                                                    m_lexer.get_token_string(),
                                                    parse_error::create(101, m_lexer.get_position(),
                                                    exception_message(token_type::value_string, "object key")));
        }

If the allow_exceptions of parser object is specfied to false, can we just omit the parse_error::create when error occured in sax_parse_internal?

from json.

nlohmann avatar nlohmann commented on June 18, 2024

The reason I asked is that we do not provide support for older versions, and 3.7.3 is over 4 years old.

Nevertheless, the issue seems not to be actually throwing an exception, but rather creating an exception object (or logic_error). Can you please check if you can create a json::parse_error object (or logic_error object) with your setup? There was a similar bug in MSVC which broke when exception objects were created when exceptions were switched off.

from json.

Johnny-Martin avatar Johnny-Martin commented on June 18, 2024

Thanks for you advise, I tried in my device and create json::parse_error object million times, it's totally OK.

from json.

nlohmann avatar nlohmann commented on June 18, 2024

Not sure what to do now. I would still assume it's not a library issue, but rather an issue in the used STL.

from json.

Johnny-Martin avatar Johnny-Martin commented on June 18, 2024

You are right, may be we can discuss with the customer and take an A/B test for the latest version and the current version, see if it works.

from json.

nlohmann avatar nlohmann commented on June 18, 2024

I won't expect much since we did not touch that part in a while (which is the reason I think it's fine). How often does the signal occur?

from json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.