Skip to content
New issue

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

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

Already on GitHub? # to your account

wasmtime v9 jit panics when using ProfilingStrategy::PerfMap #6433

Closed
repi opened this issue May 22, 2023 · 2 comments
Closed

wasmtime v9 jit panics when using ProfilingStrategy::PerfMap #6433

repi opened this issue May 22, 2023 · 2 comments
Labels
bug Incorrect behavior in the current implementation that needs fixing

Comments

@repi
Copy link
Contributor

repi commented May 22, 2023

Test Case

The Linux perf support enabled with ProfilingStrategy::PerfMap now with wasmtime v9.0.0 panics in wasmtime-jit

Steps to Reproduce

Compile a module with config.profiler(wasmtime::ProfilingStrategy::PerfMap);

Expected Results

It compiles

Actual Results

It panics inside wasmtime-jit on an Option::unwrap from:

    /// Returns an iterator over all array-to-Wasm trampolines defined within
    /// this module, providing both their index and their in-memory body.
    pub fn array_to_wasm_trampolines(
        &self,
    ) -> impl ExactSizeIterator<Item = (DefinedFuncIndex, &[u8])> + '_ {
        self.funcs
            .keys()
            .map(move |i| (i, self.array_to_wasm_trampoline(i).unwrap()))
    }

Versions and Environment

Wasmtime version or commit: 9.0.0

Operating system: Linux

Architecture: x64

Extra Info

This panic didn't happen on v8.0.1.

Likely caused by either these PRs?

@repi repi added the bug Incorrect behavior in the current implementation that needs fixing label May 22, 2023
alexcrichton added a commit to alexcrichton/wasmtime that referenced this issue May 22, 2023
This commit fixes a panic that's easy to hit with native profilers by
accident. This was introduced in bytecodealliance#6262 which made it into the 9.0.0
release but is not present on `main` due to the refactorings of bytecodealliance#6361
which are on `main` but not on 9.0.0.

Closes bytecodealliance#6433
alexcrichton added a commit that referenced this issue May 22, 2023
This commit fixes a panic that's easy to hit with native profilers by
accident. This was introduced in #6262 which made it into the 9.0.0
release but is not present on `main` due to the refactorings of #6361
which are on `main` but not on 9.0.0.

Closes #6433
@peterhuene
Copy link
Member

I believe this is now fixed with 9.0.1's release.

@repi
Copy link
Contributor Author

repi commented May 23, 2023

thanks for quick fix! confirmed that 9.0.1 fixes it!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants