New issue
Advanced search Search tips

Issue 820291 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Stack traces in devtools do not show wasm function names

Project Member Reported by dschuff@chromium.org, Mar 8 2018

Issue description

When a wasm module has a name section, d8 interprets it and prints the name in addition to the function index in stack traces:

e.g. the _main frame below:

$d8 abort.js
exception thrown: abort() at Error
    at jsStackTrace (abort.js:1001:13)
    at stackTrace (abort.js:1018:12)
    at Object.abort (abort.js:2328:44)
    at _abort (abort.js:1862:22)
    at _main (wasm-function[22]:7)
    at Object.callMain (abort.js:2168:30)
    at doRun (abort.js:2226:60)
    at run (abort.js:2240:5)
    at abort.js:2355:1

However in chrome the devtools console prints the following:

Uncaught abort() at Error
    at jsStackTrace (http://localhost:8181/abort.js:1001:13)
    at stackTrace (http://localhost:8181/abort.js:1018:12)
    at Object.abort (http://localhost:8181/abort.js:2408:44)
    at _abort (http://localhost:8181/abort.js:1887:22)
    at wasm-function[22]:7
    at Object.Module._main (http://localhost:8181/abort.js:2074:33)
    at Object.callMain (http://localhost:8181/abort.js:2248:30)
    at doRun (http://localhost:8181/abort.js:2306:60)
    at http://localhost:8181/abort.js:2317:7

Note the wasm-function[22]:7

This is with a freshly-built tip of tree Chromium, but the behavior is the same in 65 beta


 
abort.html
100 KB View Download
abort.js
98.1 KB View Download
abort.wasm
24.4 KB Download
(note that the attached abort.js can't run in d8 due to https://bugs.chromium.org/p/v8/issues/detail?id=6263; you'll just have to take my word for it, or I'll rebuild with -s BINARYEN_ASYNC_COMPILATION=0)
Owner: herhut@chromium.org
We do not currently decode the names section during streaming compilation (which is used in chrome). I had planned to remodel parsing names so that we do it on demand anyway and that will fix this inconsistency.
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/49a1a9a4670a9e8a207d6d9e985287c819701612

commit 49a1a9a4670a9e8a207d6d9e985287c819701612
Author: Stephan Herhut <herhut@chromium.org>
Date: Tue Mar 13 16:53:10 2018

[wasm] Parse function names on demand

Function names are optional in wasm and might not be present for most
functions. Instead of storing an empty name with each function, this
change loads names, if present, on first access of the name.

This also fixes an inconsistency with streaming compilation. Under
streaming compilation, functions are compiled before parsing the name
section. Hence, they always received an empty name. With this change,
assignment of names is typically deferred until the whole module was
parsed.

Bug:  chromium:820291 
Change-Id: I86d76aa40b7c45897d152725547795c8b6b9b9ba
Reviewed-on: https://chromium-review.googlesource.com/955647
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51909}
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/compiler/wasm-compiler.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/module-compiler.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/module-decoder.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/module-decoder.h
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/wasm-interpreter.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/wasm-module.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/wasm-module.h
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/wasm-objects.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/src/wasm/wasm-text.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/test/cctest/wasm/wasm-run-utils.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/test/unittests/wasm/function-body-decoder-unittest.cc
[modify] https://crrev.com/49a1a9a4670a9e8a207d6d9e985287c819701612/test/unittests/wasm/module-decoder-unittest.cc

Comment 4 by herhut@chromium.org, Mar 14 2018

Status: Fixed (was: Available)
Chrome now reports the same stack trace as d8. Closing.

Sign in to add a comment