-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG/CLN: Vendored ujson Module #49604
Comments
Yea I think we can internally reference it always as ujson to avoid conflicts with the stdlib. I did this in the CMake POC if you need a reference. As far as issue 2 is concerned are we appropriately including the header files? If the fix from that issue didn't help can you provide the build warning to review? In the past we would explicitly fail setup on any build warnings but stopped because setuptools could issue spurious things. With a real build system however I would be all for setting -Werror again. Most gcc warnings are in fact serious issues that should be corrected |
See #33315 for history |
Here's the snippet that builds the json module.
|
The only thing I can think of right now, is to remove I vaguely remember meson messing up headers if they happen to get double included. |
Hmm I don't think meson would be doing anything with the headers. Most headers in C should have an include guard to prevent them from being double injected, but that's outside the scope of what meson would do I think. What if you changed the header in ujson.c and ultrajson.h to be |
You might also want to try and execute meson via |
Well, |
we've done some renaming of the functions in the module recently; there shouldn't be any resistance to renaming the module itself |
While working on the meson build integration, I've discovered that the JSON Module is doing some sketchy things.
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).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
The text was updated successfully, but these errors were encountered: