-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-43946: [C++][Parquet] Guard against use of cleared decryptor/encryptor #43947
Conversation
|
f206c0a
to
b253529
Compare
b253529
to
58b5daf
Compare
@github-actions crossbow submit -g cpp |
This comment was marked as outdated.
This comment was marked as outdated.
@adamreeve Does this look good to you? |
We have a nice example of the guard being triggered here: This was a sporadic crash before: |
This looks good to me, impressive work tracking down the cause of the segfault! |
Does it mean that |
@@ -413,6 +423,12 @@ class AesDecryptor::AesDecryptorImpl { | |||
} | |||
|
|||
private: | |||
void CheckValid() { | |||
if (ctx_ == nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ctx_ == nullptr) { | |
if (ARROW_PREDICT_FALSE(ctx_ == nullptr)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that compilers automatically treated branches that throw an exception to be unlikely, but I can't find a reference. @felipecrv Do you know about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, judging from https://www.youtube.com/watch?v=T84swS6DCRo (at 29:00), the gcc compiler already uses such a heuristic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CheckValid should be const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @mapleFU
@@ -89,6 +89,12 @@ class AesEncryptor::AesEncryptorImpl { | |||
} | |||
|
|||
private: | |||
void CheckValid() { | |||
if (ctx_ == nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ctx_ == nullptr) { | |
if (ARROW_PREDICT_FALSE(ctx_ == nullptr)) { |
It seems to be non-deterministic in this particular test, as the dataset reading is multi-threaded (you can see this in the stack traces above). |
58b5daf
to
0fb9ee6
Compare
@github-actions crossbow submit -g cpp |
Revision: 0fb9ee6 Submitted crossbow builds: ursacomputing/crossbow @ actions-0c32dece8e |
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 032e6a4. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…/encryptor (apache#43947) This is to get a clearer error rather than an obscure crash, see apache#43057 for an example. * GitHub Issue: apache#43946 Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
…/encryptor (apache#43947) This is to get a clearer error rather than an obscure crash, see apache#43057 for an example. * GitHub Issue: apache#43946 Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
This is to get a clearer error rather than an obscure crash, see #43057 for an example.