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

Copy input in json_parse to avoid ASAN error #7858

Closed
wants to merge 1 commit into from

Conversation

Yuhta
Copy link
Contributor

@Yuhta Yuhta commented Dec 4, 2023

Summary:
value is put on offset 32 of the stack frame, and the total frame size is 88. In case value is inlined, and SIMD register is 64 bytes (e.g. AVX512), simdjson is reading the memory from offset 36 to 100, which exceeds the frame boundary.

This caused some ASAN error, but no issue in production, because the padding data is not really used or changed.

Differential Revision: D51810542

Copy link

netlify bot commented Dec 4, 2023

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 8ff7f21
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/656f3f54933edb0008b28e75

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 4, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51810542

Yuhta added a commit to Yuhta/velox that referenced this pull request Dec 5, 2023
Summary:

`value` is put on offset 32 of the stack frame, and the total frame size is 88.  In case `value` is inlined, and SIMD register is 64 bytes (e.g. AVX512), simdjson is reading the memory from offset 36 to 100, which exceeds the frame boundary.

This caused some ASAN error, but no issue in production, because the padding data is not really used or changed.

Fix it by asking `simdjson::dom::parser::parse` to copy the input to internal padded memory owned by parser.  There is some minor performance loss but is probably not noticeable at query level.

Reviewed By: mbasmanova

Differential Revision: D51810542
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51810542

Yuhta added a commit to Yuhta/velox that referenced this pull request Dec 5, 2023
Summary:

`value` is put on offset 32 of the stack frame, and the total frame size is 88.  In case `value` is inlined, and SIMD register is 64 bytes (e.g. AVX512), simdjson is reading the memory from offset 36 to 100, which exceeds the frame boundary.

This caused some ASAN error, but no issue in production, because the padding data is not really used or changed.

Fix it by asking `simdjson::dom::parser::parse` to copy the input to internal padded memory owned by parser.  There is some minor performance loss but is probably not noticeable at query level.

Reviewed By: mbasmanova

Differential Revision: D51810542
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51810542

Yuhta added a commit to Yuhta/velox that referenced this pull request Dec 5, 2023
Summary:

`value` is put on offset 32 of the stack frame, and the total frame size is 88.  In case `value` is inlined, and SIMD register is 64 bytes (e.g. AVX512), simdjson is reading the memory from offset 36 to 100, which exceeds the frame boundary.

This caused some ASAN error, but no issue in production, because the padding data is not really used or changed.

Fix it by asking `simdjson::dom::parser::parse` to copy the input to internal padded memory owned by parser.  There is some minor performance loss but is probably not noticeable at query level.

Reviewed By: mbasmanova

Differential Revision: D51810542
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51810542

Yuhta added a commit to Yuhta/velox that referenced this pull request Dec 5, 2023
Summary:

`value` is put on offset 32 of the stack frame, and the total frame size is 88.  In case `value` is inlined, and SIMD register is 64 bytes (e.g. AVX512), simdjson is reading the memory from offset 36 to 100, which exceeds the frame boundary.

This caused some ASAN error, but no issue in production, because the padding data is not really used or changed.

Fix it by asking `simdjson::dom::parser::parse` to copy the input to internal padded memory owned by parser.  There is some minor performance loss but is probably not noticeable at query level.

Reviewed By: mbasmanova

Differential Revision: D51810542
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51810542

Summary:

`value` is put on offset 32 of the stack frame, and the total frame size is 88.  In case `value` is inlined, and SIMD register is 64 bytes (e.g. AVX512), simdjson is reading the memory from offset 36 to 100, which exceeds the frame boundary.

This caused some ASAN error, but no issue in production, because the padding data is not really used or changed.

Fix it by asking `simdjson::dom::parser::parse` to copy the input to internal padded memory owned by parser.  There is some minor performance loss but is probably not noticeable at query level.

Reviewed By: mbasmanova

Differential Revision: D51810542
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51810542

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 928f378.

Copy link

Conbench analyzed the 1 benchmark run on commit 928f378a.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants