Skip to content

Some input in date are panicking the binary #3780

@ioperations

Description

@ioperations

using gnu date command

date --version
    gnu 8.30
date "+%Y-%m-%d %H-%M-%S%:::z"
    2022-08-5 09-53-28+00

while executing coreutils' date command

date --version
    0.0.14
date "+%Y-%m-%d %H-%M-%S%:::z"
$ RUST_BACKTRACE=1 ./target/debug/coreutils date "+%Y-%m-%d %H-%M-%S%:::z"
thread 'main' panicked at 'a Display implementation returned an error unexpectedly: Error', /usr/src/rustc-1.59.0/library/alloc/src/string.rs:2399:14
stack backtrace:
   0: rust_begin_unwind
             at /usr/src/rustc-1.59.0/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.59.0/library/core/src/panicking.rs:116:14
   2: core::result::unwrap_failed
             at /usr/src/rustc-1.59.0/library/core/src/result.rs:1690:5
   3: core::result::Result<T,E>::expect
             at /usr/src/rustc-1.59.0/library/core/src/result.rs:975:23
   4: <T as alloc::string::ToString>::to_string
             at /usr/src/rustc-1.59.0/library/alloc/src/string.rs:2398:9
   5: uu_date::uumain::uumain
             at ./src/uu/date/src/date.rs:246:37
   6: uu_date::uumain
             at ./src/uu/date/src/date.rs:145:1
   7: coreutils::main
             at ./src/bin/coreutils.rs:95:31
   8: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.59.0/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions