Stream: git-wasmtime

Topic: wasmtime / issue #3132 threads: Addresses for atomic oper...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2021 at 16:27):

alexcrichton opened issue #3132:

This module, for example:

(module
    (memory 0)

    (func
        i32.const 0xffff_fff0
        i32.atomic.load offset=16
        drop
    )
    (start 0)
)

should fail with a trap but succeeds:

$ cargo run -- --enable-threads foo.wat

view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2021 at 16:27):

alexcrichton labeled issue #3132:

This module, for example:

(module
    (memory 0)

    (func
        i32.const 0xffff_fff0
        i32.atomic.load offset=16
        drop
    )
    (start 0)
)

should fail with a trap but succeeds:

$ cargo run -- --enable-threads foo.wat

view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2021 at 16:28):

alexcrichton edited issue #3132:

This module, for example:

(module
    (memory 1)

    (func
        i32.const 0xffff_fff0
        i32.atomic.load offset=16
        drop
    )
    (start 0)
)

should fail with a trap but succeeds:

$ cargo run -- --enable-threads foo.wat

view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2021 at 17:12):

cfallin commented on issue #3132:

It appears that atomic loads handle their offset differently than others. In #2077 we introduced a new LoadNoOffset instruction class, and instead, the Wasm translator inserts a bare iadd_imm (with no overflow check): link.

@julian-seward1, do you recall why we didn't just take an offset on the atomic load/store ops like we do on regular ones? Was it in order to simplify the implementation or is there some other reason?

IMHO the right fix (assuming the above question doesn't reveal a blocking reason) is to harmonize atomic loads/stores with regular ones and use the same offset handling / overflow checking logic.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 04 2021 at 20:57):

alexcrichton closed issue #3132:

This module, for example:

(module
    (memory 1)

    (func
        i32.const 0xffff_fff0
        i32.atomic.load offset=16
        drop
    )
    (start 0)
)

should fail with a trap but succeeds:

$ cargo run -- --enable-threads foo.wat

Last updated: Nov 22 2024 at 17:03 UTC