New issue
Advanced search Search tips

Issue 832552 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

WebAssembly.compileStreaming(fetch('/404')) must error before compilation

Project Member Reported by mathias@chromium.org, Apr 13 2018

Issue description

    > WebAssembly.compileStreaming(fetch('/404'))
    Uncaught (in promise) CompileError: WebAssembly.compileStreaming(): Wasm code generation disallowed by embedder
        at <anonymous>:1:13

This currently throws a CompileError, implying that compilation is attempted. This should not happen!

https://github.com/WebAssembly/design/blob/master/Web.md#webassemblycompilestreaming

> If the Response [...] does not represent an ok status [...] the returned promise will be rejected with a TypeError

https://fetch.spec.whatwg.org/#ok-status

> An ok status is any status in the range 200 to 299, inclusive.
 
Note that TypeError must also be thrown when the response MIME type is not application/wasm, and we already do this. So when testing, make make to use the wasm MIME type but with a non-2xx status code.

Comment 2 by ahaas@chromium.org, Apr 13 2018

Cc: -ahaas@chromium.org
Owner: ahaas@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b2a818025f27b8fbeaa1b3573c9d561b9fa18214

commit b2a818025f27b8fbeaa1b3573c9d561b9fa18214
Author: Andreas Haas <ahaas@chromium.org>
Date: Tue Apr 17 07:06:48 2018

[v8][wasm] Throw TypeError if Response status is not ok

The WebAssembly spec [1] requires that a TypeError is thrown if the
status of the Response input of streaming compilation is not ok.

I added layout tests for this, and cleaned up the surrounding tests a
bit.


[1] https://github.com/WebAssembly/design/blob/master/Web.md#webassemblycompilestreaming

R=mlippautz@chromium.org, mathias@chromium.org

also-by: mathias@chromium.org
Bug:  chromium:832552 
Change-Id: Icd50e537ab659662708274a96959eb94d7fbc554
Reviewed-on: https://chromium-review.googlesource.com/1012035
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551269}
[modify] https://crrev.com/b2a818025f27b8fbeaa1b3573c9d561b9fa18214/third_party/WebKit/LayoutTests/http/tests/wasm/resources/load-wasm.php
[modify] https://crrev.com/b2a818025f27b8fbeaa1b3573c9d561b9fa18214/third_party/WebKit/LayoutTests/http/tests/wasm_streaming/wasm_response_apis.html
[modify] https://crrev.com/b2a818025f27b8fbeaa1b3573c9d561b9fa18214/third_party/WebKit/LayoutTests/http/tests/wasm_streaming/wasm_response_apis.js
[modify] https://crrev.com/b2a818025f27b8fbeaa1b3573c9d561b9fa18214/third_party/blink/renderer/bindings/core/v8/v8_wasm_response_extensions.cc

Comment 4 by ahaas@chromium.org, Apr 17 2018

Status: Fixed (was: Started)
Cc: ahaas@chromium.org
 Issue v8:7650  has been merged into this issue.

Sign in to add a comment