Zero-length stream copies within one component instance trap for non-numeric payloads
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- compilers
Research direction
Start with the linked canonical ABI definition and compare its non-numeric payload trap condition with the zero-length stream read in the WAST example. Reproduce the case with Wasmtime and determine whether the implementation or the specification needs an update; done means the behavior and expected test result are resolved.
Written by the indexing model from the issue text.
Description
This test:
;; With a write pending on a `stream<string>`, a zero-length read from the
;; same component instance copies nothing and returns COMPLETED(0).
(component
(core module $libc
(memory (export "memory") 1)
(func (export "realloc") (param i32 i32 i32 i32) (result i32) unreachable))
(core instance $libc (instantiate $libc))
(type $stream (stream string))
(core func $stream.new (canon stream.new $stream))
(core func $stream.read (canon stream.read $stream async
(memory (core memory $libc "memory")) (realloc (core func $libc "realloc"))))
(core func $stream.write (canon stream.write $stream async
(memory (core memory $libc "memory"))))
(core module $m
(import "" "stream.new" (func $stream.new (result i64)))
(import "" "stream.read" (func $stream.read (param i32 i32 i32) (result i32)))
(import "" "stream.write" (func $stream.write (param i32 i32 i32) (result i32)))
(func (export "run") (result i32)
(local $pair i64)
(local.set $pair (call $stream.new))
(if (i32.ne (i32.const -1) ;; BLOCKED
(call $stream.write
(i32.wrap_i64 (i64.shr_u (local.get $pair) (i64.const 32)))
(i32.const 0) (i32.const 1)))
(then unreachable))
(call $stream.read (i32.wrap_i64 (local.get $pair)) (i32.const 0) (i32.const 0)))
)
(core instance $i (instantiate $m (with "" (instance
(export "stream.new" (func $stream.new))
(export "stream.read" (func $stream.read))
(export "stream.write" (func $stream.write))))))
(func (export "run") async (result u32) (canon lift (core func $i "run")))
)
(assert_return (invoke "run") (u32.const 0)) ;; COMPLETED(0)
fails in Wasmtime with:
$ wasmtime wast foo.wast
Error: failed to run script file 'foo.wast'
Caused by:
0: failed directive on foo.wast:39
1: error while executing at wasm backtrace:
0: 0x282 - wasm-function[3]
at foo.wast:29:8
2: cannot read from and write to intra-component future/stream with non-numeric payload
but the spec indicates that this test should pass right now as the trap is gated on non-zero-length buffers.
I wanted to flag this as a possible update to the specification (similar to https://github.com/WebAssembly/component-model/issues/750 perhaps) where subjectively I'd expect this to unconditionally fail regardless of the lengths in play, but I may also be showing my biases from #750 too.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 134
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/component-model
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
WebAssembly/component-model#609 · 2 comments · 1 reaction ·
Maintainers usually reply within 4 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/component-model#769 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
WebAssembly/component-model#768 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
WebAssembly/component-model#765 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/component-model#752 · 13 comments · 1 reaction ·
Maintainers usually reply within 4 days
All issues in WebAssembly/component-model
Similar issues
-
DAE2 crashes on call.without.effects with a non ref.func expressionPossibly taken @stevenfontanella claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
WebAssembly/binaryen#9404 ·
Maintainers usually reply within 1 day
-
area:compiler effort:S impact:med platform:windows type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area:Analysis enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 69/100
facebookresearch/atlas-lean#5118 ·
Maintainers usually reply within 1 day
-
drools: declared enum with 128 or more literals fails at class initialization (NegativeArraySizeException)Possibly taken @drccrd claimed this today. Openarea:rules
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/incubator-kie#7306 · 3 comments ·
Maintainers usually reply within 2 days
-
bug css P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day