Skip to content

seq: mismatch with GNU with long number #6235

Closed

Description

@sylvestre

Found with fuzzing:

$ cargo run seq 66000e000000000000000000000000000000000000000000000000000009223775807
thread 'main' panicked at src/uu/seq/src/numberparse.rs:114:21:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

with GNU:

$ LANG=C /usr/bin/seq 66000e000000000000000000000000000000000000000000000000000009223
/usr/bin/seq: invalid floating point argument: '66000e000000000000000000000000000000000000000000000000000009223'

Activity

  1. changed the title [-]seq: mismatch with GNU with long number[/-] [+]`seq`: mismatch with GNU with long number[/+] on Apr 14, 2024
  2. ahmadabd commented on May 7, 2024

    @ahmadabd
    Contributor

    I run cargo run seq 66000e000000000000000000000000000000000000000000000000000009223775807 but it does nothing, it just wait.

  3. dcampbell24 commented on Jun 9, 2024

    @dcampbell24
    Contributor

    How long does it take to run with what cpu?

  4. sylvestre commented on Jul 8, 2024

    @sylvestre
    SponsorContributorAuthor

    Same issue with -0.e9223372036854775807 - not sure it is the same issue
    immediate crash

    $ RUST_BACKTRACE=1 cargo run -q seq -0.e9223372036854775807
    thread 'main' panicked at src/uu/seq/src/numberparse.rs:223:13:
    attempt to add with overflow
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
       1: core::panicking::panic_fmt
                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
       2: core::panicking::panic
                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:145:5
       3: uu_seq::numberparse::parse_decimal_and_exponent
                 at ./src/uu/seq/src/numberparse.rs:223:13
       4: uu_seq::numberparse::<impl core::str::traits::FromStr for uu_seq::number::PreciseNumber>::from_str
                 at ./src/uu/seq/src/numberparse.rs:333:44
       5: core::str::<impl str>::parse
                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/str/mod.rs:2428:9
       6: uu_seq::uumain::uumain
                 at ./src/uu/seq/src/seq.rs:101:15
       7: uu_seq::uumain
                 at ./src/uu/seq/src/seq.rs:50:1
       8: coreutils::main
                 at ./src/bin/coreutils.rs:110:31
       9: core::ops::function::FnOnce::call_once
                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    

    found by oss fuzz:
    https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68089

  5. steinwand6 commented on Nov 14, 2024

    @steinwand6
    Contributor

    I would like to contribute. Would it be alright if I submit a pull request?

  6. sylvestre commented on Nov 14, 2024

    @sylvestre
    SponsorContributorAuthor

    of course :)

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions