Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t corrupt the yyjson pool when reentering orjson.loads #427

Closed
wants to merge 1 commit into from

Commits on Sep 8, 2023

  1. Don’t corrupt the yyjson pool when reentering orjson.loads

    orjson.loads may allocate a Python object that triggers a garbage
    collection that invokes a destructor that calls orjson.loads again.
    Or the destructor may release the GIL so a different thread can call
    orjson.loads.  To remain safe under such reentrancy, we need to avoid
    reinitializing the yyjson pool while it might still be in use.  The
    simplest fix is to initialize the yyjson pool only once, like we did
    before commit e9b745e.
    
    Fixes ijl#415.
    
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>
    andersk committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    96a681d View commit details
    Browse the repository at this point in the history