Stream: git-wasmtime

Topic: wasmtime / Issue #2784 Panic for on-demand instance alloc...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 26 2021 at 22:51):

peterhuene opened Issue #2784 (assigned to peterhuene):

Steps to Reproduce

On Linux, build wasmtime with the uffd feature and run the following:

let wat = r#"
(module
    (memory (export "memory") 100)
    (data (i32.const 0) "Hello World!")
)"#;
let engine = Engine::default();
let module = Module::new(&engine, wat)?;
let store = Store::new(&engine);
Instance::new(&store, &module, &[])?;

Expected Results

The module should instantiate.

Actual Results

Panic:

thread 'main' panicked at 'source slice length (65536) does not match destination slice length (6553600)'

Caused by this call to copy_from_slice that did not properly provide an upper-bound for the range.

This was missed by the uffd tests because they specifically use the pooling allocator which skips initialization of the data segments by not calling initialize_instance.

The tests should also be run with the on-demand allocator with the uffd feature enabled.

Versions and Environment

Wasmtime version or commit: HEAD

Operating system: Linux with uffd feature

Architecture: x86_64

view this post on Zulip Wasmtime GitHub notifications bot (Mar 26 2021 at 22:51):

peterhuene assigned Issue #2784 (assigned to peterhuene):

Steps to Reproduce

On Linux, build wasmtime with the uffd feature and run the following:

let wat = r#"
(module
    (memory (export "memory") 100)
    (data (i32.const 0) "Hello World!")
)"#;
let engine = Engine::default();
let module = Module::new(&engine, wat)?;
let store = Store::new(&engine);
Instance::new(&store, &module, &[])?;

Expected Results

The module should instantiate.

Actual Results

Panic:

thread 'main' panicked at 'source slice length (65536) does not match destination slice length (6553600)'

Caused by this call to copy_from_slice that did not properly provide an upper-bound for the range.

This was missed by the uffd tests because they specifically use the pooling allocator which skips initialization of the data segments by not calling initialize_instance.

The tests should also be run with the on-demand allocator with the uffd feature enabled.

Versions and Environment

Wasmtime version or commit: HEAD

Operating system: Linux with uffd feature

Architecture: x86_64

view this post on Zulip Wasmtime GitHub notifications bot (Mar 26 2021 at 22:51):

peterhuene labeled Issue #2784 (assigned to peterhuene):

Steps to Reproduce

On Linux, build wasmtime with the uffd feature and run the following:

let wat = r#"
(module
    (memory (export "memory") 100)
    (data (i32.const 0) "Hello World!")
)"#;
let engine = Engine::default();
let module = Module::new(&engine, wat)?;
let store = Store::new(&engine);
Instance::new(&store, &module, &[])?;

Expected Results

The module should instantiate.

Actual Results

Panic:

thread 'main' panicked at 'source slice length (65536) does not match destination slice length (6553600)'

Caused by this call to copy_from_slice that did not properly provide an upper-bound for the range.

This was missed by the uffd tests because they specifically use the pooling allocator which skips initialization of the data segments by not calling initialize_instance.

The tests should also be run with the on-demand allocator with the uffd feature enabled.

Versions and Environment

Wasmtime version or commit: HEAD

Operating system: Linux with uffd feature

Architecture: x86_64

view this post on Zulip Wasmtime GitHub notifications bot (Mar 26 2021 at 22:56):

peterhuene commented on Issue #2784:

I think we missed this in the wast tests because a lot of them use an initial size of the memory of 1, which would cause the range to be correct.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 26 2021 at 22:58):

peterhuene edited a comment on Issue #2784:

I think we missed this in the wast tests because a lot of them use an initial size of the memory of 1, which would cause the range to be correct for initializing the data segments.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 03 2021 at 00:30):

peterhuene closed Issue #2784 (assigned to peterhuene):

Steps to Reproduce

On Linux, build wasmtime with the uffd feature and run the following:

let wat = r#"
(module
    (memory (export "memory") 100)
    (data (i32.const 0) "Hello World!")
)"#;
let engine = Engine::default();
let module = Module::new(&engine, wat)?;
let store = Store::new(&engine);
Instance::new(&store, &module, &[])?;

Expected Results

The module should instantiate.

Actual Results

Panic:

thread 'main' panicked at 'source slice length (65536) does not match destination slice length (6553600)'

Caused by this call to copy_from_slice that did not properly provide an upper-bound for the range.

This was missed by the uffd tests because they specifically use the pooling allocator which skips initialization of the data segments by not calling initialize_instance.

The tests should also be run with the on-demand allocator with the uffd feature enabled.

Versions and Environment

Wasmtime version or commit: HEAD

Operating system: Linux with uffd feature

Architecture: x86_64


Last updated: Nov 22 2024 at 16:03 UTC