Skip to content

Fix nullptr access in IsInjectedError() for stress test #13968

Closed
hx235 wants to merge 1 commit intofacebook:mainfrom
hx235:fix_fault_inject_fs_nullptr
Closed

Fix nullptr access in IsInjectedError() for stress test #13968
hx235 wants to merge 1 commit intofacebook:mainfrom
hx235:fix_fault_inject_fs_nullptr

Conversation

@hx235
Copy link
Contributor

@hx235 hx235 commented Sep 18, 2025

Context/Summary:
Status::state can be nullptr when created with no specific error message. std::strstr on nullptr caused some segfault in our stress test.

Test plan:
Monitor stress test

@meta-cla meta-cla bot added the CLA Signed label Sep 18, 2025
@facebook-github-bot
Copy link
Contributor

@hx235 has imported this pull request. If you are a Meta employee, you can view this in D82695541.

@hx235 hx235 requested a review from jaykorean September 18, 2025 03:06
specific_error_marker.empty() ||
std::strstr(state, specific_error_marker.c_str()) != nullptr;

return is_injected_error && is_specific_error;
Copy link
Contributor Author

@hx235 hx235 Sep 18, 2025

Choose a reason for hiding this comment

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

We should have done the two checks from the beginning for IsFailedToWriteToWALError() since the function is always under the context of injected error though it's harmless right now without it.

Copy link
Contributor

@jaykorean jaykorean left a comment

Choose a reason for hiding this comment

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

Thanks!

@facebook-github-bot
Copy link
Contributor

@hx235 merged this pull request in 6a202c5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants