Skip to content

fix codec logic and failure handling#30

Draft
edsiper wants to merge 1 commit into
masterfrom
agent/fix-codec-logic-bugs
Draft

fix codec logic and failure handling#30
edsiper wants to merge 1 commit into
masterfrom
agent/fix-codec-logic-bugs

Conversation

@edsiper

@edsiper edsiper commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve OTLP dictionary-backed attributes and profile metadata during encoding
  • balance MessagePack containers and reject integer conversions that would wrap or truncate
  • fix text encoding of empty arrays
  • make OTLP and profile allocation-failure cleanup atomic, including empty collection handling
  • add regression coverage for wire metadata, attribute indexes, malformed integers, and empty inputs

Root cause

Several codec paths relied on unchecked conversion or allocator behavior. The OTLP dictionary builder did not construct the attribute table or copy profile metadata, MessagePack maps were not closed when MPack tracking was enabled, and multiple failure paths either lost ownership or cleaned up dangling pointers.

Validation

  • ./scripts/agent-verify.sh
  • GCC build and all four CTest executables
  • Clang debug build and all four CTest executables
  • MPack DEBUG tracking build and all four CTest executables
  • Valgrind full leak check of cprof-test-opentelemetry_transcoder
  • GCC -fanalyzer; no project-source diagnostics remain (vendored CFL/MPack diagnostics only)

An AddressSanitizer build completed, but its existing test binaries hung at their first test without emitting a sanitizer diagnostic, so ASan results are not claimed here.

Compatibility

No public C structure layouts or function signatures change. OTLP output now includes fields that were previously dropped and valid dictionary entries for existing attribute references. Malformed MessagePack integers that previously wrapped or truncated are now rejected.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant