You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ptx <<< "We've got +11 more G of 1.70. π "
thread 'main' (59115) panicked at src/uu/ptx/src/ptx.rs:505:5:
assertion failed: max_after_size >= after.len()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
changed the title [-]ptx docs/src/release-notes/* on this repository SIGABRT[/-][+]ptx <<< "We've got +11 more G of 1.70. π " SIGABRT[/+]on Feb 6, 2026
I fixed the panic locally (root cause was mixing byte length via .len() with character-based slicing on UTF-8 input). The fix switches the relevant size checks to count characters instead of bytes, which prevents the assertion failure for multi-byte characters (e.g. emoji).
However, this surfaced a follow-up issue: even with the panic fixed, uutils ptx cannot perfectly match GNU ptx behavior in all cases due to fundamental differences between POSIX regex (byte/locale-based) and Rustβs Unicode-aware regex engine. In particular, word matching and width accounting can still diverge for non-ASCII input.
σ°£ coreutils/target/debug ξ main ξ $! β― ptx <<<"We've got +11 more G of 1.70. π " οΊ 07:00
We've got +11 more G of 1.70. π We've got +11 more G of 1.70. π
We've got +11 more G of 1.70. π We've got +11 more G of 1.70. π
We've got +11 more G of 1.70. π We' ve got +11 more G of 1.70. π
σ°£ coreutils/target/debug ξ main ξ $! β― coreutils ptx <<<"We've got +11 more G of 1.70. π " οΊ 07:00
We've got +11 more G of 1.70. π We've got + 11 more G of 1.70. π
We've got +11 more G of 1. 70. π We've got +11 more G of 1.70. π
We've got +11 more G of 1.70. π We've got +11 more G of 1.70. π
We've got +11 more G of 1.70. π We've got +11 more G of 1.70. π
We' ve got +11 more G of 1.70. π
Should I open a pull request for the fix of this issue or wait until there's a direction on whether we'll still follow GNU ptx?
Activity
oech3 commentedon Feb 5, 2026
[-]ptx docs/src/release-notes/* on this repository SIGABRT[/-][+]ptx <<< "We've got +11 more G of 1.70. π " SIGABRT[/+][-]ptx <<< "We've got +11 more G of 1.70. π " SIGABRT[/-][+]ptx <<< "012345678901234567890123456789π " SIGABRT[/+]Xylphy commentedon Feb 8, 2026
I fixed the panic locally (root cause was mixing byte length via
.len()with character-based slicing on UTF-8 input). The fix switches the relevant size checks to count characters instead of bytes, which prevents the assertion failure for multi-byte characters (e.g. emoji).However, this surfaced a follow-up issue: even with the panic fixed, uutils
ptxcannot perfectly match GNUptxbehavior in all cases due to fundamental differences between POSIX regex (byte/locale-based) and Rustβs Unicode-awareregexengine. In particular, word matching and width accounting can still diverge for non-ASCII input.Should I open a pull request for the fix of this issue or wait until there's a direction on whether we'll still follow GNU
ptx?oech3 commentedon Feb 9, 2026
Yes. We should fix panic at 1st. We cannot fix regex things soon (see rust-lang/regex#1126).
ChrisDryden commentedon Feb 9, 2026
I know its not the ideal dependency to use but would using onig solve this problem?
oech3 commentedon Feb 10, 2026
or fancy-regex?