Repository navigation
fix(logging): format variadic arguments before forwarding to glog - #457
Merged
Merged
Conversation
SteNicholas
force-pushed
the
PAIMON-456
branch
from
October 23, 2026 05:40
ed390df to
7d6a0d4
Compare
Format LogV arguments with std::vsnprintf before forwarding the message to google::RawLog__ through a fixed "%s" format. Limit the message buffer to 2048 bytes to leave room for glog's raw log prefix. Add regression tests for argument formatting and message truncation. Run custom logger registration in a separate death test process and return a pre-created logger from the registered factory, verifying its identity and avoiding duplicate variadic forwarding code in the tests.
SteNicholas
force-pushed
the
PAIMON-456
branch
from
October 23, 2026 05:42
7d6a0d4 to
e20bce7
Compare
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.
Purpose
Linked issue: close #456
GlogAdaptor::LogVforwarded ava_listto the printf-style variadicgoogle::RawLog__, causing undefined behavior and garbled log arguments.Format the arguments with
std::vsnprintffirst, then forward the result througha fixed
"%s"format so percent signs in arguments stay literal. The 2048-bytebuffer preserves up to 2047 message bytes and leaves room for glog's raw log prefix.
Tests
Unit tests in
src/paimon/common/logging/logging_test.cpp:TestLogFormatsArguments: verifies string/integer substitutions and literalpercent signs in arguments.
TestLogTruncatesLongMessage: verifies complete output at 2047 bytes andretention of the first 2047 bytes for an oversized message.
TestRegisterCustomLoggerCreator: verifies the factory call count and theidentity of the returned, pre-created logger in an isolated child process,
preserving the default logger for shuffled and repeated tests.
Local validation: pre-commit checks for both changed files and
git diff --checkpassed. C++ tests and clang-tidy were not run locally because the required tools
are unavailable.
API and Format
No public API, storage format, or protocol changes.
Documentation
No documentation changes are required for this bug fix.
Generative AI tooling
Generated-by: Claude Code 2.1.303 (Claude Opus 5.5)
🤖 Generated with Claude Code