-
Notifications
You must be signed in to change notification settings - Fork 392
Fix(conflict) current version is depends on a version grpc that has a… #55105
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
Fix(conflict) current version is depends on a version grpc that has a… #55105
Conversation
… stict dependency on older protobuf rebuildig this so that it can pickup the latest grpc which depnds on the latest protobuf Signed-off-by: Debasish Biswas <debasishbsws.dev@gmail.com>
🛑 Build Failed: Compilation
Build Details
Root Cause Analysis 🔍The string literal is being used to initialize an array of 'unsigned char', but the string is 13 bytes long (including the null terminator) while the destination array only has space for 12 bytes. Since the compiler flag -Werror is enabled, this warning is treated as an error, causing the build to fail. 🔍 Build failure fix suggestionsFound similar build failures that have been fixed in the past and analyzed them to suggest a fix: Suggested ChangesFile: src/http/v2/ngx_http_v2_filter_module.c
Replacement:
File: src/http/v2/ngx_http_v2_filter_module.c
Replacement:
Click to expand fix analysisAnalysisThe build failure is happening in src/http/v2/ngx_http_v2_filter_module.c:121 due to a string initializer for an array of 'unsigned char' being 13 bytes long (including the null terminator) while the destination array only has space for 12 bytes. This is causing a compiler error because -Werror treats warnings as errors. In the nginx code, there's likely a fixed-size array declaration with a size of 12 bytes, but the string literal used to initialize it is actually 13 bytes (12 characters plus the null terminator). Since this is in the HTTP/2 filter module, it's probably a constant string or protocol identifier. The error message specifically mentions "initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute" which indicates that the compiler is detecting a string that won't fit properly in the destination array. Click to expand fix explanationExplanationThe error occurs because the compiler is detecting a string initialization where the destination array is not large enough to hold the null terminator. There are two potential fixes:
Either approach should resolve the error, but the first one (increasing the array size) is often preferred for clarity and to avoid potential issues with string handling functions that might assume null termination. The second approach (using the nonstring attribute) is more appropriate if the array is truly not meant to be treated as a string and its exact size is important. The issue is likely that NGINX is initializing a fixed-size buffer for HTTP/2 frame headers, but the size doesn't account for the null terminator that C automatically adds to string literals. Since this appears to be protocol-related data used in binary format rather than as a C string, the nonstring attribute would be appropriate, but increasing the array size is the safer approach if the additional byte doesn't affect protocol compatibility. Click to expand alternative approachesAlternative Approaches
Was this comment helpful? Please use 👍 or 👎 reactions on this comment. |
Signed-off-by: Debasish Biswas <debasishbsws.dev@gmail.com>
Not sure avoiding that error is a good idea or not. |
fwiw, nginx/unit did something similar to disable the gcc 15 warning while working on a compatible refactor. For the current protobuf errors, it looks like we need to bring opentelemetry-cpp-dev's protobuf up from 5.29.4 to jive with protobuf-dev's 5.29.5. |
… stict dependency on older protobuf rebuildig this so that it can pickup the latest grpc which depnds on the latest protobuf