Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzzing date: fails with Duration::hours ouf of bounds #5311

Open
sylvestre opened this issue Sep 24, 2023 · 3 comments
Open

fuzzing date: fails with Duration::hours ouf of bounds #5311

sylvestre opened this issue Sep 24, 2023 · 3 comments
Labels

Comments

@sylvestre
Copy link
Sponsor Contributor

Found here:
https://github.com/uutils/coreutils/actions/runs/6289047337/job/17075149878?pr=4993

2023-09-24T09:47:51.4762298Z Sun Sep 24 09:47:51 2023
2023-09-24T09:47:51.4762380Z Sun Sep 24 09:47:51 2023
2023-09-24T09:47:51.4839958Z thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.31/src/duration.rs:99:53:
2023-09-24T09:47:51.4840071Z Duration::hours ouf of bounds
2023-09-24T09:47:51.4840257Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-09-24T09:47:51.4840371Z ==2955== ERROR: libFuzzer: deadly signal
2023-09-24T09:47:51.4850367Z     #0 0x563fc74ea481  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xc03481) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4850802Z     #1 0x563fc88ba41e  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fd341e) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4851229Z     #2 0x563fc8895a29  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1faea29) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4851637Z     #3 0x7fa65e64251f  (/lib/x86_64-linux-gnu/libc.so.6+0x4251f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
2023-09-24T09:47:51.4851969Z     #4 0x7fa65e696a7b  (/lib/x86_64-linux-gnu/libc.so.6+0x96a7b) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
2023-09-24T09:47:51.4852272Z     #5 0x7fa65e642475  (/lib/x86_64-linux-gnu/libc.so.6+0x42475) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
2023-09-24T09:47:51.4852564Z     #6 0x7fa65e6287f2  (/lib/x86_64-linux-gnu/libc.so.6+0x287f2) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
2023-09-24T09:47:51.4852991Z     #7 0x563fc892b526  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x2044526) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4853397Z     #8 0x563fc7440e26  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xb59e26) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4853829Z     #9 0x563fc888f6c4  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fa86c4) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4854362Z     #10 0x563fc891f460  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x2038460) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4854783Z     #11 0x563fc891f1e0  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x20381e0) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4855194Z     #12 0x563fc891c505  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x2035505) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4855613Z     #13 0x563fc891ef31  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x2037f31) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4856031Z     #14 0x563fc74444b4  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xb5d4b4) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4856445Z     #15 0x563fc7444472  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xb5d472) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4856861Z     #16 0x563fc75e1bce  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xcfabce) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4857268Z     #17 0x563fc75ed226  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xd06226) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4857669Z     #18 0x563fc75eb460  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xd04460) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4858182Z     #19 0x563fc757189d  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xc8a89d) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4858584Z     #20 0x563fc756f120  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xc88120) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4858975Z     #21 0x563fc7584907  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xc9d907) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4859379Z     #22 0x563fc7583f00  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xc9cf00) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4859790Z     #23 0x563fc888a4a8  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fa34a8) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4860247Z     #24 0x563fc888f8e7  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fa88e7) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4860672Z     #25 0x563fc888eab1  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fa7ab1) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4861084Z     #26 0x563fc8895f75  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1faef75) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4861483Z     #27 0x563fc889b543  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fb4543) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4861891Z     #28 0x563fc889c538  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fb5538) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4862299Z     #29 0x563fc889e927  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fb7927) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4862757Z     #30 0x563fc88b974f  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0x1fd274f) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4863163Z     #31 0x563fc7444e06  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xb5de06) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4863475Z     #32 0x7fa65e629d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
2023-09-24T09:47:51.4863780Z     #33 0x7fa65e629e3f  (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd)
2023-09-24T09:47:51.4864198Z     #34 0x563fc7444fa4  (/home/runner/work/coreutils/coreutils/fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_date+0xb5dfa4) (BuildId: 769083b43a9b9b59850e6bba624d1e4c4fd5c633)
2023-09-24T09:47:51.4864213Z 
2023-09-24T09:47:51.4864345Z NOTE: libFuzzer has rudimentary signal handlers.
2023-09-24T09:47:51.4864534Z       Combine libFuzzer with AddressSanitizer or similar for better crash reports.
2023-09-24T09:47:51.4864640Z SUMMARY: libFuzzer: deadly signal
2023-09-24T09:47:51.4864902Z MS: 1 InsertRepeatedBytes-; base unit: 872e8ec13a51803cf117ee4541d3e1064163fff8
2023-09-24T09:47:51.4865146Z 0x0,0x2d,0x64,0x2e,0x68,0x2e,0x4,0x2e,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x68,
2023-09-24T09:47:51.4865276Z \000-d.h.\004.5555555555555555h
2023-09-24T09:47:51.4865779Z artifact_prefix='/home/runner/work/coreutils/coreutils/fuzz/artifacts/fuzz_date/'; Test unit written to /home/runner/work/coreutils/coreutils/fuzz/artifacts/fuzz_date/crash-460cf8e6d0a9a78b2253937184949ea17f5cd96a
2023-09-24T09:47:51.4865963Z Base64: AC1kLmguBC41NTU1NTU1NTU1NTU1NTU1aA==
2023-09-24T09:47:51.5089076Z 
2023-09-24T09:47:51.5089768Z ────────────────────────────────────────────────────────────────────────────────
2023-09-24T09:47:51.5089789Z 
2023-09-24T09:47:51.5089883Z Failing input:
2023-09-24T09:47:51.5089895Z 
2023-09-24T09:47:51.5090144Z 	artifacts/fuzz_date/crash-460cf8e6d0a9a78b2253937184949ea17f5cd96a
2023-09-24T09:47:51.5090151Z 
2023-09-24T09:47:51.6244768Z Output of `std::fmt::Debug`:
2023-09-24T09:47:51.6245266Z 
2023-09-24T09:47:51.6248219Z 	[0, 45, 100, 46, 104, 46, 4, 46, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 104]
2023-09-24T09:47:51.6248436Z 
2023-09-24T09:47:51.6248527Z Reproduce with:
2023-09-24T09:47:51.6248657Z 
2023-09-24T09:47:51.6249129Z 	cargo fuzz run fuzz_date artifacts/fuzz_date/crash-460cf8e6d0a9a78b2253937184949ea17f5cd96a
2023-09-24T09:47:51.6249357Z 
2023-09-24T09:47:51.6249467Z Minimize test case with:
2023-09-24T09:47:51.6249611Z 
2023-09-24T09:47:51.6249900Z 	cargo fuzz tmin fuzz_date artifacts/fuzz_date/crash-460cf8e6d0a9a78b2253937184949ea17f5cd96a
2023-09-24T09:47:51.6250267Z 
2023-09-24T09:47:51.6250558Z ────────────────────────────────────────────────────────────────────────────────
2023-09-24T09:47:51.6250760Z 
2023-09-24T09:47:51.6250889Z Error: Fuzz target exited with exit status: 77
@cakebaker
Copy link
Contributor

A related issue, though failing with Duration::seconds out of bounds on a different line:

$ cargo run date -d 5555555555555h
thread 'main' panicked at 'Duration::seconds out of bounds', /home/dho/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.31/src/duration.rs:121:13

@sylvestre
Copy link
Sponsor Contributor Author

@sylvestre
Copy link
Sponsor Contributor Author

referenced here:
chronotope/chrono#815

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants