Skip to content

ptx: accept invalid UTF-8 input and trailing backslash regexps - #14032

Merged
sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:fix-gnu-ptx-overrun
Aug 20, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:fix-gnu-ptx-overrun

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

ptx aborted with "stream did not contain valid UTF-8" on input that is not valid UTF-8, while GNU ptx operates on bytes and processes it fine. Input is now read as bytes and decoded lossily.

Should make test tests/ptx/ptx-overrun.sh pass
#13841

Copilot AI lite review requested due to automatic review settings August 19, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sylvestre
sylvestre force-pushed the fix-gnu-ptx-overrun branch from 37fe2f6 to 5a00998 Compare August 19, 2026 16:53
Copilot AI review requested due to automatic review settings August 19, 2026 17:01
@sylvestre
sylvestre force-pushed the fix-gnu-ptx-overrun branch from 5a00998 to 2d2cdf2 Compare August 19, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codspeed

codspeed Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 4.13%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 356 untouched benchmarks
⏩ 50 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Simulation du_summarize_balanced_tree[(5, 4, 10)] 17 ms 16.4 ms +4.13%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sylvestre:fix-gnu-ptx-overrun (8217bf1) with main (4b79fb9)2

Open in CodSpeed

Footnotes

  1. 50 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (f7a27d5) during the generation of this report, so 4b79fb9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@sylvestre
sylvestre force-pushed the fix-gnu-ptx-overrun branch from 2d2cdf2 to 8f085c8 Compare August 20, 2026 06:18
Copilot AI review requested due to automatic review settings August 20, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/misc/io-errors (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/ptx/ptx-overrun is no longer failing!
Note: The gnu test tests/tail/pipe-f is now being skipped but was previously passing.

@sylvestre
sylvestre enabled auto-merge (rebase) August 20, 2026 11:21
@sylvestre
sylvestre disabled auto-merge August 20, 2026 11:22
@sylvestre
sylvestre enabled auto-merge (rebase) August 20, 2026 11:23
ptx aborted with "stream did not contain valid UTF-8" on input that is
not valid UTF-8, while GNU ptx operates on bytes and processes it fine.
Input is now read as bytes and decoded lossily.

Additionally, a regexp ending in a lone backslash (e.g. -S 'foo\') was
rejected by the regex crate as an incomplete escape sequence, whereas
GNU treats it as a literal backslash. Such a trailing backslash is now
doubled before compiling the pattern, for both -S and -W.

Should make test tests/ptx/ptx-overrun.sh pass
uutils#13841
@sylvestre
sylvestre force-pushed the fix-gnu-ptx-overrun branch from 8f085c8 to 8217bf1 Compare August 20, 2026 11:23
Copilot AI review requested due to automatic review settings August 20, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sylvestre
sylvestre merged commit 250be8a into uutils:main Aug 20, 2026
168 of 169 checks passed
@sylvestre
sylvestre deleted the fix-gnu-ptx-overrun branch August 20, 2026 19:51
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.

2 participants