bytecodealliance / bytecodealliance/wasmtime

Cranelift: 'Could not allocate minimal bundle, but the allocation problem should be possible to solve' panic

Open
#5,159 4 comments 0 reactions 0 assignees View on GitHub
bug cranelift
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

### `.clif` Test Case (reduced)

```
function u0:0() windows_fastcall {
sig0 = (i64 sret, i64) -> i64 sret fast
fn0 = colocated u0:4 sig0

block0:
v1 = iconst.i64 0
v5 = iconst.i64 0
v6 = call fn0(v5, v1) ; v5 = 0, v1 = 0
return
}
```

### Steps to Reproduce

(bug.clif)
```
function u0:0(i64, i64) windows_fastcall {
sig0 = (i64 sret, i64) -> i64 sret fast
sig1 = (i64 sret, i64) -> i64 sret fast
fn0 = colocated u0:4 sig0
fn1 = colocated u0:4 sig1

block0(v0: i64, v1: i64):
v2 = iconst.i8 0
store v2, v0 ; v2 = 0
v3 = iadd_imm v0, 4
v4 = call fn0(v3, v1)
v5 = iadd_imm v0, 16
v6 = call fn1(v5, v1)
return
}
```
(in cranelift directory)
```
> cargo run --release bugpoint bug.clif x86_64-pc-windows-msvc
```

### Expected Result

The code I provided should be valid or at least possible to compile unless I overlooked something.

### Actual Results

```
thread '' panicked at 'Could not allocate minimal bundle, but the allocation problem should be possible to solve', C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\regalloc2-0.4.1\src\ion\process.rs:1268:17
stack backtrace:
0: std::panicking::begin_panic
at /rustc/95a992a68694d8bf3959bd2c0ac27ce9e9208b59\library\std\src\panicking.rs:616
1: regalloc2::ion::data_structures::Env > >::process_bundle > >::process_bundles > >::run > >
at C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\regalloc2-0.4.1\src\ion\mod.rs:127
5: regalloc2::run > >
at C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\regalloc2-0.4.1\src\lib.rs:1460
6: cranelift_codegen::machinst::compile::compile
at C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\cranelift-codegen-0.89.1\src\machinst\compile.rs:41
7: cranelift_codegen::isa::x64::X64Backend::compile_vcode
at C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\cranelift-codegen-0.89.1\src\isa\x64\mod.rs:58
8: cranelift_codegen::isa::x64::impl$1::compile_function
at C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\cranelift-codegen-0.89.1\src\isa\x64\mod.rs:69
9: cranelift_codegen::context::Context::compile_stencil
at C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\cranelift-codegen-0.89.1\src\context.rs:173
10: cranelift_codegen::context::Context::compile
at C:\Users\LENOVO\.cargo\registry\src\github.com-1ecc6299db9ec823\cranelift-codegen-0.89.1\src\context.rs:185
11: middleware::logic::Worker::compile_current_requests
at C:\src\rust\catalyst\subcommands\middleware\src\logic.rs:686
12: middleware::logic::Worker::compile_macros
at C:\src\rust\catalyst\subcommands\middleware\src\logic.rs:614
13: middleware::logic::Worker::compile_module
at C:\src\rust\catalyst\subcommands\middleware\src\logic.rs:591
14: middleware::logic::impl$2::run::closure$0
at C:\src\rust\catalyst\subcommands\middleware\src\logic.rs:535
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```

### Versions and Environment

Cranelift version or commit: 0.90.0

Operating system: Windows

Architecture: x86_64

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.