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

UB detected by miri #264

Open
kdy1 opened this issue Sep 14, 2022 · 0 comments
Open

UB detected by miri #264

kdy1 opened this issue Sep 14, 2022 · 0 comments

Comments

@kdy1
Copy link
Contributor

kdy1 commented Sep 14, 2022

Hi. I'm author of the swc project and swc is using this library.

While trying to run tests with miri, miri detected UB


error: Undefined Behavior: trying to retag from <wildcard> for SharedReadOnly permission at alloc99614[0x0], but no exposed tags have suitable permission in the borrow stack for this location
   --> /Users/kdy1/.cargo/registry/src/github.com-1ecc6299db9ec823/string_cache-0.8.4/src/atom.rs:256:21
    |
256 |                     &(*entry).string
    |                     ^^^^^^^^^^^^^^^^
    |                     |
    |                     trying to retag from <wildcard> for SharedReadOnly permission at alloc99614[0x0], but no exposed tags have suitable permission in the borrow stack for this location
    |                     this error occurs as part of retag at alloc99614[0x0..0x10]
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
    = note: BACKTRACE:
    = note: inside `<string_cache::atom::Atom<swc_atoms::JsWordStaticSet> as std::ops::Deref>::deref` at /Users/kdy1/.cargo/registry/src/github.com-1ecc6299db9ec823/string_cache-0.8.4/src/atom.rs:256:21
note: inside `tests::access_tag` at crates/jsdoc/src/lib.rs:710:21

My rust-toolchain is

nightly-2022-09-14

and I ran cargo miri test from the root of swc repository.

I'm not sure, but I guess this can be related to segfault mentioned in #33

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

No branches or pull requests

1 participant