Skip to content

BUG: Fix small memory access errors in ujson objToJSON.c #33929

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 1 commit into from
May 2, 2020

Conversation

seberg
Copy link
Contributor

@seberg seberg commented May 1, 2020

These were found (and validated fixed) using valgrind. It is likely
that none of these changes should create any issues (except maybe
on a debug build of python?). But silencing valgrind warnings is
good on its own, to ease possible future debugging using valgrind.


NOTE: I removed skipping of test_astype_generic_timestamp_no_frequency, this is just out of curiosity, I would be very surprised if it made a difference. So this should probably be only merged after undoing the test change.

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@WillAyd
Copy link
Member

WillAyd commented May 1, 2020

JSON changes look good

Out of curiosity is there a guide you can share for running this with valgrind? I’ve tried unsuccessfully in the past but would be interested in knowing how

@seberg
Copy link
Contributor Author

seberg commented May 1, 2020

There is no secret, in this case I did not even to bother debug builds. The only thing to remember nowadays is to use PYTHONMALLOC=malloc as an environment variable, otherwise you will get thousands of false positives (and generally less useful output).

These were found (and validated fixed) using valgrind. It is likely
that none of these changes should create any issues (except maybe
on a debug build of python?). But silencing valgrind warnings is
good on its own, to ease possible future debugging using valgrind.
@seberg seberg force-pushed the ujson-valgrind-bugfix branch from 6e320e3 to e8153af Compare May 1, 2020 22:00
@seberg
Copy link
Contributor Author

seberg commented May 1, 2020

OK, this (unsurprisingly) did not change anything with the test, so removed it from the PR, I guess it should be all set, considering that it is a tiny bug fix really?

@jbrockmendel
Copy link
Member

Travis fail is unrelated, has been affecting a bunch of tests for the last few days

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Lgtm

@WillAyd WillAyd added Clean IO JSON read_json, to_json, json_normalize labels May 2, 2020
@WillAyd WillAyd added this to the 1.1 milestone May 2, 2020
@jreback jreback merged commit 862db64 into pandas-dev:master May 2, 2020
@jreback
Copy link
Contributor

jreback commented May 2, 2020

thanks @seberg

rhshadrach pushed a commit to rhshadrach/pandas that referenced this pull request May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants