Skip to content

Removed GNU strdup extension from JSON #49780

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

Merged
merged 15 commits into from
Nov 23, 2022

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Nov 18, 2022

Came up during some of the meson work @lithomas1 is doing. Looks like we allow non-portable GNU extensions in JSON, but these aren't upstream in ultrajson. Couldn't find a history of why we have this.

@WillAyd
Copy link
Member Author

WillAyd commented Nov 18, 2022

@WillAyd WillAyd changed the title Removed GNU extension from JSON Removed GNU strdup extension from JSON Nov 18, 2022
@WillAyd WillAyd mentioned this pull request Nov 18, 2022
5 tasks
Copy link
Member

@lithomas1 lithomas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I guess we were really out of date on our vendored ujson.

@lithomas1 lithomas1 added this to the 2.0 milestone Nov 18, 2022
@lithomas1 lithomas1 added IO JSON read_json, to_json, json_normalize Compat pandas objects compatability with Numpy or Python functions labels Nov 18, 2022
@WillAyd
Copy link
Member Author

WillAyd commented Nov 18, 2022

We are pretty far diverged. Unfortunately when we vendored stuff in the past we would edit in place rather than bolt on to it, so it's hard to sync up with more recent versions

@WillAyd
Copy link
Member Author

WillAyd commented Nov 19, 2022

OK looks like this goes back to #4918 though I think the strdup calls are unnecessary. Let's see...

@WillAyd
Copy link
Member Author

WillAyd commented Nov 21, 2022

Interestingly enough this becomes part of the standard in C2X

@lithomas1
Copy link
Member

FYI, the docs build seems to be segfaulting from a quick glance, since it looks like the same thing that happened to me. If you run it with a single worker, you'll be able to see the exit code, I think (245 is segfault). You can also run it with catchsegv, which'll print out more details if it's actually a segfault.

@WillAyd
Copy link
Member Author

WillAyd commented Nov 22, 2022

Super strange. Cool thanks for the heads up - didn't know about that feature

@WillAyd
Copy link
Member Author

WillAyd commented Nov 22, 2022

Looks like I was freeing the wrong variable. Surprised it didn't segfault on other parts of CI - its possible the locale test isn't really even running but will leave that to another effort

cpplint also complains about strcpy but is fine with memcpy...I think the former would be more clear in this case. Worth reconsidering if we want to continue using cpplint given its not well maintained by Google

Copy link
Member

@lithomas1 lithomas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for cleaning this up. I'll merge this is a day or too, if no one else has any comments.

@mroeschke mroeschke merged commit b6736b4 into pandas-dev:main Nov 23, 2022
@mroeschke
Copy link
Member

Nice cleanup @WillAyd

mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
* removed GNU extension from JSON

* Revert "removed GNU extension from JSON"

This reverts commit cd6b630.

* try again

* Better setlocale error

* Copied string

* make cpplint happy

* typo fix

* memcpy instead of snprintf

* try catchsegv

* single doc build

* Revert "single doc build"

This reverts commit c9f5225.

* Revert "try catchsegv"

This reverts commit a6199a8.

* Fixed wrong free
@WillAyd WillAyd deleted the remove-json-locale branch April 12, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants