Skip to content

tally: make display_name_max_size a signed integer - #542

Merged
TApplencourt merged 2 commits into
develfrom
tally-signed-v2
Sep 18, 2026
Merged

TApplencourt merged 2 commits into
develfrom
tally-signed-v2

Conversation

@TApplencourt

Copy link
Copy Markdown
Collaborator

btx_tally.cpp reads display_name_max_size into const int max_name_size, and --max-name-size -1 is used for no limit.
Oupsy

TApplencourt and others added 2 commits September 18, 2026 16:16
The file predates the yamlfmt lint job and never got formatted, so its list
items are indented under `:entries:` while .yamlfmt sets
`indentless_arrays: true`. CI only lints CHANGED yaml files, so this went
unnoticed until a one-line edit to this file made the whole file eligible.

Pure reformatting, separated from the type change in the next commit so that
change is readable. Parsed YAML is unchanged, and the generated
btx_component.{c,h} are byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
btx_tally.cpp reads display_name_max_size into `const int max_name_size`, and
`--max-name-size -1` is a documented value ("Use -1 for no limit", handled by
`if (u_size < 0) return original` in limit_string_size). The metababel param
metadata declared it integer_unsigned, so the trace metadata contradicted its
own C consumer. Declare it signed.

Nothing changes today. babeltrace2-ruby encodes integers as signed, and
integer_unsigned is the one param type metababel generates no validation for:
the bare bt_value_integer_unsigned_get read the signed -1 back as UINT64_MAX,
which wrapped to -1 again in the C `const int`. It worked by two's-complement
luck. Declaring it signed generates bt_value_is_signed_integer +
bt_value_integer_signed_get and an int64_t field, which is what the consumer
wanted all along -- and that guard passes precisely because the value on the
wire was always signed.

Verified against a stock metababel 1.1.4 build, with the devel build as
reference: `--max-name-size 10` truncates identically (16 `[...]` markers) and
`--max-name-size -1` prints full names with no "Bad value" error, on both.
The 19 tally rows are identical sets, and `general.bats max-name-size` passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TApplencourt
TApplencourt merged commit 08575a0 into devel Sep 18, 2026
27 checks passed
@TApplencourt
TApplencourt deleted the tally-signed-v2 branch September 18, 2026 16:49
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