Giter Site home page Giter Site logo

Comments (9)

johnezang avatar johnezang commented on May 15, 2024

After working with Andy on this bug (thanks @andypotion!), we were able to determine the cause of the problem.

However, since this is a bug that is specific to Mac OS X 10.7 / Lion, there are various NDA issues involved in discussing the problem publicly.

A work-around is known, but there's a legitimate question as to whether or not this is a bug in JSONKit or not. It's not clear if the work around should be checked in or if the problem should be resolved "up stream" from JSONKit, so to speak.

from jsonkit.

johnezang avatar johnezang commented on May 15, 2024

This is likely a duplicate of issue #9.

from jsonkit.

snej avatar snej commented on May 15, 2024

JSONKit is groping into an NSNumber object to dereference the 'isa' field. As far as I know this is not kosher since it makes assumptions about object memory layout that Apple could change in future OS versions, including Lion. I don't think you can assign blame upstream to Foundation.

This is probably faster than using the Obj-C runtime API to look up the class, but I don't think you can continue to do it, at least not in these hypothetical future OS versions/configurations where Apple may or may not have changed the layout of certain objects. You might need to use #ifdefs to fall back to safer, if slower, techniques.

from jsonkit.

snej avatar snej commented on May 15, 2024

Now that Lion is no longer under NDA, could someone please post the workaround as a patch?

from jsonkit.

hiltonc avatar hiltonc commented on May 15, 2024

I'm also running into this problem. Anyone have a fix?

from jsonkit.

snej avatar snej commented on May 15, 2024

My current workaround is to use NSJSONSerialization instead, when it's available. I do a runtime check to look up the class by name, and then call it if it's there instead of JSONKit.

from jsonkit.

0xced avatar 0xced commented on May 15, 2024

I guess that Tagged pointers and fast-pathed CFNumber integers in Lion is the cause of this problem.

from jsonkit.

andypotion avatar andypotion commented on May 15, 2024

I just submitted a pull request for this. People needing the fix ASAP should check out my fork.

from jsonkit.

johnezang avatar johnezang commented on May 15, 2024

Fixed in commit c2ef692.

from jsonkit.

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.