Stream: git-wasmtime

Topic: wasmtime / issue #3583 Cranelift: emit_small_memory_copy ...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2021 at 13:54):

bjorn3 opened issue #3583:

cranelift_frontend::FunctionBuilder::emit_small_memory_copy(documentation) takes the arguments dest_align and src_align, which it uses only for an assertion and then ignores. It chooses an access size which may be larger than the alignment and calls flags.set_aligned(); and proceeds to doing unaligned memory access. This seems to be a mistake.

Reported by Veverak at https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/emit_small_memory_copy.20ignores.20alignment/near/263576215

view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2021 at 13:54):

bjorn3 labeled issue #3583:

cranelift_frontend::FunctionBuilder::emit_small_memory_copy(documentation) takes the arguments dest_align and src_align, which it uses only for an assertion and then ignores. It chooses an access size which may be larger than the alignment and calls flags.set_aligned(); and proceeds to doing unaligned memory access. This seems to be a mistake.

Reported by Veverak at https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/emit_small_memory_copy.20ignores.20alignment/near/263576215

view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2021 at 13:54):

bjorn3 labeled issue #3583:

cranelift_frontend::FunctionBuilder::emit_small_memory_copy(documentation) takes the arguments dest_align and src_align, which it uses only for an assertion and then ignores. It chooses an access size which may be larger than the alignment and calls flags.set_aligned(); and proceeds to doing unaligned memory access. This seems to be a mistake.

Reported by Veverak at https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/emit_small_memory_copy.20ignores.20alignment/near/263576215

view this post on Zulip Wasmtime GitHub notifications bot (Dec 03 2021 at 18:35):

cfallin commented on issue #3583:

Hmm, yes, this seems to be the case. Fortunately codegen doesn't actually do anything with the alignment flag on x86-64 or aarch64; both architectures support misaligned accesses natively for the integer types that this small-memcpy will use; but for fully correct IR we should fix this.


Last updated: Nov 22 2024 at 17:03 UTC