-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
debug: Fix crash handling null strings #31523
debug: Fix crash handling null strings #31523
Conversation
When internal debug is enabled output null strings as "(null)" rather than crashing matching glibc's behavior.
It's probably worth adding a test for this. |
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.
LGTM.
Could you please add a test case for this one. I think something like
EXPECT_EQ(SPrintF("%s", nullptr), "(null)"));
in the SPrintF
case of test/cctest/test_util.cc
will be enough.
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.
Added test
Still LGTM. Thanks. |
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.
👍
When internal debug is enabled, output null strings as "(null)" rather than crashing, matching glibc's behavior. PR-URL: #31523 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 32f63fc. Thanks for the contribution! 🎉 |
When internal debug is enabled, output null strings as "(null)" rather than crashing, matching glibc's behavior. PR-URL: #31523 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
When internal debug is enabled, output null strings as "(null)" rather than crashing, matching glibc's behavior. PR-URL: #31523 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
When internal debug is enabled, output null strings as "(null)" rather than crashing, matching glibc's behavior. PR-URL: #31523 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
When internal debug is enabled, output null strings as "(null)" rather than crashing, matching glibc's behavior. PR-URL: #31523 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
When internal debug is enabled output null strings as
"(null)" rather than crashing matching glibc's behavior.
make -j4 test
(UNIX), orvcbuild test
(Windows) passes