fix(awk): make expression format errors fatal - #2458
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | c8c8fc6 | Commit Preview URL Branch Preview URL |
Sep 25 2026, 04:11 AM |
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.
What changed
AWK formatting errors inside
sprintfexpressions now stop the AWK program with exit 2 and a fatal diagnostic. Directprintfuses the same error behavior. Scripts and agents no longer receive a successful result after a rejected format width or precision.Closes #2456.
Why
sprintf("%10001s", "x")printed an error but yielded an empty string and exit 0. A later calculation could look complete although the format cap had been hit.Before / After
Before:
awk 'BEGIN { s=sprintf("%10001s","x"); print length(s) }'printed0, reported the width error, and exited 0.After: the same command prints no stdout, reports
awk: fatal: format width 10001 exceeds maximum (10000), and exits 2. The focusedbuiltin_cap_security_tests::awk_formatsuite passes all 3 tests; the bash spec suite and 100 awk unit tests pass.Risk
just pre-prexposed two SQLite CSV differential failures against macOS hostsqlite3; this PR does not change SQLite. Required Linux CI is the merge gate.Checklist