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

tidb_query: fix UB causing by from_raw_parts (#7635) #7730

Merged
merged 7 commits into from
May 14, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented May 2, 2020

cherry-pick #7635 to release-4.0


Signed-off-by: zhongzc [email protected]

What problem does this PR solve?

Issue Number: close #7613

Problem Summary:

From stdlib doc:

Behavior is undefined if any of the following conditions are violated:

  • data must be valid for reads for len * mem::size_of::() many bytes, and it must be properly aligned.
  • ...

We didn't provide this promise.

What is changed and how it works?

What's Changed:

Introduce a new type LEBytes. Implement binary_search for this type by explicitly calling std::ptr::read_unaligned.

Check List

Tests

  • Unit test

Release note

  • Fixed an undefined behaviour in Coprocessor.

@sre-bot
Copy link
Contributor Author

sre-bot commented May 2, 2020

/run-all-tests

@sre-bot sre-bot added sig/coprocessor SIG: Coprocessor type/cherry-pick Type: PR - Cherry pick labels May 2, 2020
@sre-bot sre-bot requested review from breezewish and brson May 2, 2020 07:23
@sre-bot sre-bot added this to the v4.0.0 milestone May 2, 2020
@breezewish
Copy link
Member

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented May 8, 2020

@sre-bot
Copy link
Contributor Author

sre-bot commented May 11, 2020

Signed-off-by: zhongzc <[email protected]>
@MyonKeminta MyonKeminta modified the milestones: v4.0.0-rc.2, v4.0.0 May 11, 2020
@hicqu
Copy link
Contributor

hicqu commented May 14, 2020

/merge

@sre-bot sre-bot added the status/can-merge Status: Can merge to base branch label May 14, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented May 14, 2020

/run-all-tests

@sre-bot sre-bot merged commit 234cdda into tikv:release-4.0 May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/coprocessor SIG: Coprocessor status/can-merge Status: Can merge to base branch type/cherry-pick Type: PR - Cherry pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants