Skip to content

BUG/CLN: Vendored ujson Module #49604

Open
@lithomas1

Description

@lithomas1

While working on the meson build integration, I've discovered that the JSON Module is doing some sketchy things.

  1. The ujson extension module should not be named json.

    This can result in a really nasty segfault, since our ujson module tries to initialize numpy's array api(via import_array). In the C code on numpy's side, numpy then tries to import itself. During this process, it needs to initialize its version process via versionneer. Well, it turns out versioneer needs to import json to figure out version stuff. If versioneer picks up pandas' json module, bad things happen since its like a circular import but worse (best case: Python exception saying json failed to initialize, worst case: segfault).

  2. We are using POSIX functions.

    If you're not paying attention to the build warnings, you'll get a segfault, since in C99 mode strdup gets excluded from string.h declarations. Now, Fix build warning for use of strdup in ultrajson #48369 was supposed to fix this so I'm not sure what's going on here.

All in all, this burned like a week of my time, so it would be nice to fix this sometime soon.

cc @WillAyd

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCleanIO JSONread_json, to_json, json_normalize

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions