Repository navigation
opentelemetry: Add traceparent parse/serialize methods to SpanContextExtractor - #48449
Merged
botengyao merged 1 commit intoNov 19, 2026
Merged
Conversation
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
from
October 19, 2026 22:43
c5fc830 to
43842b5
Compare
This was referenced Oct 19, 2026
dmcardle
marked this pull request as ready for review
October 19, 2026 22:58
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
2 times, most recently
from
October 21, 2026 17:53
8585b17 to
88d1a94
Compare
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
4 times, most recently
from
October 26, 2026 15:59
f91608f to
cbf4efd
Compare
jwendell
pushed a commit
that referenced
this pull request
Oct 27, 2026
…48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. #48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and #48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]>
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
2 times, most recently
from
October 28, 2026 14:07
36fde18 to
5a38072
Compare
botengyao
pushed a commit
that referenced
this pull request
Oct 29, 2026
…48249) <!-- !!!ATTENTION!!! If you are fixing **any** crash or **any** potential security issue, **do not open a pull request**. Instead, please [open a GitHub Security Advisory](https://github.com/envoyproxy/envoy/security/advisories/new) (preferred). Alternatively, you may email [email protected]. Thank you in advance for helping to keep Envoy secure. !!!ATTENTION!!! For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md) !!!ATTENTION!!! Please check the [use of generative AI policy](https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md?plain=1#L41). You may use generative AI only if you fully understand the code. You need to disclose this usage in the PR description to ensure transparency. --> Commit Message: Additional Description: This is the first PR in a chain, with the high-level goal of getting McpFilter to reparent the active span based on the request body's trace context. For reference, here is the full PR chain: 1. #48249 1. #48250 1. #48449 1. #48448 1. #48516 1. #48038 1. #48450 1. #48451 This PR was created with help from generative AI (Gemini). I fully understand the code. Risk Level: Testing: Docs Changes: Release Notes: Platform Specific Features: [Optional Runtime guard:] [Optional Fixes #Issue] [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional [API Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):] Signed-off-by: dmcardle <[email protected]>
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
2 times, most recently
from
October 30, 2026 21:35
9ca7a92 to
bec3013
Compare
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
from
November 2, 2026 15:34
bec3013 to
98320b6
Compare
Contributor
Author
|
/retest |
botengyao
pushed a commit
that referenced
this pull request
Nov 3, 2026
<!-- !!!ATTENTION!!! If you are fixing **any** crash or **any** potential security issue, **do not open a pull request**. Instead, please [open a GitHub Security Advisory](https://github.com/envoyproxy/envoy/security/advisories/new) (preferred). Alternatively, you may email [email protected]. Thank you in advance for helping to keep Envoy secure. !!!ATTENTION!!! For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md) !!!ATTENTION!!! Please check the [use of generative AI policy](https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md?plain=1#L41). You may use generative AI only if you fully understand the code. You need to disclose this usage in the PR description to ensure transparency. --> Commit Message: Additional Description: This change supports #48038 This PR was created with help from generative AI (Gemini). I fully understand the code. For reference, here is the full PR chain: 1. #48249 1. #48250 1. #48449 1. #48448 1. #48516 1. #48038 1. #48450 1. #48451 Risk Level: Testing: Docs Changes: Release Notes: Platform Specific Features: [Optional Runtime guard:] [Optional Fixes #Issue] [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional [API Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):] Signed-off-by: dmcardle <[email protected]>
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
from
November 3, 2026 16:14
98320b6 to
1392f26
Compare
Contributor
Author
|
@yanavlasov This PR is up next, PTAL! |
jwendell
pushed a commit
that referenced
this pull request
Nov 12, 2026
…48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. #48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and #48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
that referenced
this pull request
Nov 17, 2026
…48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. #48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and #48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 18, 2026
…nvoyproxy#48757) Commit Message: listener: fix use-after-free in filter_chain_benchmark_test at exit Each `FilterChainBenchmarkFixture` held a `Logger::Context`, which reactivates the previous context on destruction. The benchmark library builds the fixtures at static initialization and destroys them at exit; with libstdc++ this happens in registration order, so the second fixture reactivates the first one's freed context. Under GCC this corrupts the heap and tcmalloc aborts with `CHECK in BitmapPushBatch` (libc++ destroys them in reverse order, so clang builds are unaffected). The fixture context is redundant since `test/benchmark/main.cc` already installs one for the whole run. Remove it. Additional Description: The GCC job of `Envoy/Checks` fails after all benchmarks have run on PRs that invalidate this test's cache entry, e.g. envoyproxy#48470 ([job](https://github.com/envoyproxy/envoy/actions/runs/40478692516/job/122125067805)) and envoyproxy#48449 ([job](https://github.com/envoyproxy/envoy/actions/runs/40354667795/job/121684997303)). main looks green because its GCC runs take this result from the remote cache. The bug is old; whether it aborts depends on heap layout. ``` 33302 external/tcmalloc+/tcmalloc/span.h:465] CHECK in BitmapPushBatch: small_span_state_.bitmap.GetBit(idx) == 0 (true == 0) ... Aborted (core dumped) ... --skip_expensive_benchmarks -- --benchmark_min_time=0s ``` `Logger::Context` lifetimes traced with gdb on the GCC build: ``` CTOR ...7740 FilterChainBenchmarkFixture_FilterChainManagerBuildTest_Benchmark (static init) CTOR ...7bc0 FilterChainBenchmarkFixture_FilterChainFindTest_Benchmark (static init) CTOR ...fb80 main DTOR ...fb80 main -> ACTIVATE ...7bc0 DTOR ...7740 ~..._FilterChainManagerBuildTest_Benchmark (unique_ptr, freed) DTOR ...7bc0 ~..._FilterChainFindTest_Benchmark -> ACTIVATE ...7740 (freed) ``` Risk Level: Low. Test only. Testing: `bazel test --config=gcc --nocache_test_results //test/common/listener_manager:filter_chain_benchmark_test_benchmark_test` in the `envoy-build` image (gcc 13.3.0): fails on main (5af8d91), passes 5/5 with this change. Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A AI assistance: prepared with AI assistance (Cursor agent). We reviewed and understand all of it. --------- Signed-off-by: William Dauchy <[email protected]> (cherry picked from commit aedd2c4) Signed-off-by: Ryan Northey <[email protected]>
botengyao
enabled auto-merge (squash)
November 18, 2026 18:53
Contributor
Author
|
CI might have gotten stuck |
Contributor
Author
|
/retest |
Member
|
could you merge main? |
…Extractor Signed-off-by: dmcardle <[email protected]>
auto-merge was automatically disabled
November 19, 2026 17:08
Head branch was pushed to by a user without write access
dmcardle
force-pushed
the
otel-traceparent-parse-serialize
branch
from
November 19, 2026 17:08
1392f26 to
76e5cda
Compare
botengyao
approved these changes
Nov 19, 2026
yanavlasov
pushed a commit
that referenced
this pull request
Dec 1, 2026
This new override will be used by McpFilter in PR #48038. Additional Description: This PR was created with help from generative AI (Gemini). I fully understand the code. For reference, here is the full PR chain: 1. #48249 1. #48250 1. #48449 1. #48448 1. #48516 1. #48038 1. #48450 1. #48451 Risk Level: Testing: Docs Changes: Release Notes: Platform Specific Features: [Optional Runtime guard:] [Optional Fixes #Issue] [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional [API Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):] --------- Signed-off-by: dmcardle <[email protected]>
yanavlasov
pushed a commit
that referenced
this pull request
Dec 2, 2026
This commit deduplicates constants related to W3C traceparent into source/common/tracing/tracing_validation.h. Additional Description: This PR was created with help from generative AI (Gemini). I fully understand the code. For reference, here is the full PR chain: 1. #48249 1. #48250 1. #48449 1. #48448 1. #48516 1. #48038 1. #48450 1. #48451 Risk Level: Testing: Docs Changes: Release Notes: Platform Specific Features: [Optional Runtime guard:] [Optional Fixes #Issue] [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional [API Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):] Signed-off-by: dmcardle <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: opentelemetry: Add traceparent parse/serialize methods to SpanContextExtractor
This new override will be used by McpFilter in PR #48038.
Additional Description: This PR was created with help from generative AI (Gemini). I fully understand the code.
For reference, here is the full PR chain:
modefield to TraceContextPropagationConfig in mcp.proto #48249resample_on_update_parentto OpenTelemetryConfig #48450Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]