-
Notifications
You must be signed in to change notification settings - Fork 574
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
Build failure in release configuration due to -Werror=stringop-truncation errors #7274
Comments
What version of DynamoRIO are you using? latest master |
I configure and make dynamorio as:
|
These stringop warnings are disabled in core/:
|
Looks like I foobar'd my cmake build directory. I generated a compile_commands.json for use with my editor, and it is missing these warn disables and some other ones for the files in this accompanying PR. Rebuilding with a fresh cmake build directory, I don't have these errors anymore and things compile fine. Happy to close the accompanying PR as user error, or fix up the truncation warning problem and revert the other changes, whichever y'all want. |
The issue of strncpy wasting time padding the entire buffer with nulls is also covered here. Since we use the dr_snprintf BUFFER_SIZE_ELEMENTS;NULL_TERMINATE_BUFFER pattern for construction in many places, and there is no simple strncpy replacement, we are considering replacing strncpy when the buffer is often larger than the source with dr_snprintf %s. |
Substitutes `strncpy()` with `dr_snprintf()` and warn on possible name truncation in func_trace.cpp. Avoid null byte copies. Issue: #7274
Build errors occur when compiling DynamoRIO in release mode using gcc 14.2.0 and g++ 13.3.0 on Ubuntu 24.04.
These errors are specifically related to the
-Werror=stringop-truncation
warning, indicating potential string truncation issues due to the specified bounds depending on the source argument's length. Some are false positives, others seem to highlight genuine potential problems within the code.The following commands were used to configure and build DynamoRIO:
Note:
Building tests with
-DBUILD_TESTS=ON
generates additionalstringop-truncation
errors, some of which are likely false positives.The text was updated successfully, but these errors were encountered: