bryancall opened a new pull request, #14040: URL: https://github.com/apache/trafficserver/pull/14040
The nightly Debian 12 `gcc release` build stops in `src/tsutil/unit_tests/test_thread_safety.cc`. At -O3, GCC 12.2 inlines `"k" + std::to_string(t)` through `basic_string::insert` down to a `memcpy`, then reports a `-Wrestrict` overlap that cannot happen. With warnings as errors, that fails the whole build: ``` char_traits.h:431:56: error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Werror=restrict] ``` The test now builds the key by appending to a `std::string`. That takes the append path instead of the insert path, so the warning does not fire. The keys are the same, "k0" through "k7", and the test checks the same thing. The gcc debug, clang release and clang debug builds never warned. PR CI builds Debian in Debug, so only the nightly release job hits this. A short comment keeps the line from being folded back into the `operator+` form. Test plan, all in the `ci.trafficserver.apache.org/ats/debian:12` image (GCC 12.2.0), running the Jenkins `os_build` Build and Tests steps (`cmake.sh`, then `regression.sh`): - Before the change, `gcc release` fails to build with the error above. With `make -k`, that file is the only failing target in the tree. - After the change, `gcc release` builds. ctest passes 1326 of 1326, and `traffic_server -K -R 3` passes all 62 regression groups. - After the change, `gcc debug` builds. ctest passes 1326 of 1326, and `traffic_server -K -R 3` passes all 62 regression groups. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
