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

cargo bench --all-features panic #651

Closed
Martin1887 opened this issue May 27, 2023 · 1 comment · Fixed by #990
Closed

cargo bench --all-features panic #651

Martin1887 opened this issue May 27, 2023 · 1 comment · Fixed by #990

Comments

@Martin1887
Copy link
Collaborator

This panic only happens when using simd, it happens in different lines of firstpass.rs each time and it does not happen all times:

Benchmarking pathological_codeblocks1/9: Warming up for 3.0000 sthread 'main' panicked at 'byte index 4515 is out of bounds of ````````````````````````````````````````````````````````````````````````````````````````````````````` ````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````[...]', src/firstpass.rs:580:42
stack backtrace:
   0: rust_begin_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
   1: core::panicking::panic_fmt
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
   2: core::str::slice_error_fail_rt
   3: core::str::slice_error_fail
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/str/mod.rs:86:9
   4: pulldown_cmark::firstpass::simd::process_mask
   5: pulldown_cmark::firstpass::simd::simd_iterate_special_bytes
   6: pulldown_cmark::firstpass::FirstPass::run
   7: pulldown_cmark::firstpass::run_first_pass
   8: pulldown_cmark::parse::Parser::new_ext
   9: lib::to_html::render_html
  10: criterion::bencher::Bencher<M>::iter
  11: <criterion::routine::Function<M,F,T> as criterion::routine::Routine<M,T>>::warm_up
  12: criterion::routine::Routine::sample
  13: criterion::analysis::common
  14: lib::to_html::pathological_codeblocks1
  15: lib::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Benchmarking pathological_codeblocks1/8: Warming up for 3.0000 sthread 'main' panicked at 'byte index 3613 is out of bounds of ````````````````````````````````````````````````````````````````````````````````````````````````````` ````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````[...]', src/parse.rs:1450:46
stack backtrace:
   0: rust_begin_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
   1: core::panicking::panic_fmt
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
   2: core::str::slice_error_fail_rt
   3: core::str::slice_error_fail
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/str/mod.rs:86:9
   4: pulldown_cmark::parse::item_to_event
   5: <pulldown_cmark::parse::Parser as core::iter::traits::iterator::Iterator>::next
   6: pulldown_cmark::html::HtmlWriter<I,W>::run
   7: pulldown_cmark::html::push_html
   8: lib::to_html::render_html
   9: criterion::bencher::Bencher<M>::iter
  10: <criterion::routine::Function<M,F,T> as criterion::routine::Routine<M,T>>::warm_up
  11: criterion::routine::Routine::sample
  12: criterion::analysis::common
  13: lib::to_html::pathological_codeblocks1
  14: lib::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Benchmarking pathological_codeblocks1/8: Warming up for 3.0000 sthread 'main' panicked at 'byte index 3611 is out of bounds of ````````````````````````````````````````````````````````````````````````````````````````````````````` ````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````[...]', src/firstpass.rs:730:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@ollpu
Copy link
Collaborator

ollpu commented Dec 13, 2024

Might be related to #652 - wrapping_shr can keep some bits set that shouldn't be if shift is over 31

Reproduction:

echo -n '`````````````````````````````````x`' | cargo run --features simd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants