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

Adds checks to make sure json reader won't overflow #13115

Merged
merged 5 commits into from
Apr 13, 2023

Conversation

elstehle
Copy link
Contributor

Description

The JSON reader is currently using 32-bit offsets to index into the input's characters to lower memory footprint and for performance reasons. Hence, currently, if an input larger than UINT_MAX is read, the parser may return incorrect data.

This PR adds a check that fails for inputs that could overflow.

The longer term plan is to make the finite-state transducer stage reentrant and split up inputs larger than UINT_MAX into smaller chunks.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@elstehle elstehle requested a review from a team as a code owner April 11, 2023 15:27
@elstehle elstehle requested review from bdice and vuule April 11, 2023 15:27
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Apr 11, 2023
@elstehle elstehle added bug Something isn't working cuIO cuIO issue non-breaking Non-breaking change labels Apr 11, 2023
Copy link
Contributor

@vuule vuule left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
Posted a few suggestions.

cpp/src/io/json/nested_json_gpu.cu Outdated Show resolved Hide resolved
cpp/src/io/json/nested_json_gpu.cu Show resolved Hide resolved
@elstehle elstehle requested a review from vuule April 12, 2023 06:26
@elstehle
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 3069f1e into rapidsai:branch-23.06 Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cuIO cuIO issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants