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
thread 'line::test::test_parse_timestamp' panicked at lib/prometheus-parser/src/line.rs:155:23:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }
stack backtrace:
0: rust_begin_unwind
at /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/std/src/panicking.rs:692:5
1: core::panicking::panic_fmt
at /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/core/src/panicking.rs:75:14
2: core::result::unwrap_failed
at /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/core/src/result.rs:1704:5
3: core::result::Result<T,E>::unwrap
at /home/wooffie/.rustup/toolchains/1.85-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1109:23
4: prometheus_parser::line::Metric::parse_timestamp::{{closure}}
at ./src/line.rs:155:13
5: nom::combinator::map::{{closure}}
at /home/wooffie/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nom-7.1.3/src/combinator/mod.rs:80:16
6: <F as nom::internal::Parser<I,O,E>>::parse
at /home/wooffie/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nom-7.1.3/src/internal.rs:325:5
7: nom::combinator::opt::{{closure}}
at /home/wooffie/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nom-7.1.3/src/combinator/mod.rs:245:11
8: prometheus_parser::line::Metric::parse_timestamp
at ./src/line.rs:154:9
9: prometheus_parser::line::test::test_parse_timestamp
at ./src/line.rs:667:20
10: prometheus_parser::line::test::test_parse_timestamp::{{closure}}
at ./src/line.rs:666:30
11: core::ops::function::FnOnce::call_once
at /home/wooffie/.rustup/toolchains/1.85-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
12: core::ops::function::FnOnce::call_once
at /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
A note for the community
Problem
By using public function parse_text we can get Panic. After minizing crash i found that it happens in function Metric::parse_timestamp.
Problem in handling
unwrap()
inside closure, i think in this place we should have anothernom
parserConfiguration
Version
latest from git - 9129d95
Debug Output
Example Data
Reproduce:
cargo test --package prometheus-parser --lib -- line::test::test_parse_timestamp --exact --show-output
Additional Context
I'm some braintwisted with
nom
library and want help to fix this bug =(Found by https://github.com/rust-fuzz/cargo-fuzz
References
No response
The text was updated successfully, but these errors were encountered: