Skip to content

ptx <<< "012345678901234567890123456789πŸ› " SIGABRTΒ #10750

Closed

Description

@oech3
     /the release of **Rust Coreutils   0.3.0** β€” our latest milestone/
    /release of **Rust Coreutils 0.3.   0** β€” our latest milestone/
          0.3.0  |/ | Result        |   0.2.0 | 0.3.0 | Change 0.2.0 to
            |/ | Result        | 0.2.   0 | 0.3.0 | Change 0.2.0 to 0.3.0

thread 'main' (1463) 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

Activity

  1. oech3 commented on Feb 5, 2026

    @oech3
    ContributorAuthor
    $ 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
    
  2. 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
  3. changed the title [-]ptx <<< "We've got +11 more G of 1.70. πŸ› " SIGABRT[/-] [+]ptx <<< "012345678901234567890123456789πŸ› " SIGABRT[/+] on Feb 6, 2026
  4. Xylphy commented on Feb 8, 2026

    @Xylphy
    Contributor

    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?

  5. oech3 commented on Feb 9, 2026

    @oech3
    ContributorAuthor

    Yes. We should fix panic at 1st. We cannot fix regex things soon (see rust-lang/regex#1126).

  6. ChrisDryden commented on Feb 9, 2026

    @ChrisDryden
    Collaborator

    I know its not the ideal dependency to use but would using onig solve this problem?

  7. oech3 commented on Feb 10, 2026

    @oech3
    ContributorAuthor

    or fancy-regex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions