bryancall opened a new pull request, #14039:
URL: https://github.com/apache/trafficserver/pull/14039
The nightly Rocky Linux 8 `gcc release` build of master stops in
`prometheus_render.cc`, which came in with #13754. GCC 11 from gcc-toolset-11
at `-O3` reports `-Werror=stringop-overread` with a bound of `SIZE_MAX` on the
`memchr` behind `param.find('=')` in `prometheus_record_filter()`. The view for
the last parameter of a query came from `query.substr(0, npos)`. GCC follows a
`SIZE_MAX` length out of that call, but `substr` clamps the length to `size()`,
so nothing could actually overread.
This builds the parameter view from an explicit length instead, which GCC 11
does not warn on. The parsing does not change. A new unit test case covers the
empty parameters that a leading or doubled `&` makes, plus a trailing `&`.
Tested in the `ci.trafficserver.apache.org/ats/rockylinux:8` image, with the
CI's own build and test scripts and `COMPILER=gcc TYPE=release FEATURES=asan`:
- Without the change, the build fails with the same error as the nightly. A
keep-going build shows this is the only error in the tree: the one file,
compiled into both the plugin and its unit test.
- With the change, the full build completes and all 1299 ctest tests pass,
including the 18 `test_stats_over_http` cases. `traffic_server -R 3` passes too.
--
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]