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

Roc panic in bumpalo-3.14.0 when rendering expect failure #7539

Open
imclerran opened this issue Jan 21, 2025 · 0 comments
Open

Roc panic in bumpalo-3.14.0 when rendering expect failure #7539

imclerran opened this issue Jan 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@imclerran
Copy link
Contributor

Haven't been able to minimize this error away from using Str.from_utf8, however the following code will produce the panic:

module []

expect
    utf8 = [0b1101_1111, 0b0011_1111]
    err = Err(BadUtf8({ index: 1, problem: ExpectedContinuation }))
    str_res = utf8 |> Str.from_utf8
    str_res == err

If index is changed to 0, the expect will pass, and since the failure is not rendered, the panic is not encountered. The same error can be reproduced by setting index to 0, but changing the tag assigned to problem.

The stack trace is as follows:

thread 'main' panicked at /Users/imclerran/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bumpalo-3.14.0/src/lib.rs:1854:5:
out of memory
stack backtrace:
   0: rust_begin_unwind
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
   2: bumpalo::oom
   3: roc_repl_eval::eval::addr_to_ast
   4: roc_repl_eval::eval::expr_of_tag
   5: roc_repl_eval::eval::addr_to_ast
   6: roc_repl_expect::get_values
   7: roc_repl_expect::run::render_expect_failure
   8: roc_cli::test
   9: roc::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@Anton-4 Anton-4 added the bug Something isn't working label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants