issue_owner_repo
listlengths 2
2
| issue_body
stringlengths 0
261k
⌀ | issue_title
stringlengths 1
925
| issue_comments_url
stringlengths 56
81
| issue_comments_count
int64 0
2.5k
| issue_created_at
stringlengths 20
20
| issue_updated_at
stringlengths 20
20
| issue_html_url
stringlengths 37
62
| issue_github_id
int64 387k
2.46B
| issue_number
int64 1
127k
|
---|---|---|---|---|---|---|---|---|---|
[
"WebAssembly",
"wabt"
] |
Compile the following program with `clang-13 -target wasm32-wasi -O0`. Use `wasm-objdump -s -d -x -r --section-offsets expr.o` to disassemble it, it fails with `Data reloctions outside of segments`.
```c
int bar(int);
void* sha = bar;
int foo(int x) {
void *p = bar;
sha = p;
if (x < 0) {
return foo(x);
}
return bar(x);
}
```
|
"Data reloctions outside of segments"
|
https://api.github.com/repos/WebAssembly/wabt/issues/1790/comments
| 0 |
2021-12-17T13:34:29Z
|
2022-01-07T22:23:16Z
|
https://github.com/WebAssembly/wabt/issues/1790
| 1,083,267,072 | 1,790 |
[
"WebAssembly",
"wabt"
] |
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc: In constructor ‘wasm_globaltype_t::wasm_globaltype_t(wasm_valtype_t*, wasm_mutability_t)’:
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:129:22: error: could not convert ‘* type’ from ‘wasm_valtype_t’ to ‘wabt::interp::ValueType {aka wabt::Type}’
valtype{*type} {
^
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc: In constructor ‘wasm_tabletype_t::wasm_tabletype_t(wabt::interp::TableType)’:
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:152:41: error: cannot convert ‘wasm_limits_t’ to ‘uint32_t {aka unsigned int}’ in initialization
limits{FromWabtLimits(tt.limits)} {}
^
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:152:41: warning: missing initializer for member ‘wasm_limits_t::max’ [-Wmissing-field-initializers]
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc: In constructor ‘wasm_memorytype_t::wasm_memorytype_t(const wasm_limits_t*)’:
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:162:23: error: cannot convert ‘const wasm_limits_t’ to ‘uint32_t {aka unsigned int}’ in initialization
limits{*limits} {}
^
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:162:23: warning: missing initializer for member ‘wasm_limits_t::max’ [-Wmissing-field-initializers]
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc: In constructor ‘wasm_memorytype_t::wasm_memorytype_t(wabt::interp::MemoryType)’:
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:166:41: error: cannot convert ‘wasm_limits_t’ to ‘uint32_t {aka unsigned int}’ in initialization
limits{FromWabtLimits(mt.limits)} {}
^
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:166:41: warning: missing initializer for member ‘wasm_limits_t::max’ [-Wmissing-field-initializers]
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc: In function ‘wasm_frame_t* wasm_frame_copy(const wasm_frame_t*)’:
/root/wasm/wabt/src/interp/interp-wasm-c-api.cc:1024:33: error: could not convert ‘* frame’ from ‘const wasm_frame_t’ to ‘wabt::interp::Frame’
return new wasm_frame_t{*frame};
^
gmake[2]: *** [CMakeFiles/wasm.dir/src/interp/interp-wasm-c-api.cc.o] Error 1
gmake[1]: *** [CMakeFiles/wasm.dir/all] Error 2
gmake: *** [all] Error 2
|
Build failed on CentOS 7
|
https://api.github.com/repos/WebAssembly/wabt/issues/1773/comments
| 2 |
2021-12-05T10:29:01Z
|
2022-04-27T04:45:49Z
|
https://github.com/WebAssembly/wabt/issues/1773
| 1,071,423,894 | 1,773 |
[
"WebAssembly",
"wabt"
] |
If my wasm includes `"☺\n"` or `"\e2\98\ba\n"`, it behaves normally. I would expect `"\u{263a}\n"` to end up with the same byte sequence, but it fails compilation like:
```bash
$ smiley.wat
smiley.wat:6:39: error: bad escape "\u"
(data (global.get $start_string) "\u{263a}\n")
^^
smiley.wat:6:38: error: unexpected token Invalid, expected ).
(data (global.get $start_string) "\u{263a}\n")
^^^^^^^^^^^^
$ wat2wasm --version
1.0.24
```
Here's the working thingy, and I checked the rust impl and that seems to be ok..
```wat
(module
(import "env" "print_string" (func $print_string( param i32 )))
(import "env" "buffer" (memory 1))
(global $start_string (import "env" "start_string") i32)
(global $string_len i32 (i32.const 4))
(data (global.get $start_string) "\e2\98\ba\n")
(func (export "smiley")
(call $print_string (global.get $string_len))
)
)
```
See https://www.w3.org/TR/wasm-core-1/#text-string
cc @alexcrichton as I think the rust impl is correct, just it could be easier to try the rust equiv of wat2wasm since you are doing the parsing anyway... if you think relevant I'll open an issue asking for a rust variant! https://github.com/bytecodealliance/wasm-tools
|
wat2wasm doesn't seem to accept utf escapes
|
https://api.github.com/repos/WebAssembly/wabt/issues/1767/comments
| 3 |
2021-11-30T06:26:41Z
|
2022-05-03T08:34:39Z
|
https://github.com/WebAssembly/wabt/issues/1767
| 1,066,845,715 | 1,767 |
[
"WebAssembly",
"wabt"
] |
Hi there,
I was trying to convert a WASM to C when wasm2c exited saying that the WASM file used threads.
Would it be possible to enable this feature in wasm2c?
Thanks
|
wasm2c supporting threads and other features
|
https://api.github.com/repos/WebAssembly/wabt/issues/1766/comments
| 14 |
2021-11-21T18:45:04Z
|
2021-12-07T21:02:09Z
|
https://github.com/WebAssembly/wabt/issues/1766
| 1,059,454,802 | 1,766 |
[
"WebAssembly",
"wabt"
] |
When running the example in #1761 with tracing on, you get a crash due to an assertion failure like the following
```
$ wabt/out/clang/Debug/wasm-interp out/test/interp/return-call-get-local/return-call-get-local.wasm -t --run-all-exports --enable-tail-call
>>> running export "f":
#0. 0: V:0 | i64.const 1
#0. 12: V:1 | br @24
#0. 24: V:1 | i32.const 3
#0. 32: V:2 | drop_keep $1 $1
#0. 44: V:1 | br @68
#0. 68: V:1 | i32.const 2
wasm-interp: ../../../src/interp/interp.cc:192: wabt::interp::ValueType wabt::interp::FuncDesc::GetLocalType(wabt::interp::Index) const: Assertion `iter != locals.end()' failed.
Aborted (core dumped)
```
This is because the value stack height is set for the wrong function when a `return_call` is done, because it re-uses the existing stack frame without adjusting any of its values. It's probably easiest to fix this after #1749 lands because it also adjusts how `return_call` is executed.
|
Assertion fails in `return_call` test case when tracing is on
|
https://api.github.com/repos/WebAssembly/wabt/issues/1763/comments
| 0 |
2021-11-17T00:54:18Z
|
2021-11-17T00:54:18Z
|
https://github.com/WebAssembly/wabt/issues/1763
| 1,055,589,649 | 1,763 |
[
"WebAssembly",
"wabt"
] |
The following test case will cause an infinite loop (despite there being no recursion in these calls):
```
;;; TOOL: run-interp
;;; ARGS*: --enable-tail-call
(module
(func (export "f") (result i32)
(i64.const 1)
(return_call $g))
(func $g (param i64) (result i32)
(i32.const 3)
(return_call $h))
(func $h (param i32) (result i32)
(i32.const 2)
(local.set 0)
(local.get 0)
return)
)
(;; STDOUT ;;;
f() => i32:2
;;; STDOUT ;;)
```
This is due to a bug in how `return_call` is implemented in the interpreter. I'm working on a patch which I'll PR when it's done.
|
Infinite loop on use of `return_call`
|
https://api.github.com/repos/WebAssembly/wabt/issues/1761/comments
| 1 |
2021-11-16T19:09:11Z
|
2022-01-07T20:22:16Z
|
https://github.com/WebAssembly/wabt/issues/1761
| 1,055,226,626 | 1,761 |
[
"WebAssembly",
"wabt"
] |
If we have binaries attached for common architectures, less need to burn CPU compiling from source. Linux and MacOS are common now, and Windows will be common soon enough. How about attaching bins at least for Linux and MacOS for arm64?
|
Add release binaries for arm64
|
https://api.github.com/repos/WebAssembly/wabt/issues/1760/comments
| 2 |
2021-11-15T06:25:37Z
|
2022-02-07T22:39:20Z
|
https://github.com/WebAssembly/wabt/issues/1760
| 1,053,264,651 | 1,760 |
[
"WebAssembly",
"wabt"
] |
May I ask the supporting plan about the latest [GC MVP](https://github.com/WebAssembly/gc/blob/master/proposals/gc/MVP.md)? The [GC branch](https://github.com/WebAssembly/wabt/tree/gc) hasn't been updated for a long time.
|
GC supporting
|
https://api.github.com/repos/WebAssembly/wabt/issues/1759/comments
| 1 |
2021-11-11T01:50:58Z
|
2022-03-13T22:54:06Z
|
https://github.com/WebAssembly/wabt/issues/1759
| 1,050,489,887 | 1,759 |
[
"WebAssembly",
"wabt"
] |
Currently trying to run wasm-strip on Wasm using e.g. multithreading results in errors like
```
0001115: error: memory may not be shared: threads not allowed
```
and/or
```
0005364: error: invalid section code: 12
```
There is no reason for wasm-strip to care about those parts of the Wasm binary; instead, it should just go through custom sections and delete those regardless of features used in the rest of the Wasm file.
|
wasm-strip should not error out on post-MVP extensions
|
https://api.github.com/repos/WebAssembly/wabt/issues/1757/comments
| 1 |
2021-11-08T16:58:25Z
|
2021-11-09T00:08:06Z
|
https://github.com/WebAssembly/wabt/issues/1757
| 1,047,685,997 | 1,757 |
[
"WebAssembly",
"wabt"
] |
https://github.com/WebAssembly/spec/blob/e87021b46a7519ff5264e62fa4773e4c92ded57a/test/core/elem.wast#L470-L484
```log
$ wast2json --enable-all --no-check -o elem.json elem.wast
elem.wast:473:55: error: unexpected token (, expected ).
(elem (i32.const 0) funcref (item (ref.null func) (ref.null func)))
^
elem.wast:473:71: error: unexpected token ")", expected a quoted string (e.g. "foo").
(elem (i32.const 0) funcref (item (ref.null func) (ref.null func)))
^
elem.wast:481:34: error: unexpected token i32.const, expected ).
(elem (i32.const 0) funcref (i32.const 0))
^^^^^^^^^
```
|
wast2json fails to convert elem.wast from ther core spec
|
https://api.github.com/repos/WebAssembly/wabt/issues/1750/comments
| 1 |
2021-11-04T10:08:25Z
|
2022-04-27T04:36:02Z
|
https://github.com/WebAssembly/wabt/issues/1750
| 1,044,555,698 | 1,750 |
[
"WebAssembly",
"wabt"
] |
I'm seeing: `Segment/Elem offset must be an i32 init expr ` when I tree to `wasm-objdump -h hello.o` after building with `emcc -c -s MEMORY64=2`.
Looks like we unconditionally expect 32-bit offsets, which I guess is not correct?
https://github.com/WebAssembly/wabt/blob/cd6639980cebed23d07bce4973284cf980f70721/src/binary-reader-objdump.cc#L1574
|
wasm-objdump error's on object files built with wasm64
|
https://api.github.com/repos/WebAssembly/wabt/issues/1742/comments
| 2 |
2021-10-18T19:59:41Z
|
2021-10-25T21:15:56Z
|
https://github.com/WebAssembly/wabt/issues/1742
| 1,029,536,979 | 1,742 |
[
"WebAssembly",
"wabt"
] |
Many test fail because the recent spec tests now require multi-table and reference-type support. I was forced to delete the following tests for that reason:
- test/wasm2c/spec/br_table.txt
- test/wasm2c/spec/call_indirect.txt
- test/wasm2c/spec/elem.txt
- test/wasm2c/spec/exports.txt
- test/wasm2c/spec/imports.txt
- test/wasm2c/spec/table.txt
- test/wasm2c/spec/linking.txt
- test/wasm2c/spec/select.txt
The new version of `test/wasm2c/spec/data.txt` fails because somehow the bounds checks don't seem to work for zero-sized memories. This test tails to trap:
```
(assert_trap
(module
(memory 0)
(data (i32.const 1))
)
"out of bounds memory access"
)
```
|
wasm2c no longer passes many spec tests
|
https://api.github.com/repos/WebAssembly/wabt/issues/1737/comments
| 0 |
2021-10-15T01:28:00Z
|
2022-10-03T06:27:37Z
|
https://github.com/WebAssembly/wabt/issues/1737
| 1,026,982,267 | 1,737 |
[
"WebAssembly",
"wabt"
] |
I use [wasm2wat demo](https://webassembly.github.io/wabt/demo/wasm2wat/) with all features enabled:
<img width="542" alt="截屏2021-10-15 08 20 07" src="https://user-images.githubusercontent.com/10240841/137412779-112a4799-95dc-4c02-8268-63ed77b32a82.png">
The .wasm file is attatched:
[a.out.wasm.zip](https://github.com/WebAssembly/wabt/files/7350026/a.out.wasm.zip)
I got the .wasm by compile following .cpp
```cpp
#include <stdio.h>
int main() {
try {
puts("throw...");
throw 1;
} catch(...) {
puts("catch!");
}
return 0;
}
```
I compile cpp with [fwasm-exceptions](https://emscripten.org/docs/porting/exceptions.html) flag
```bash
emcc test.cpp -fwasm-exceptions
```
I use emcc 2.0.31 on macbook
```bash
emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.31 (4fcbf0239ccca29771f9044c990b0d34fac6e2e7)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
|
unexpected opcode: 0x18
|
https://api.github.com/repos/WebAssembly/wabt/issues/1736/comments
| 2 |
2021-10-15T00:28:39Z
|
2022-08-17T05:17:21Z
|
https://github.com/WebAssembly/wabt/issues/1736
| 1,026,942,362 | 1,736 |
[
"WebAssembly",
"wabt"
] |
Current top-of-tree (and also v1.0.24) emit warnings when built with most recent CMake versions:
```
CMake Warning (dev) at CMakeLists.txt:352 (add_library):
Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
File:
/Users/srj/GitHub/wabt/src/config.h.in
This warning is for project developers. Use -Wno-dev to suppress it.
```
It would be good to set this policy appropriately to avoid this warning.
|
CMake warnings when building with CMake v3.20+
|
https://api.github.com/repos/WebAssembly/wabt/issues/1720/comments
| 1 |
2021-10-04T17:48:02Z
|
2022-05-19T18:00:52Z
|
https://github.com/WebAssembly/wabt/issues/1720
| 1,015,456,249 | 1,720 |
[
"WebAssembly",
"wabt"
] |
I've been using the latest WebAssembly spec to implement my library, [wasup](https://github.com/nicholaslyang/wasup). Since the Bulk Memory proposal is marked as finished, the current spec includes the DataCount section. Therefore, I was a little confused when I started getting `invalid section code: 12` errors with my wabt tools.
Is there any way to turn on bulk memory by default now? Or is there a reason why it hasn't been turned on yet? Now that I know what the deal is, I can just use the flag `--enable-bulk-memory`. But I could see other people getting confused as well.
It's also extra confusing because if you misplace DataCount, i.e. put it last, wabt actually gives you an explicit DataCount is out of order error, but if DataCount is in the right place, you get the invalid section code error.
|
Bulk Memory As Default
|
https://api.github.com/repos/WebAssembly/wabt/issues/1717/comments
| 0 |
2021-09-28T04:27:07Z
|
2021-10-13T16:33:32Z
|
https://github.com/WebAssembly/wabt/issues/1717
| 1,009,189,643 | 1,717 |
[
"WebAssembly",
"wabt"
] |
In the Windows instructions in the README.md, it suggests using MinGw and links to mingw.org but that URL currently seems to be serving malware.
|
mingw.org leads to malware site
|
https://api.github.com/repos/WebAssembly/wabt/issues/1716/comments
| 2 |
2021-09-27T21:47:44Z
|
2022-08-17T20:19:32Z
|
https://github.com/WebAssembly/wabt/issues/1716
| 1,008,661,703 | 1,716 |
[
"WebAssembly",
"wabt"
] |
I am a bit confused about the opcode.def file - what do the parameters represent?
These are the control instructions from the official specification:

Note that both the `br` and the `br_if` instruction take one parameter, namely the label index.
However, the opcode.def file defines the br instruction to have no parameter, while the br_if instruction does:

This is quite confusing and creates inconsistencies when using BinaryReader, as _both_ instructions trigger an `OnOpcodeIndex` callback:

Is there a logic behind that which I don't see or is the opcode.def file just poorly maintained?
|
opcode.def Structure
|
https://api.github.com/repos/WebAssembly/wabt/issues/1715/comments
| 3 |
2021-09-23T14:25:53Z
|
2021-09-29T14:21:30Z
|
https://github.com/WebAssembly/wabt/issues/1715
| 1,005,501,699 | 1,715 |
[
"WebAssembly",
"wabt"
] |
For instance, `ZN4hvif5shape5Shape5parse17ha264877da5eed17bE()` should be something like `hvif::shape::Shape::parse()`.
This issue is related to #1406, but specific to the symbols generated by rustc.
|
Demangle Rust symbol names in wasm-decompile
|
https://api.github.com/repos/WebAssembly/wabt/issues/1711/comments
| 1 |
2021-09-16T19:41:19Z
|
2023-08-15T02:47:40Z
|
https://github.com/WebAssembly/wabt/issues/1711
| 998,568,097 | 1,711 |
[
"WebAssembly",
"wabt"
] |
It appears that WABT uses https://github.com/WebAssembly/testsuite for it's spec tests. However it has outdated versions for some of the proposals, i.e exception-handling. When I try to take a fresh version directly from the https://github.com/WebAssembly/exception-handling I see a multitude of different issues in the various tools from WABT.
|
Spec tests for the exception handling don't work
|
https://api.github.com/repos/WebAssembly/wabt/issues/1710/comments
| 3 |
2021-09-16T13:02:57Z
|
2022-04-27T04:54:49Z
|
https://github.com/WebAssembly/wabt/issues/1710
| 998,188,423 | 1,710 |
[
"WebAssembly",
"wabt"
] |
When compiling on an arm64 Mac, configuring the build produces the warning:
```
CMake Warning at CMakeLists.txt:197 (message):
Unknown target architecture!
```
This is a common enough architecture now that it should be handled without warning.
|
TARGET_ARCH sniffing doesn't handle arm64 on OSX
|
https://api.github.com/repos/WebAssembly/wabt/issues/1709/comments
| 2 |
2021-09-15T20:42:03Z
|
2022-09-28T22:43:22Z
|
https://github.com/WebAssembly/wabt/issues/1709
| 997,500,719 | 1,709 |
[
"WebAssembly",
"wabt"
] |
On RHEL/CentOS 7, the system python3 is 3.6. Before python 3.7.0 (see [3.7.0 alpha 1 changelog](https://docs.python.org/3.7/whatsnew/changelog.html#id186), [issue 28180](https://bugs.python.org/issue28180) and [PEP 538](https://www.python.org/dev/peps/pep-0538)), the default text encoding was ascii, which fails on Unicode characters when deserializing a json file in `json.load()`:
```
- test/wasm2c/spec/names.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,10 @@
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.24/test/run-spec-wasm2c.py", line 437, in <module>
+ sys.exit(main(sys.argv[1:]))
+ File "/builddir/build/BUILD/wabt-1.0.24/test/run-spec-wasm2c.py", line 394, in main
+ spec_json = json.load(json_file)
+ File "/usr/lib64/python3.6/json/__init__.py", line 296, in load
+ return loads(fp.read(),
+ File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
+ return codecs.ascii_decode(input, self.errors)[0]
+UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 2862: ordinal not in range(128)
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +0,0 @@
-spectest.print_i32(42)
-spectest.print_i32(123)
-482/482 tests passed.
```
The following patch seems to make the test pass:
```diff
diff -up wabt-1.0.24/test/run-spec-wasm2c.py.utf8 wabt-1.0.24/test/run-spec-wasm2c.py
--- wabt-1.0.24/test/run-spec-wasm2c.py.utf8 2021-08-11 22:00:51.000000000 +0200
+++ wabt-1.0.24/test/run-spec-wasm2c.py 2021-08-20 13:47:48.766113890 +0200
@@ -390,7 +390,7 @@ def main(args):
cc = utils.Executable(options.cc, *options.cflags)
- with open(json_file_path) as json_file:
+ with open(json_file_path, encoding="utf-8") as json_file:
spec_json = json.load(json_file)
prefix = ''
```
|
1.0.24: test/wasm2c/spec/names.txt fails on RHEL/CentOS 7 with system python-3.6
|
https://api.github.com/repos/WebAssembly/wabt/issues/1704/comments
| 1 |
2021-08-20T12:46:05Z
|
2022-04-04T08:03:43Z
|
https://github.com/WebAssembly/wabt/issues/1704
| 975,578,222 | 1,704 |
[
"WebAssembly",
"wabt"
] |
wabt 1.0.24 fails to compile with system compiler (gcc-4.8.5) on RHEL/CentOS 7:
```
[ 83%] Building CXX object CMakeFiles/wasm.dir/src/interp/interp-wasm-c-api.cc.o
/usr/bin/c++ -DWASM_API_EXTERN="__attribute__((visibility(\"default\")))" -D__STDC_FORMAT_MACROS=1 -D__STDC_LIMIT_MACROS=1 -Dwasm_EXPORTS -I/builddir/build/BUILD/wabt-1.0.24 -I/builddir/build/BUILD/wabt-1.0.24/x86_64-redhat-linux-gnu -I/builddir/build/BUILD/wabt-1.0.24/third_party/wasm-c-api/include -I/builddir/build/BUILD/wabt-1.0.24/third_party/gtest/googletest -I/builddir/build/BUILD/wabt-1.0.24/third_party/gtest/googletest/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -std=c++11 -Wold-style-cast -fno-exceptions -fPIC -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wpointer-arith -Wuninitialized -Wno-clobbered -Wno-old-style-cast -o CMakeFiles/wasm.dir/src/interp/interp-wasm-c-api.cc.o -c /builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc: In constructor 'wasm_globaltype_t::wasm_globaltype_t(wasm_valtype_t*, wasm_mutability_t)':
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:129:22: error: could not convert '* type' from 'wasm_valtype_t' to 'wabt::interp::ValueType {aka wabt::Type}'
valtype{*type} {
^
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc: In constructor 'wasm_tabletype_t::wasm_tabletype_t(wabt::interp::TableType)':
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:152:41: error: cannot convert 'wasm_limits_t' to 'uint32_t {aka unsigned int}' in initialization
limits{FromWabtLimits(tt.limits)} {}
^
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:152:41: warning: missing initializer for member 'wasm_limits_t::max' [-Wmissing-field-initializers]
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc: In constructor 'wasm_memorytype_t::wasm_memorytype_t(const wasm_limits_t*)':
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:162:23: error: cannot convert 'const wasm_limits_t' to 'uint32_t {aka unsigned int}' in initialization
limits{*limits} {}
^
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:162:23: warning: missing initializer for member 'wasm_limits_t::max' [-Wmissing-field-initializers]
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc: In constructor 'wasm_memorytype_t::wasm_memorytype_t(wabt::interp::MemoryType)':
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:166:41: error: cannot convert 'wasm_limits_t' to 'uint32_t {aka unsigned int}' in initialization
limits{FromWabtLimits(mt.limits)} {}
^
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:166:41: warning: missing initializer for member 'wasm_limits_t::max' [-Wmissing-field-initializers]
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc: In function 'wasm_frame_t* wasm_frame_copy(const wasm_frame_t*)':
/builddir/build/BUILD/wabt-1.0.24/src/interp/interp-wasm-c-api.cc:1024:33: error: could not convert '* frame' from 'const wasm_frame_t' to 'wabt::interp::Frame'
return new wasm_frame_t{*frame};
^
gmake[2]: *** [CMakeFiles/wasm.dir/src/interp/interp-wasm-c-api.cc.o] Error 1
```
For now, I've worked around this by using a newer gcc version from optional DevToolset repository, but I wonder if this could be fixed easily to preserve compatiblity with this old compiler. The C++11 support there is [quite complete](https://gcc.gnu.org/gcc-4.8/cxx0x_status.html).
|
1.0.24 compilation error with gcc-4.8.5 (RHEL/CentOS 7)
|
https://api.github.com/repos/WebAssembly/wabt/issues/1703/comments
| 1 |
2021-08-20T12:16:51Z
|
2021-08-20T13:42:43Z
|
https://github.com/WebAssembly/wabt/issues/1703
| 975,557,329 | 1,703 |
[
"WebAssembly",
"wabt"
] |
I don't mean to sound ungrateful, but it has to be said... The issue tracker is just piling up, and simple questions often get ignored for years and forgotten.
|
Is WABT actively maintained?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1694/comments
| 4 |
2021-08-01T01:49:55Z
|
2022-04-27T18:52:34Z
|
https://github.com/WebAssembly/wabt/issues/1694
| 957,360,669 | 1,694 |
[
"WebAssembly",
"wabt"
] |
## update: jump to the bottom of all this ...
Pipes are used to give the output (stdout) of a command as the input (stdin) to another command ... command line piping has always been a power part of the Unix command line. This feature is absent in wabt. Is this something to consider ... as the concept is already being discussed and implemented within the webassembly.sh and wasi environments for example ...
### example:
`cat some.wasm | wasm2wat | wat2wasm > copyofsome.wasm`
|
accommodate outputting the binary wasm to stdout
|
https://api.github.com/repos/WebAssembly/wabt/issues/1692/comments
| 3 |
2021-07-13T01:07:45Z
|
2022-04-27T05:00:18Z
|
https://github.com/WebAssembly/wabt/issues/1692
| 942,583,259 | 1,692 |
[
"WebAssembly",
"wabt"
] |
I'm using the `readWasm` method of WABTJS, and it's choking on any constant expression that contains more than one instruction. The [Extended Constant Expressions Proposal][1] adds `add`, `sub` and `mul` instructions (so long as they are integer-typed) to the instructions permitted in a constant expression, so support for blocks of instructions is required.
It currently complains, saying `error: expected END opcode after initializer expression` after the first instruction (even though there's an END opcode after the block, as required).
[1]: https://github.com/WebAssembly/extended-const/blob/master/proposals/extended-const/Overview.md
|
WABT cannot handle constant expressions with more than one instruction.
|
https://api.github.com/repos/WebAssembly/wabt/issues/1690/comments
| 1 |
2021-07-11T02:22:48Z
|
2022-04-27T05:03:02Z
|
https://github.com/WebAssembly/wabt/issues/1690
| 941,357,801 | 1,690 |
[
"WebAssembly",
"wabt"
] |
The first sample works with 1.0.23 but produce with the version `main` from today an error.
error: `test.wat:2:10: error: undefined function variable "$.<start>"`
command line: `wat2wasm.exe test.wat --enable-all`
OS: Windows 10
```
(module
(start $.<start>)
(event (param externref))
(func $.<start>
)
)
```
This sample works with version 1.0.23 and the current version form `main`.
```
(module
(start $.<start>)
(func $.<start>
)
)
```
The same problem occurs with `export` of a function. A possible workaround may be to change the order. First the declaration of the function and then the usage. But why change the behavior when an `event` has been declared?
|
wat2wasm: function variable resolution broken
|
https://api.github.com/repos/WebAssembly/wabt/issues/1689/comments
| 6 |
2021-07-10T15:53:39Z
|
2021-08-29T13:54:00Z
|
https://github.com/WebAssembly/wabt/issues/1689
| 941,276,428 | 1,689 |
[
"WebAssembly",
"wabt"
] |
I'm trying to build wabt on an apple M1 computer running Big Sur 11.3.1 and I get this error message:
CMake Warning at CMakeLists.txt:197 (message):
Unknown target architecture!
|
wabt does not build on Apple M1 computers
|
https://api.github.com/repos/WebAssembly/wabt/issues/1688/comments
| 1 |
2021-07-07T13:13:02Z
|
2022-09-28T22:43:22Z
|
https://github.com/WebAssembly/wabt/issues/1688
| 938,880,364 | 1,688 |
[
"WebAssembly",
"wabt"
] |
When converting a binary that contains an extended name section to WAT, the identifiers are all preserved, except type and label identifiers, which are seemingly just ignored.
|
Type identifiers in the name section are lost during round trip.
|
https://api.github.com/repos/WebAssembly/wabt/issues/1687/comments
| 2 |
2021-07-06T01:31:54Z
|
2022-09-18T22:17:56Z
|
https://github.com/WebAssembly/wabt/issues/1687
| 937,445,289 | 1,687 |
[
"WebAssembly",
"wabt"
] |
Over in https://github.com/bytecodealliance/wasm-tools/issues/281 we were wondering why we were seeing validation errors for what should be valid Wasm:
```
(module
(memory 1)
(func
i32.const 0
v128.const i32x4 0 0 0 0
v128.load32_lane align=1 0
drop
)
)
```
The following commands result in an error:
```
$ wat2wasm --enable-all test.wat
$ wasm2wat --enable-all test.wasm
test.wasm:0000035: error: alignment (0) must be a power of 2
```
|
error: alignment (0) must be a power of 2
|
https://api.github.com/repos/WebAssembly/wabt/issues/1674/comments
| 0 |
2021-06-09T17:33:55Z
|
2021-08-06T16:53:04Z
|
https://github.com/WebAssembly/wabt/issues/1674
| 916,448,831 | 1,674 |
[
"WebAssembly",
"wabt"
] |
Tried out building on windows, using the instructions in README.md, and received compilation failures.
1. mkdir artifacts
2. cd artifacts
3. cmake ..
4. cmake --build . --config DEBUG --target install
Did I miss a step?
Result:
```
Build FAILED.
"C:\repos\oss\wabt\artifacts\install.vcxproj" (default target) (1) ->
"C:\repos\oss\wabt\artifacts\ALL_BUILD.vcxproj" (default target) (3) ->
"C:\repos\oss\wabt\artifacts\wasm.vcxproj" (default target) (7) ->
(ClCompile target) ->
c:\repos\oss\wabt\src\interp\interp-wasm-c-api.cc(17): fatal error C1083: Cannot open include file: 'wasm.h': No such
file or directory [C:\repos\oss\wabt\artifacts\wasm.vcxproj]
0 Warning(s)
1 Error(s)
```
|
Cannot open include file: 'wasm.h': No such file or directory
|
https://api.github.com/repos/WebAssembly/wabt/issues/1673/comments
| 1 |
2021-06-04T01:22:13Z
|
2021-06-04T01:24:39Z
|
https://github.com/WebAssembly/wabt/issues/1673
| 910,985,264 | 1,673 |
[
"WebAssembly",
"wabt"
] |
Hi all,
I'm trying to run the wasm-interp as WebAssembly runtime in my project.
I found a memory issue which is that the heap memory allocated through wasm-interp increases steadily without any drop.
Let me give you an example about function call,
https://github.com/WebAssembly/wabt/blob/63c350984f7dbe76f5963f4df819bfc375ea0217/src/interp/interp.cc#L344-L353
According to the above code, `Thread` object is newly created for each function call, but never deleted after calls.
In the end, these `Thread` objects will be accumulated terribly after frequent function calls.
It seems like that `Store::Collect()` is the only function that could reclaim the garbages, but this function is not explicitly called during the runtime.
I'm wondering that I should invoke `Store::Collect()` periodically or is there any other simple way to resolve this memory issue.
Thanks in advance!
|
memory management(gc) in wasm-interp
|
https://api.github.com/repos/WebAssembly/wabt/issues/1671/comments
| 1 |
2021-05-26T10:09:20Z
|
2022-02-09T06:40:44Z
|
https://github.com/WebAssembly/wabt/issues/1671
| 902,143,179 | 1,671 |
[
"WebAssembly",
"wabt"
] |
I'm getting new test failures with 1.0.23 on s390x running Fedora 34. The failing tests are:
```
- test/spec/simd/simd_load16_lane.txt
- test/spec/simd/simd_load32_lane.txt
- test/spec/simd/simd_load64_lane.txt
- test/spec/simd/simd_load8_lane.txt
- test/spec/simd/simd_store16_lane.txt
- test/spec/simd/simd_store32_lane.txt
- test/spec/simd/simd_store64_lane.txt
- test/spec/simd/simd_store8_lane.txt
```
Here's the log excerpt:
```
[...]
+ test/spec/simd/simd_i8x16_sat_arith.txt (0.022s)
- test/spec/simd/simd_load16_lane.txt
expected error code 0, got 8.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,75 @@
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 0 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 1 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 2 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 3 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 4 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 5 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 6 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in lane 7 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:105: mismatch in result 0 of assert_return: expected v128 i16:0i16:0i16:0i16:0i16:0i16:0i16:0i16:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x01000000
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 0 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 1 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 2 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 3 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 4 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 5 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 6 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in lane 7 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:126: mismatch in result 0 of assert_return: expected v128 i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055, got v128 i32x4:0x00000807 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 0 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 1 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 2 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 3 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 4 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 5 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 6 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in lane 7 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:129: mismatch in result 0 of assert_return: expected v128 i16:0i16:0i16:0i16:0i16:0i16:0i16:0i16:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x01000000
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 0 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 1 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 2 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 3 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 4 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 5 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 6 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in lane 7 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:143: mismatch in result 0 of assert_return: expected v128 i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055, got v128 i32x4:0x00000807 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 0 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 1 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 2 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 3 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 4 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 5 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 6 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in lane 7 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:145: mismatch in result 0 of assert_return: expected v128 i16:0i16:0i16:0i16:0i16:0i16:0i16:0i16:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x01000000
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 0 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 1 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 2 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 3 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 4 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 5 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 6 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in lane 7 of result 0 of assert_return: expected i16:0, got i16:256
+out/test/spec/simd/simd_load16_lane.wast:148: mismatch in result 0 of assert_return: expected v128 i16:0i16:0i16:0i16:0i16:0i16:0i16:0i16:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x01000000
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 0 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 1 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 2 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 3 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 4 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 5 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 6 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in lane 7 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:187: mismatch in result 0 of assert_return: expected v128 i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055, got v128 i32x4:0x00000807 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 0 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 1 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 2 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 3 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 4 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 5 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 6 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in lane 7 of result 0 of assert_return: expected i16:2055, got i16:0
+out/test/spec/simd/simd_load16_lane.wast:190: mismatch in result 0 of assert_return: expected v128 i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055i16:2055, got v128 i32x4:0x00000807 0x00000000 0x00000000 0x00000000
out/test/spec/simd/simd_load16_lane.wast:195: assert_invalid passed:
error: type mismatch in v128.load16_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdLoadLaneExpr callback failed
@@ -7,4 +79,4 @@
out/test/spec/simd/simd_load16_lane.wast:208: assert_invalid passed:
error: alignment must not be larger than natural alignment (2)
0000027: error: OnSimdLoadLaneExpr callback failed
-35/35 tests passed.
+27/35 tests passed.
+ test/spec/simd/simd_lane.txt (0.032s)
+ test/spec/simd/simd_load.txt (0.024s)
- test/spec/simd/simd_load32_lane.txt
expected error code 0, got 10.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,53 @@
+out/test/spec/simd/simd_load32_lane.wast:69: mismatch in lane 0 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:69: mismatch in lane 1 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:69: mismatch in lane 2 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:69: mismatch in lane 3 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:69: mismatch in result 0 of assert_return: expected v128 i32:0i32:0i32:0i32:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x03020100
+out/test/spec/simd/simd_load32_lane.wast:78: mismatch in lane 0 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:78: mismatch in lane 1 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:78: mismatch in lane 2 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:78: mismatch in lane 3 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:78: mismatch in result 0 of assert_return: expected v128 i32:100992003i32:100992003i32:100992003i32:100992003, got v128 i32x4:0x06050403 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load32_lane.wast:81: mismatch in lane 0 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:81: mismatch in lane 1 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:81: mismatch in lane 2 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:81: mismatch in lane 3 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:81: mismatch in result 0 of assert_return: expected v128 i32:0i32:0i32:0i32:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x03020100
+out/test/spec/simd/simd_load32_lane.wast:87: mismatch in lane 0 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:87: mismatch in lane 1 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:87: mismatch in lane 2 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:87: mismatch in lane 3 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:87: mismatch in result 0 of assert_return: expected v128 i32:100992003i32:100992003i32:100992003i32:100992003, got v128 i32x4:0x06050403 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load32_lane.wast:89: mismatch in lane 0 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:89: mismatch in lane 1 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:89: mismatch in lane 2 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:89: mismatch in lane 3 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:89: mismatch in result 0 of assert_return: expected v128 i32:0i32:0i32:0i32:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x03020100
+out/test/spec/simd/simd_load32_lane.wast:92: mismatch in lane 0 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:92: mismatch in lane 1 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:92: mismatch in lane 2 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:92: mismatch in lane 3 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:92: mismatch in result 0 of assert_return: expected v128 i32:0i32:0i32:0i32:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x03020100
+out/test/spec/simd/simd_load32_lane.wast:95: mismatch in lane 0 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:95: mismatch in lane 1 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:95: mismatch in lane 2 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:95: mismatch in lane 3 of result 0 of assert_return: expected i32:0, got i32:50462976
+out/test/spec/simd/simd_load32_lane.wast:95: mismatch in result 0 of assert_return: expected v128 i32:0i32:0i32:0i32:0, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x03020100
+out/test/spec/simd/simd_load32_lane.wast:116: mismatch in lane 0 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:116: mismatch in lane 1 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:116: mismatch in lane 2 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:116: mismatch in lane 3 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:116: mismatch in result 0 of assert_return: expected v128 i32:100992003i32:100992003i32:100992003i32:100992003, got v128 i32x4:0x06050403 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load32_lane.wast:119: mismatch in lane 0 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:119: mismatch in lane 1 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:119: mismatch in lane 2 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:119: mismatch in lane 3 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:119: mismatch in result 0 of assert_return: expected v128 i32:100992003i32:100992003i32:100992003i32:100992003, got v128 i32x4:0x06050403 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load32_lane.wast:122: mismatch in lane 0 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:122: mismatch in lane 1 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:122: mismatch in lane 2 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:122: mismatch in lane 3 of result 0 of assert_return: expected i32:100992003, got i32:0
+out/test/spec/simd/simd_load32_lane.wast:122: mismatch in result 0 of assert_return: expected v128 i32:100992003i32:100992003i32:100992003i32:100992003, got v128 i32x4:0x06050403 0x00000000 0x00000000 0x00000000
out/test/spec/simd/simd_load32_lane.wast:127: assert_invalid passed:
error: type mismatch in v128.load32_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdLoadLaneExpr callback failed
@@ -7,4 +57,4 @@
out/test/spec/simd/simd_load32_lane.wast:140: assert_invalid passed:
error: alignment must not be larger than natural alignment (4)
0000027: error: OnSimdLoadLaneExpr callback failed
-23/23 tests passed.
+13/23 tests passed.
- test/spec/simd/simd_load64_lane.txt
expected error code 0, got 12.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,39 @@
+out/test/spec/simd/simd_load64_lane.wast:45: mismatch in lane 0 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:45: mismatch in lane 1 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:45: mismatch in result 0 of assert_return: expected v128 i64:0i64:0, got v128 i32x4:0x00000000 0x00000000 0x03020100 0x07060504
+out/test/spec/simd/simd_load64_lane.wast:48: mismatch in lane 0 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:48: mismatch in lane 1 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:48: mismatch in result 0 of assert_return: expected v128 i64:578437695752307201i64:578437695752307201, got v128 i32x4:0x04030201 0x08070605 0x00000000 0x00000000
+out/test/spec/simd/simd_load64_lane.wast:51: mismatch in lane 0 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:51: mismatch in lane 1 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:51: mismatch in result 0 of assert_return: expected v128 i64:0i64:0, got v128 i32x4:0x00000000 0x00000000 0x03020100 0x07060504
+out/test/spec/simd/simd_load64_lane.wast:53: mismatch in lane 0 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:53: mismatch in lane 1 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:53: mismatch in result 0 of assert_return: expected v128 i64:578437695752307201i64:578437695752307201, got v128 i32x4:0x04030201 0x08070605 0x00000000 0x00000000
+out/test/spec/simd/simd_load64_lane.wast:55: mismatch in lane 0 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:55: mismatch in lane 1 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:55: mismatch in result 0 of assert_return: expected v128 i64:0i64:0, got v128 i32x4:0x00000000 0x00000000 0x03020100 0x07060504
+out/test/spec/simd/simd_load64_lane.wast:58: mismatch in lane 0 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:58: mismatch in lane 1 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:58: mismatch in result 0 of assert_return: expected v128 i64:0i64:0, got v128 i32x4:0x00000000 0x00000000 0x03020100 0x07060504
+out/test/spec/simd/simd_load64_lane.wast:61: mismatch in lane 0 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:61: mismatch in lane 1 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:61: mismatch in result 0 of assert_return: expected v128 i64:0i64:0, got v128 i32x4:0x00000000 0x00000000 0x03020100 0x07060504
+out/test/spec/simd/simd_load64_lane.wast:64: mismatch in lane 0 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:64: mismatch in lane 1 of result 0 of assert_return: expected i64:0, got i64:506097522914230528
+out/test/spec/simd/simd_load64_lane.wast:64: mismatch in result 0 of assert_return: expected v128 i64:0i64:0, got v128 i32x4:0x00000000 0x00000000 0x03020100 0x07060504
+out/test/spec/simd/simd_load64_lane.wast:67: mismatch in lane 0 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:67: mismatch in lane 1 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:67: mismatch in result 0 of assert_return: expected v128 i64:578437695752307201i64:578437695752307201, got v128 i32x4:0x04030201 0x08070605 0x00000000 0x00000000
+out/test/spec/simd/simd_load64_lane.wast:70: mismatch in lane 0 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:70: mismatch in lane 1 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:70: mismatch in result 0 of assert_return: expected v128 i64:578437695752307201i64:578437695752307201, got v128 i32x4:0x04030201 0x08070605 0x00000000 0x00000000
+out/test/spec/simd/simd_load64_lane.wast:73: mismatch in lane 0 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:73: mismatch in lane 1 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:73: mismatch in result 0 of assert_return: expected v128 i64:578437695752307201i64:578437695752307201, got v128 i32x4:0x04030201 0x08070605 0x00000000 0x00000000
+out/test/spec/simd/simd_load64_lane.wast:76: mismatch in lane 0 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:76: mismatch in lane 1 of result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_load64_lane.wast:76: mismatch in result 0 of assert_return: expected v128 i64:578437695752307201i64:578437695752307201, got v128 i32x4:0x04030201 0x08070605 0x00000000 0x00000000
out/test/spec/simd/simd_load64_lane.wast:81: assert_invalid passed:
error: type mismatch in v128.load64_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdLoadLaneExpr callback failed
@@ -7,4 +43,4 @@
out/test/spec/simd/simd_load64_lane.wast:94: assert_invalid passed:
error: alignment must not be larger than natural alignment (8)
0000027: error: OnSimdLoadLaneExpr callback failed
-15/15 tests passed.
+3/15 tests passed.
- test/spec/simd/simd_load8_lane.txt
expected error code 0, got 3.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,54 @@
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 0 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 1 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 2 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 3 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 4 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 5 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 6 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 7 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 8 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 9 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 10 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 11 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 12 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 13 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 14 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in lane 15 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:198: mismatch in result 0 of assert_return: expected v128 i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15, got v128 i32x4:0x0000000f 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 0 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 1 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 2 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 3 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 4 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 5 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 6 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 7 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 8 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 9 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 10 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 11 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 12 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 13 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 14 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in lane 15 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:231: mismatch in result 0 of assert_return: expected v128 i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15, got v128 i32x4:0x0000000f 0x00000000 0x00000000 0x00000000
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 0 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 1 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 2 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 3 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 4 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 5 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 6 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 7 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 8 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 9 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 10 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 11 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 12 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 13 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 14 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in lane 15 of result 0 of assert_return: expected i8:15, got i8:0
+out/test/spec/simd/simd_load8_lane.wast:278: mismatch in result 0 of assert_return: expected v128 i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15i8:15, got v128 i32x4:0x0000000f 0x00000000 0x00000000 0x00000000
out/test/spec/simd/simd_load8_lane.wast:283: assert_invalid passed:
error: type mismatch in v128.load8_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdLoadLaneExpr callback failed
@@ -7,4 +58,4 @@
out/test/spec/simd/simd_load8_lane.wast:296: assert_invalid passed:
error: alignment must not be larger than natural alignment (1)
0000027: error: OnSimdLoadLaneExpr callback failed
-51/51 tests passed.
+48/51 tests passed.
+ test/spec/simd/simd_load_extend.txt (0.015s)
+ test/spec/simd/simd_load_splat.txt (0.015s)
+ test/spec/simd/simd_load_zero.txt (0.016s)
+ test/spec/simd/simd_splat.txt (0.021s)
+ test/spec/simd/simd_store.txt (0.016s)
- test/spec/simd/simd_store16_lane.txt
expected error code 0, got 32.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,35 @@
+out/test/spec/simd/simd_store16_lane.wast:193: mismatch in result 0 of assert_return: expected i64:256, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:196: mismatch in result 0 of assert_return: expected i64:513, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:199: mismatch in result 0 of assert_return: expected i64:770, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:202: mismatch in result 0 of assert_return: expected i64:1027, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:205: mismatch in result 0 of assert_return: expected i64:1284, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:208: mismatch in result 0 of assert_return: expected i64:1541, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:211: mismatch in result 0 of assert_return: expected i64:1798, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:214: mismatch in result 0 of assert_return: expected i64:2055, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:217: mismatch in result 0 of assert_return: expected i64:256, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:219: mismatch in result 0 of assert_return: expected i64:513, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:221: mismatch in result 0 of assert_return: expected i64:770, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:223: mismatch in result 0 of assert_return: expected i64:1027, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:225: mismatch in result 0 of assert_return: expected i64:1284, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:227: mismatch in result 0 of assert_return: expected i64:1541, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:229: mismatch in result 0 of assert_return: expected i64:1798, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:231: mismatch in result 0 of assert_return: expected i64:2055, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:233: mismatch in result 0 of assert_return: expected i64:256, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:236: mismatch in result 0 of assert_return: expected i64:256, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:239: mismatch in result 0 of assert_return: expected i64:513, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:242: mismatch in result 0 of assert_return: expected i64:513, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:245: mismatch in result 0 of assert_return: expected i64:770, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:248: mismatch in result 0 of assert_return: expected i64:770, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:251: mismatch in result 0 of assert_return: expected i64:1027, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:254: mismatch in result 0 of assert_return: expected i64:1027, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:257: mismatch in result 0 of assert_return: expected i64:1284, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:260: mismatch in result 0 of assert_return: expected i64:1284, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:263: mismatch in result 0 of assert_return: expected i64:1541, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:266: mismatch in result 0 of assert_return: expected i64:1541, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:269: mismatch in result 0 of assert_return: expected i64:1798, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:272: mismatch in result 0 of assert_return: expected i64:1798, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:275: mismatch in result 0 of assert_return: expected i64:2055, got i64:0
+out/test/spec/simd/simd_store16_lane.wast:278: mismatch in result 0 of assert_return: expected i64:2055, got i64:0
out/test/spec/simd/simd_store16_lane.wast:283: assert_invalid passed:
error: type mismatch in v128.store16_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdStoreLaneExpr callback failed
@@ -7,4 +39,4 @@
out/test/spec/simd/simd_store16_lane.wast:296: assert_invalid passed:
error: alignment must not be larger than natural alignment (2)
0000027: error: OnSimdStoreLaneExpr callback failed
-35/35 tests passed.
+3/35 tests passed.
- test/spec/simd/simd_store32_lane.txt
expected error code 0, got 20.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,23 @@
+out/test/spec/simd/simd_store32_lane.wast:125: mismatch in result 0 of assert_return: expected i64:50462976, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:128: mismatch in result 0 of assert_return: expected i64:67305985, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:131: mismatch in result 0 of assert_return: expected i64:84148994, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:134: mismatch in result 0 of assert_return: expected i64:100992003, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:137: mismatch in result 0 of assert_return: expected i64:50462976, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:139: mismatch in result 0 of assert_return: expected i64:67305985, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:141: mismatch in result 0 of assert_return: expected i64:84148994, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:143: mismatch in result 0 of assert_return: expected i64:100992003, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:145: mismatch in result 0 of assert_return: expected i64:50462976, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:148: mismatch in result 0 of assert_return: expected i64:50462976, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:151: mismatch in result 0 of assert_return: expected i64:50462976, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:154: mismatch in result 0 of assert_return: expected i64:67305985, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:157: mismatch in result 0 of assert_return: expected i64:67305985, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:160: mismatch in result 0 of assert_return: expected i64:67305985, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:163: mismatch in result 0 of assert_return: expected i64:84148994, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:166: mismatch in result 0 of assert_return: expected i64:84148994, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:169: mismatch in result 0 of assert_return: expected i64:84148994, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:172: mismatch in result 0 of assert_return: expected i64:100992003, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:175: mismatch in result 0 of assert_return: expected i64:100992003, got i64:0
+out/test/spec/simd/simd_store32_lane.wast:178: mismatch in result 0 of assert_return: expected i64:100992003, got i64:0
out/test/spec/simd/simd_store32_lane.wast:183: assert_invalid passed:
error: type mismatch in v128.store32_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdStoreLaneExpr callback failed
@@ -7,4 +27,4 @@
out/test/spec/simd/simd_store32_lane.wast:196: assert_invalid passed:
error: alignment must not be larger than natural alignment (4)
0000027: error: OnSimdStoreLaneExpr callback failed
-23/23 tests passed.
+3/23 tests passed.
- test/spec/simd/simd_store64_lane.txt
expected error code 0, got 12.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,15 @@
+out/test/spec/simd/simd_store64_lane.wast:79: mismatch in result 0 of assert_return: expected i64:506097522914230528, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:82: mismatch in result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:85: mismatch in result 0 of assert_return: expected i64:506097522914230528, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:87: mismatch in result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:89: mismatch in result 0 of assert_return: expected i64:506097522914230528, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:92: mismatch in result 0 of assert_return: expected i64:506097522914230528, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:95: mismatch in result 0 of assert_return: expected i64:506097522914230528, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:98: mismatch in result 0 of assert_return: expected i64:506097522914230528, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:101: mismatch in result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:104: mismatch in result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:107: mismatch in result 0 of assert_return: expected i64:578437695752307201, got i64:0
+out/test/spec/simd/simd_store64_lane.wast:110: mismatch in result 0 of assert_return: expected i64:578437695752307201, got i64:0
out/test/spec/simd/simd_store64_lane.wast:115: assert_invalid passed:
error: type mismatch in v128.store64_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdStoreLaneExpr callback failed
@@ -7,4 +19,4 @@
out/test/spec/simd/simd_store64_lane.wast:128: assert_invalid passed:
error: alignment must not be larger than natural alignment (8)
0000027: error: OnSimdStoreLaneExpr callback failed
-15/15 tests passed.
+3/15 tests passed.
- test/spec/simd/simd_store8_lane.txt
expected error code 0, got 45.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1,3 +1,48 @@
+out/test/spec/simd/simd_store8_lane.wast:284: mismatch in result 0 of assert_return: expected i64:1, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:287: mismatch in result 0 of assert_return: expected i64:2, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:290: mismatch in result 0 of assert_return: expected i64:3, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:293: mismatch in result 0 of assert_return: expected i64:4, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:296: mismatch in result 0 of assert_return: expected i64:5, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:299: mismatch in result 0 of assert_return: expected i64:6, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:302: mismatch in result 0 of assert_return: expected i64:7, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:305: mismatch in result 0 of assert_return: expected i64:8, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:308: mismatch in result 0 of assert_return: expected i64:9, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:311: mismatch in result 0 of assert_return: expected i64:10, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:314: mismatch in result 0 of assert_return: expected i64:11, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:317: mismatch in result 0 of assert_return: expected i64:12, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:320: mismatch in result 0 of assert_return: expected i64:13, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:323: mismatch in result 0 of assert_return: expected i64:14, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:326: mismatch in result 0 of assert_return: expected i64:15, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:331: mismatch in result 0 of assert_return: expected i64:1, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:333: mismatch in result 0 of assert_return: expected i64:2, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:335: mismatch in result 0 of assert_return: expected i64:3, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:337: mismatch in result 0 of assert_return: expected i64:4, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:339: mismatch in result 0 of assert_return: expected i64:5, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:341: mismatch in result 0 of assert_return: expected i64:6, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:343: mismatch in result 0 of assert_return: expected i64:7, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:345: mismatch in result 0 of assert_return: expected i64:8, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:347: mismatch in result 0 of assert_return: expected i64:9, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:349: mismatch in result 0 of assert_return: expected i64:10, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:351: mismatch in result 0 of assert_return: expected i64:11, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:353: mismatch in result 0 of assert_return: expected i64:12, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:355: mismatch in result 0 of assert_return: expected i64:13, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:357: mismatch in result 0 of assert_return: expected i64:14, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:359: mismatch in result 0 of assert_return: expected i64:15, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:364: mismatch in result 0 of assert_return: expected i64:1, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:367: mismatch in result 0 of assert_return: expected i64:2, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:370: mismatch in result 0 of assert_return: expected i64:3, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:373: mismatch in result 0 of assert_return: expected i64:4, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:376: mismatch in result 0 of assert_return: expected i64:5, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:379: mismatch in result 0 of assert_return: expected i64:6, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:382: mismatch in result 0 of assert_return: expected i64:7, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:385: mismatch in result 0 of assert_return: expected i64:8, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:388: mismatch in result 0 of assert_return: expected i64:9, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:391: mismatch in result 0 of assert_return: expected i64:10, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:394: mismatch in result 0 of assert_return: expected i64:11, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:397: mismatch in result 0 of assert_return: expected i64:12, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:400: mismatch in result 0 of assert_return: expected i64:13, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:403: mismatch in result 0 of assert_return: expected i64:14, got i64:0
+out/test/spec/simd/simd_store8_lane.wast:406: mismatch in result 0 of assert_return: expected i64:15, got i64:0
out/test/spec/simd/simd_store8_lane.wast:411: assert_invalid passed:
error: type mismatch in v128.store8_lane, expected [i32, v128] but got [v128, i32]
0000027: error: OnSimdStoreLaneExpr callback failed
@@ -7,4 +52,4 @@
out/test/spec/simd/simd_store8_lane.wast:424: assert_invalid passed:
error: alignment must not be larger than natural alignment (1)
0000027: error: OnSimdStoreLaneExpr callback failed
-51/51 tests passed.
+6/51 tests passed.
[...]
```
|
test failures on s390x
|
https://api.github.com/repos/WebAssembly/wabt/issues/1670/comments
| 5 |
2021-05-14T13:17:24Z
|
2021-08-09T17:55:50Z
|
https://github.com/WebAssembly/wabt/issues/1670
| 891,915,510 | 1,670 |
[
"WebAssembly",
"wabt"
] |
`wasm2c` uses `_t` *everywhere*, which is reserved by POSIX and should not be used. It'd be nice to fix this at some point, altho it is a breaking change.
|
POSIX reserved names: *_t is reserved by POSIX
|
https://api.github.com/repos/WebAssembly/wabt/issues/1668/comments
| 0 |
2021-05-06T10:59:24Z
|
2021-05-06T10:59:24Z
|
https://github.com/WebAssembly/wabt/issues/1668
| 877,373,537 | 1,668 |
[
"WebAssembly",
"wabt"
] |
### enviroment
- windows with release 1.0.23
- placed the Dynlib.dll and the wasm2c file with same directory
- kali is the same
### command && report
`.\wasm2c.exe easywasm.wasm -o ret.c
0000018: error: unable to read u32 leb128: needed_dynlibs`
|
unable to read u32 leb128
|
https://api.github.com/repos/WebAssembly/wabt/issues/1667/comments
| 3 |
2021-05-01T12:42:15Z
|
2023-02-13T10:14:17Z
|
https://github.com/WebAssembly/wabt/issues/1667
| 873,662,885 | 1,667 |
[
"WebAssembly",
"wabt"
] |
Check the attached example. For some reason `wasm-decompile` produces multiple identical declarations for the same variables:
```
var b:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var d:int;
var d:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var d:int;
var b:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var e:int;
var f:int;
var g:int;
var h:int;
var i:int;
var j:int;
var k:int;
var l:int;
var m:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var d:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var e:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var f:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var g:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var h:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var i:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var j:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var k:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var l:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var m:int;
var c:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
var b:{ a:int, b:int, c:int, d:int, e:int, f:int, g:int, h:int, i:int, j:int, k:int, l:int }
```
Is it possible to dedupe them for cleaner output? cc @aardappel
[temp.async.zip](https://github.com/WebAssembly/wabt/files/6364830/temp.async.zip)
|
[wasm-decompile] Same variable declaration gets emitted multiple times
|
https://api.github.com/repos/WebAssembly/wabt/issues/1665/comments
| 3 |
2021-04-23T11:17:01Z
|
2021-04-26T23:14:25Z
|
https://github.com/WebAssembly/wabt/issues/1665
| 866,013,812 | 1,665 |
[
"WebAssembly",
"wabt"
] |
When compiling the text format, it would be useful to have a flag that causes any passive segments to be indexed ahead of any active segments, but otherwise in their lexical order.
Unfortunately, bulk-memory operations have already been standardized, and this feature would be a breaking change if applied everywhere, but it could be opt-in at the compiler level without any issues.
Active segments are only used to *prime* memories and tables (the data is copied, then dropped, and not available at runtime). Passive segments are conceptually different, and function more like little ROMs or *banks*. They are conceptually *components* of the module (like registers, functions, memories and tables are), with an index, optional identifier and special instructions so we can interact with them at runtime.
Ordering the passive segments ahead of any active segments, means that the indices for the components we actually interact with at runtime will be zero-indexed, and will increment properly (memory and table segments have their own indexspaces).
Conceptually then, the *memory banks* and *table banks* will each be intuitively indexed, and the indices of any memory or table *primers* are irrelevant to users of the text format.
[1]: https://github.com/WebAssembly/bulk-memory-operations/issues/159
|
[wat2wasm] Add a flag for indexing passive segments before active segments.
|
https://api.github.com/repos/WebAssembly/wabt/issues/1663/comments
| 3 |
2021-04-18T17:10:27Z
|
2021-06-04T02:10:03Z
|
https://github.com/WebAssembly/wabt/issues/1663
| 860,713,943 | 1,663 |
[
"WebAssembly",
"wabt"
] |
Is there any documentation on how to read the wasm-interp trace output? I can intuitively understand some of it, but most of the output is ambigous to me. For instance I was debugging an issue:
```
>>> running export "bench":
#0. 0: V:0 | alloca 4
#0. 8: V:4 | global.get $0
#0. 16: V:5 | i32.const 32
#0. 24: V:6 | i32.sub 16, 32
#0. 28: V:5 | local.set $5, 4294967280
#0. 36: V:4 | i32.const 0
#0. 44: V:5 | local.set $4, 0
#0. 52: V:4 | local.get $3
#0. 60: V:5 | i32.const 4
#0. 68: V:6 | i32.eq 0, 4
#0. 72: V:5 | br_unless @88, 0
#0. 88: V:4 | local.get $4
#0. 96: V:5 | i32.const 28
#0. 104: V:6 | i32.add 4294967280, 28
#0. 108: V:5 | local.get $4
#0. 116: V:6 | i32.add 12, 0
#0. 120: V:5 | i32.const 0
#0. 128: V:6 | i32.store $0:12+$0, 0
#0. 140: V:4 | local.get $3
#0. 148: V:5 | i32.const 4
#0. 156: V:6 | i32.add 0, 4
#0. 160: V:5 | local.set $4, 4
#0. 168: V:4 | br @52
#0. 52: V:4 | local.get $3
#0. 60: V:5 | i32.const 4
#0. 68: V:6 | i32.eq 4, 4
#0. 72: V:5 | br_unless @88, 1
#0. 80: V:4 | br @176
#0. 176: V:4 | i32.const 0
#0. 184: V:5 | local.set $4, 0
#0. 192: V:4 | local.get $4
#0. 200: V:5 | i32.load $0:4294967280+$28
bench() => error: out of bounds memory access: access at 4294967308+4 >= max value 65536
```
I don't know what the first value `#0` is, or what the second column values (0, 8, 16...) are, what `V:5` stays for and so on. I can imagine it is obvious for most of you who closely work on Wasm compilers/interpreters, but for a non-expert a little help would be valuable.
My guess would be that the first column is the call stack depth maybe? The column column is the value stack size, the `V: x` is the value at the top of the value stack depth, and then finally the instruction where the implicit operands taken from the top of the stack are made explicit.
|
Document wasm-interp trace output
|
https://api.github.com/repos/WebAssembly/wabt/issues/1662/comments
| 0 |
2021-04-11T15:26:58Z
|
2021-04-11T15:28:22Z
|
https://github.com/WebAssembly/wabt/issues/1662
| 855,334,648 | 1,662 |
[
"WebAssembly",
"wabt"
] |
I'm writing a compiler that targets Wasm by generating .wat files, and then compiling those using wat2wasm. However, there are some parts of the runtime that I'd like to write using another language, such as C (or Rust), rather than having to hand-craft .wat files. It seems as though a potential route is to compile the .wat files using `wat2wasm --relocatable`, and to compile the C files to Wasm object files using Clang/LLVM, and then to link them together with `wasm-ld`.
Is there a guide describing how to do this? For instance, it'd be useful to have information on things like how to import functions from other modules, or have relocatable data (which doesn't seem possible at the moment since data can only be referenced by index rather than an identifier?)
So far, I've mostly pulled together information from:
* following [Compiling C to WebAssembly without Emscripten ](https://surma.dev/things/c-to-webassembly/) and then disassembling what Clang/LLVM produces
* issue #1199: wat2wasm fails with call_indirect and relocation
Also, I realise this might not be the right place to ask, but I couldn't find an appropriate mailing list, forum or other community where this sort of thing can be discussed. Any pointers in that direction would be much appreciated!
|
Guide for creating object files using wat2wasm
|
https://api.github.com/repos/WebAssembly/wabt/issues/1658/comments
| 13 |
2021-04-06T08:18:54Z
|
2021-04-20T20:56:09Z
|
https://github.com/WebAssembly/wabt/issues/1658
| 851,163,683 | 1,658 |
[
"WebAssembly",
"wabt"
] |
This may be another LLVM problem; if so, sorry for the noise. However, if nothing else I think the error message could probably be improved.
Using emscripten tot:
```
$ cat i64x2_eq.c
typedef __INT64_TYPE__ i64x2 __attribute__((__vector_size__(16)));
i64x2 eq(i64x2 a, i64x2 b) {
return __builtin_wasm_eq_i64x2(a, b);
}
$ emcc -O3 -msimd128 -c -o i64x2_eq.wasm i64x2_eq.c
$ wasm-dis i64x2_eq.wasm
warning: linking section is present, so this is not a standard wasm file - binaryen cannot handle this properly!
(module
(type $v128_v128_=>_v128 (func (param v128 v128) (result v128)))
(import "env" "__linear_memory" (memory $mimport$0 0))
(func $0 (param $0 v128) (param $1 v128) (result v128)
(i64x2.eq
(local.get $0)
(local.get $1)
)
)
;; custom section "linking", size 14
;; custom section "producers", size 157
;; features section: simd
)
$ ~/local/src/wabt/build/wasm2wat --enable-simd i64x2_eq.wasm
i64x2_eq.wasm:000004b: error: type mismatch in function, expected [] but got [v128]
```
I've attached [a gzipped i64x2_eq.wasm](https://github.com/WebAssembly/wabt/files/6222328/i64x2_eq.wasm.gz)
|
[SIMD] wasm2wat "error: type mismatch in function, expected [] but got [v128]" from i64x2.eq
|
https://api.github.com/repos/WebAssembly/wabt/issues/1655/comments
| 4 |
2021-03-29T14:23:32Z
|
2021-08-05T23:32:44Z
|
https://github.com/WebAssembly/wabt/issues/1655
| 843,423,230 | 1,655 |
[
"WebAssembly",
"wabt"
] |
With emscripten tot and this code:
```c
typedef char i8x16 __attribute__((__vector_size__(16)));
i8x16 popcnt(i8x16 v) {
return __builtin_wasm_popcnt_i8x16(v);
}
```
wasm2wat thinks the popcnt instruction is an `i16x8.extadd_pairwise`
```
$ emcc -O3 -msimd128 -c -o popcnt.wasm popcnt.c && wasm2wat --enable-simd popcnt.wasm
(module
(type (;0;) (func (param v128) (result v128)))
(import "env" "__linear_memory" (memory (;0;) 0))
(func $popcnt (type 0) (param v128) (result v128)
local.get 0
i16x8.extadd_pairwise_i8x16_s))
```
I've attached [a gzipped copy of popcnt.wasm](https://github.com/WebAssembly/wabt/files/6198473/popcnt.wasm.gz)
wasm-dis produces the expected output:
```wasm
(module
(type $v128_=>_v128 (func (param v128) (result v128)))
(import "env" "__linear_memory" (memory $mimport$0 0))
(func $0 (param $0 v128) (result v128)
(i8x16.popcnt
(local.get $0)
)
)
;; custom section "linking", size 18
;; custom section "producers", size 157
;; features section: simd
)
```
It's possible the issue is on the LLVM side, if so sorry for the noise. Just let me know and I'll report it there instead.
|
[SIMD] wasm2wat outputs incorrect instruction for i8x16.popcount
|
https://api.github.com/repos/WebAssembly/wabt/issues/1653/comments
| 7 |
2021-03-24T15:43:06Z
|
2021-03-30T15:28:30Z
|
https://github.com/WebAssembly/wabt/issues/1653
| 839,860,509 | 1,653 |
[
"WebAssembly",
"wabt"
] |
### Test Case
```wat
;; test.wat
(module
(table (;0;) 102 102 funcref)
(elem (;0;) (i32.const 1) func))
```
### Steps to Reproduce
```shell
$ wat2wasm test.wat -o test.wasm
$ wasm2wat --generate-names test.wasm -o with-names.wat
$ wat2wasm with-names.wat -o with-names.wasm
with-names.wat:3:4: error: undefined table variable "$e0"
(elem $e0 (i32.const 1) func))
^^^^
```
### Expected Results
The Wasm file is round trippable through `wasm2wat --generate-names` without any errors.
### Actual Results
`wasm2wat --generate-names` produces invalid element segment names (I think they are in the place where the table name belongs?)
|
`wasm2wat --generate-names` produces invalid names
|
https://api.github.com/repos/WebAssembly/wabt/issues/1651/comments
| 5 |
2021-03-23T23:29:30Z
|
2023-03-01T00:30:44Z
|
https://github.com/WebAssembly/wabt/issues/1651
| 839,204,399 | 1,651 |
[
"WebAssembly",
"wabt"
] |
I suspect this is a known issue, but recording it here:
emcc will allow you to compile with `-pthread`, and generate nice wrapper callers for POSIX pthread calls. I'd expect that invoking with `--wasi --enable-threads` would allow wasm code of this form to load and run, but it fails at load time with `wasi error: unknown module import: env`
Looking at the wasm2wat output for my code I see only two symbols in env:
(import "env" "pthread_create" (func $pthread_create (type 7)))
(import "env" "pthread_join" (func $pthread_join (type 1)))
I presume this is a known-ish issue due to the current incomplete status of wasi support? Just wanted to note it down here for reference (and in case someone else encounters it).
|
wasm-interp --wasi --enable-threads can't handle emcc's pthread support
|
https://api.github.com/repos/WebAssembly/wabt/issues/1645/comments
| 5 |
2021-03-17T17:37:23Z
|
2021-03-17T20:40:46Z
|
https://github.com/WebAssembly/wabt/issues/1645
| 834,026,568 | 1,645 |
[
"WebAssembly",
"wabt"
] |
Uploaded a test case:
[wasm-objdump-fails.txt](https://github.com/WebAssembly/wabt/files/6110933/wasm-objdump-fails.txt)
```
$ wasm-objdump -d wasm-objdump-fails.txt
clusterfuzz-testcase-minimized-v8_wasm_async_fuzzer-5664681130524672: file format wasm 0x1
Code Disassembly:
00002d func[0] <main>:
00002e: 03 7e | local[0..2] type=i64
000030: 20 00 | local.get 0
000032: 41 d6 49 | i32.const 4294960342
000035: 02 7f | block i32
000037: 41 fe 20 | i32.const 4222
00003a: 0c 00 | br 0
00003c: 68 | i32.ctz
00003d: fc 0e 00 00 | table.copy 0 0
000041: 0b | end
000042: 20 00 | local.get 0
000044: 68 | i32.ctz
000045: fc 10 00 | table.size 0
000048: 68 | i32.ctz
warning: 0x4d missing opcode callback at 0x4a (0xfc=<invalid>)
```
wasm2wat works
```
$ wasm2wat wasm-objdump-fails.txt --enable-all
(module
(type (;0;) (func (result i32)))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 1) (param i32) (result i32)
(local i64 i64 i64)
local.get 0
i32.const -6954
block (result i32) ;; label = @1
i32.const 4222
br 0 (;@1;)
i32.ctz
table.copy
end
local.get 0
i32.ctz
table.size 0
i32.ctz
table.size 0
unreachable
table.set 0)
(table (;0;) 1 9 funcref)
(export "main" (func 0)))
```
The problematic input is the second `table.size 0` instruction, it is encoded as `fc 90 80 00 00`, the opcode is 4 bytes, the canonical binary should be simply `fc 16`.
I think this is failing because https://github.com/WebAssembly/wabt/blob/master/src/binary-reader-objdump.cc#L511 calls GetLength, which writes the canonical encoding in https://github.com/WebAssembly/wabt/blob/master/src/opcode.cc#L374 then count the bytes.
|
wasm-objdump cannot handle prefixed instructions with non-canonical leb128 opcodes
|
https://api.github.com/repos/WebAssembly/wabt/issues/1631/comments
| 2 |
2021-03-09T19:32:52Z
|
2023-02-13T10:16:47Z
|
https://github.com/WebAssembly/wabt/issues/1631
| 826,519,038 | 1,631 |
[
"WebAssembly",
"wabt"
] |
Various compilation errors prevent compilation on 32-bit targets (e.g., x86-32). Sure would be handy to be able to build and use this tool on those systems.
|
Compilation is broken for 32-bit targets for WITH_WASI=ON
|
https://api.github.com/repos/WebAssembly/wabt/issues/1629/comments
| 13 |
2021-03-06T00:40:56Z
|
2021-03-11T18:59:56Z
|
https://github.com/WebAssembly/wabt/issues/1629
| 823,514,373 | 1,629 |
[
"WebAssembly",
"wabt"
] |
At recent top-of-tree, building with `-DWITH_WASI=ON` fails, with many errors of the form
```
_deps/wabt-src/src/interp/interp-wasi.cc:255:35: error: 'i32_' is a private member of 'wabt::interp::Value'
```
Is WITH_WASI (still) supported?
|
WITH_WASI=ON is broken
|
https://api.github.com/repos/WebAssembly/wabt/issues/1627/comments
| 0 |
2021-03-05T22:38:34Z
|
2021-03-06T00:39:11Z
|
https://github.com/WebAssembly/wabt/issues/1627
| 823,469,354 | 1,627 |
[
"WebAssembly",
"wabt"
] |
See [this spec test](https://github.com/WebAssembly/spec/pull/1293), it passes reference interpreter and it fails on WABT 1.0.21:
```
../imports.wast:574: error instantiating module: "actual size (1) smaller than declared (2)"
../imports.wast:579: unknown module in register
../imports.wast:580: unknown invoke "$Mgim1.grow"
../imports.wast:580: result length mismatch in assert_return: expected 1, got 0
../imports.wast:581: error instantiating module: "invalid import "grown-imported-memory.memory""
../imports.wast:586: unknown invoke "$Mgim2.size"
../imports.wast:586: result length mismatch in assert_return: expected 1, got 0
```
|
Incorrect min limit of exported memory after grow
|
https://api.github.com/repos/WebAssembly/wabt/issues/1626/comments
| 1 |
2021-03-05T10:41:10Z
|
2022-09-18T05:54:11Z
|
https://github.com/WebAssembly/wabt/issues/1626
| 822,965,063 | 1,626 |
[
"WebAssembly",
"wabt"
] |
Seeing the following error when compiling macOS. It appears the `MAP_ANONYMOUS` flag may not be defined, but perhaps [`MAP_ANON`]( https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/mmap.2.html ) would be a good substitute
```
../wasm2c/wasm-rt-impl.c:133:58: error: use of undeclared identifier 'MAP_ANONYMOUS'
mmap(NULL, 0x200000000ul, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
^
1 error generated.
```
|
MAP_ANONYMOUS undefined on OS X 10.10 and earlier (pre-2015)
|
https://api.github.com/repos/WebAssembly/wabt/issues/1620/comments
| 9 |
2021-03-03T07:16:10Z
|
2023-02-13T10:16:18Z
|
https://github.com/WebAssembly/wabt/issues/1620
| 820,826,223 | 1,620 |
[
"WebAssembly",
"wabt"
] |
In trying to build wabt 1.0.21 ran into the following compilation error:
```
../src/interp/interp-wasm-c-api.cc:17:10: fatal error: wasm.h: No such file or directory
17 | #include <wasm.h>
| ^~~~~~~~
compilation terminated.
```
More details can be found in PR ( https://github.com/conda-forge/wabt-feedstock/pull/19 ) along with CI logs
Did something change recently?
|
Missing wasm.h?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1619/comments
| 3 |
2021-03-02T21:37:18Z
|
2021-03-03T15:41:11Z
|
https://github.com/WebAssembly/wabt/issues/1619
| 820,411,401 | 1,619 |
[
"WebAssembly",
"wabt"
] |
Is there work underway to bring the WABT interpreter in line with the final proposal for the wasm-simd128 spec? If so, is there any rough ETA? If not, is this work scheduled to be done? (Or has it already been done and I somehow missed it?)
Halide currently uses the WABT interpreter for a fair number of our correctness tests (where performance is unimportant), and simd support is pretty crucial for most Halide users.
|
Support for final wasm-simd128 specin the wabt interpreter?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1617/comments
| 9 |
2021-03-01T18:27:55Z
|
2022-09-18T05:23:32Z
|
https://github.com/WebAssembly/wabt/issues/1617
| 819,134,114 | 1,617 |
[
"WebAssembly",
"wabt"
] |
given the input
```c
int square(int a) {
if(a < 5) return 42;
return a*a;
}
```
`clang --target=wasm32 -Os -c square.c -S` produces a flat assembly file square.s with the following contents:
```asm
.text
.file "square.c"
.section .text.square,"",@
.hidden square # -- Begin function square
.globl square
.type square,@function
square: # @square
.functype square (i32) -> (i32)
# %bb.0:
i32.const 42
local.get 0
local.get 0
i32.mul
local.get 0
i32.const 5
i32.lt_s
i32.select
# fallthrough-return
end_function
.Lfunc_end0:
.size square, .Lfunc_end0-square
# -- End function
.ident "clang version 10.0.0-4ubuntu1 "
.section .custom_section.producers,"",@
.int8 1
.int8 12
.ascii "processed-by"
.int8 1
.int8 5
.ascii "clang"
.int8 15
.ascii "10.0.0-4ubuntu1"
.section .text.square,"",@
```
is this format (which seems to me, accustomed to reading gas-style assembly, a lot nicer) supported in any way by the webassembly committee/toolchain producers ?
and are there any other tools apart from clang that can process (assemble) it further ?
|
[Q] clang/gas style assembly
|
https://api.github.com/repos/WebAssembly/wabt/issues/1616/comments
| 3 |
2021-02-28T20:29:35Z
|
2021-03-01T23:35:00Z
|
https://github.com/WebAssembly/wabt/issues/1616
| 818,302,092 | 1,616 |
[
"WebAssembly",
"wabt"
] |
Seems like github offers a relatively easy way to do this these days.
|
Switch primary branch from `master` to `main`
|
https://api.github.com/repos/WebAssembly/wabt/issues/1613/comments
| 3 |
2021-02-26T16:30:59Z
|
2021-03-22T16:58:42Z
|
https://github.com/WebAssembly/wabt/issues/1613
| 817,495,568 | 1,613 |
[
"WebAssembly",
"wabt"
] |
This snippet is invalid,
```wat
(module
(import "" "" (func $f))
(table 1 1 externref)
(elem (i32.const 0) $f)
)
```
as `func` is not a super-type of `externref`.
wat2wasm currently doesn't catch it.
|
wat2wasm doesn't typecheck (elem) against table types
|
https://api.github.com/repos/WebAssembly/wabt/issues/1612/comments
| 1 |
2021-02-25T21:20:30Z
|
2022-11-13T18:14:37Z
|
https://github.com/WebAssembly/wabt/issues/1612
| 816,819,291 | 1,612 |
[
"WebAssembly",
"wabt"
] |
My very basic example at https://github.com/mvolkmann/wasm-demo gives the following error when I run it in Chrome, but the code still works as expected.
```text
inject.js:2 Uncaught SyntaxError: Invalid regular expression: /(?:[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><])|[ --›Â​
︀-ï¸]/: Range out of order in character class
```
The error comes from the generated file `index.js`.
|
wat2wasm produces code that gives "Invalid regular expression"
|
https://api.github.com/repos/WebAssembly/wabt/issues/1611/comments
| 3 |
2021-02-19T12:49:41Z
|
2021-02-25T00:22:38Z
|
https://github.com/WebAssembly/wabt/issues/1611
| 811,997,083 | 1,611 |
[
"WebAssembly",
"wabt"
] |
catch_all.wat:
```wasm
(module
(type (;0;) (func))
(func (;0;) (type 0)
try
catch_all
end))
```
If I create a wasm file using wat2wasm and disassemble it using wasm-objdump,
```
$ wat2wasm --enable-all catch_all.wat -o catch_all.wasm
$ wasm-objdump -d catch_all.wasm
```
The result is
```
catch_all.wasm: file format wasm 0x1
Code Disassembly:
000016 func[0]:
000017: 06 40 | try
000019: 05 | else
00001a: 0b | end
00001b: 0b | end
```
Do you have a clue? cc @takikawa
|
wat2wasm still encodes 'catch_all' as 'else'
|
https://api.github.com/repos/WebAssembly/wabt/issues/1610/comments
| 1 |
2021-02-18T21:49:50Z
|
2021-02-19T15:15:52Z
|
https://github.com/WebAssembly/wabt/issues/1610
| 811,495,737 | 1,610 |
[
"WebAssembly",
"wabt"
] |
Reproduce:
```
$ mkdir /tmp/builddir
$ ln -s /tmp/builddir build
$ cd build
$ cmake /path/to/wabt
```
With Make:
```
$ make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ericonr/docs/extpro/wabt/build
make[2]: *** No rule to make target '../src/apply-names.cc', needed by 'CMakeFiles/wabt.dir/src/apply-names.cc.o'. Stop.
make[1]: *** [CMakeFiles/Makefile2:823: CMakeFiles/wabt.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
```
With ninja:
```
$ ninja
[1/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ericonr/docs/extpro/wabt/build
[... this repeats itself until the loop detection kicks in ...]
```
Doing a normal build from a non symlinked directory seems to work, and other CMake projects work just fine in this same setup.
|
Building inside a symlinked directory fails completely
|
https://api.github.com/repos/WebAssembly/wabt/issues/1607/comments
| 6 |
2021-02-16T00:21:29Z
|
2021-02-16T02:41:54Z
|
https://github.com/WebAssembly/wabt/issues/1607
| 808,892,577 | 1,607 |
[
"WebAssembly",
"wabt"
] |
With the following WAT file, `ref.wat`:
```
(module
(func $a)
(func $b (ref.func $a) drop)
)
```
I run `wat2wasm --enable-all ref.wat` and receive an error:
```
ref.wat:3:22: error: function is not declared in any elem sections
(func $b (ref.func $a) drop)
^^
```
I did not expect this type of error, since tests using [the roundtrip reference-types.txt](https://github.com/WebAssembly/wabt/blob/master/test/roundtrip/reference-types.txt) and [ref_func.wast](https://github.com/WebAssembly/testsuite/blob/18f83401a47a0e43772cf7d9f216e994bf7c7fa6/proposals/reference-types/ref_func.wast) seem to have this form of usage.
|
wat2wasm fails to convert ref.func
|
https://api.github.com/repos/WebAssembly/wabt/issues/1606/comments
| 1 |
2021-02-11T18:52:30Z
|
2021-02-17T07:25:45Z
|
https://github.com/WebAssembly/wabt/issues/1606
| 806,652,386 | 1,606 |
[
"WebAssembly",
"wabt"
] |
The new EH spec will eventually need to be supported in WABT. One new thing in the [update](https://github.com/WebAssembly/exception-handling/blob/1ec111eb32c8490991c943af2af40559dbd63cd4/proposals/exception-handling/Exceptions.md) is that the opcode for `catch_all` is 0x05, the same as `else`. This is not ambiguous because `else` must occur with an `if` and not a `try`, but wabt seems to have the assumption (e.g. in [opcode.def](https://github.com/WebAssembly/wabt/blob/master/src/opcode.def) ) that there's a 1:1 correspondence.
I haven't looked at how to fix it yet, but wondered if anyone (perhaps @aardappel or @sbc100) had any good ideas about the best way to make it work.
|
How to support the updated EH spec
|
https://api.github.com/repos/WebAssembly/wabt/issues/1604/comments
| 8 |
2021-02-06T01:55:01Z
|
2021-02-18T21:44:38Z
|
https://github.com/WebAssembly/wabt/issues/1604
| 802,580,970 | 1,604 |
[
"WebAssembly",
"wabt"
] |
wasm-decompile fails to decompile the binary corresponding to the following code for instance:
```webassembly
(module
(func (result i32)
(block (result i32)
(i32.const 42)
(i32.const 1)
(br_if 1)
)
)
)
```
It fails with the following:
```wasm-decompile: wabt/src/ir.h:57: const string& wabt::Var::name() const: Assertion `is_name()' failed.```
Trace:
```
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff7699921 in __GI_abort () at abort.c:79
#2 0x00007ffff768948a in __assert_fail_base (fmt=0x7ffff7810750 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5555557959e9 "is_name()",
file=file@entry=0x5555557959b8 "wabt/src/ir.h", line=line@entry=57,
function=function@entry=0x555555795aa0 <wabt::Var::name[abi:cxx11]() const::__PRETTY_FUNCTION__> "const string& wabt::Var::name() const") at assert.c:92
#3 0x00007ffff7689502 in __GI___assert_fail (assertion=0x5555557959e9 "is_name()", file=0x5555557959b8 "wabt/src/ir.h", line=57,
function=0x555555795aa0 <wabt::Var::name[abi:cxx11]() const::__PRETTY_FUNCTION__> "const string& wabt::Var::name() const") at assert.c:101
#4 0x00005555556c34f7 in wabt::Var::name[abi:cxx11]() const (this=0x555555a70fe0) at wabt/src/ir.h:57
#5 0x00005555557096db in wabt::Decompiler::DecompileExpr (this=0x7fffffffd3b0, n=..., parent=0x555555a71030) at wabt/src/decompiler.cc:552
#6 0x00005555557075c1 in wabt::Decompiler::DecompileExpr (this=0x7fffffffd3b0, n=..., parent=0x555555a711b0) at wabt/src/decompiler.cc:339
#7 0x00005555557075c1 in wabt::Decompiler::DecompileExpr (this=0x7fffffffd3b0, n=..., parent=0x555555a714d0) at wabt/src/decompiler.cc:339
#8 0x00005555557075c1 in wabt::Decompiler::DecompileExpr (this=0x7fffffffd3b0, n=..., parent=0x0) at wabt/src/decompiler.cc:339
#9 0x000055555570b3ad in wabt::Decompiler::Decompile[abi:cxx11]() (this=0x7fffffffd3b0) at wabt/src/decompiler.cc:797
#10 0x00005555557019cc in wabt::Decompile[abi:cxx11](wabt::Module const&, wabt::DecompileOptions const&) (module=..., options=...) at wabt/src/decompiler.cc:826
#11 0x00005555556bcd57 in ProgramMain (argc=2, argv=0x7fffffffdb28) at wabt/src/tools/wasm-decompile.cc:104
#12 0x00005555556bcf23 in main (argc=2, argv=0x7fffffffdb28) at wabt/src/tools/wasm-decompile.cc:117
```
|
wasm-decompile cannot handle branching out of a function
|
https://api.github.com/repos/WebAssembly/wabt/issues/1603/comments
| 0 |
2021-02-05T21:08:12Z
|
2021-02-05T21:12:08Z
|
https://github.com/WebAssembly/wabt/issues/1603
| 802,477,368 | 1,603 |
[
"WebAssembly",
"wabt"
] |
Reproduction:
Look at this old Mozilla bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1409124 and take the [attached WebAssembly binary](https://bugzilla.mozilla.org/attachment.cgi?id=8918975).
Observe that the file is a minuscule 86 bytes.
Pass it through wasm2wat (without adding any extra debug information).
Pass the output Wat text through wat2wasm.
Observe the resulting binary's size is 9KB+ (a whopping 10000% increase).
How is Wabt adding this extra size? Is this a bug? If not, can someone please explain why this occurs?
I presume that the Wat textual format is a "1 to 1" correlation to the Wasm binary format, am I mistaken?
Also, from https://webassembly.org/getting-started/advanced-tools:
> Using wasm2wat and wat2wasm together allows lossless round-tripping of WebAssembly binaries, and provides developers with a convenient way to manipulate the content of WebAssembly binaries using external tools.
|
Roundtripping Wasm through wasm2wat and wat2wasm adds bloat
|
https://api.github.com/repos/WebAssembly/wabt/issues/1601/comments
| 4 |
2021-02-04T21:44:52Z
|
2021-02-08T20:29:18Z
|
https://github.com/WebAssembly/wabt/issues/1601
| 801,658,331 | 1,601 |
[
"WebAssembly",
"wabt"
] |
Hello! I ran into an issue with libwasm.dylib not working with the latest wasm.h when testing out some code I wrote against the Wasm C API so I tried to make a simple series of steps to reproduce it but found that wabt did not build with the updated wasm-c-api repo.
Steps to reproduce:
```shell
git submodule update --remote third_party/wasm-c-api
mkdir build
cd build
cmake ..
cmake --build . -j
```
more info:
```shell
$ uname -a
Darwin mark 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64
$ cc --version
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```
Some of the errors:
```
/Users/mark/etc/wabt/src/interp/interp-wasm-c-api.cc:727:22: error: conflicting types for 'wasm_instance_new'
own wasm_instance_t* wasm_instance_new(wasm_store_t* store,
^
/Users/mark/etc/wabt/third_party/wasm-c-api/include/wasm.h:518:38: note: previous declaration is here
WASM_API_EXTERN own wasm_instance_t* wasm_instance_new(
^
/Users/mark/etc/wabt/src/interp/interp-wasm-c-api.cc:794:26: error: cannot initialize a parameter of type 'const wasm_val_vec_t *' with an lvalue of type 'wasm_val_t *'
auto trap = callback(params.data, results.data);
^~~~~~~~~~~
/Users/mark/etc/wabt/src/interp/interp-wasm-c-api.cc:823:31: error: cannot initialize a parameter of type 'const wasm_val_vec_t *' with an lvalue of type 'wasm_val_t *'
auto trap = callback(env, params.data, results.data);
^~~~~~~~~~~
/Users/mark/etc/wabt/src/interp/interp-wasm-c-api.cc:854:18: error: conflicting types for 'wasm_func_call'
own wasm_trap_t* wasm_func_call(const wasm_func_t* f,
^
/Users/mark/etc/wabt/third_party/wasm-c-api/include/wasm.h:431:34: note: previous declaration is here
WASM_API_EXTERN own wasm_trap_t* wasm_func_call(
^
/Users/mark/etc/wabt/src/interp/interp-wasm-c-api.cc:1186:1: error: conflicting types for 'wasm_valtype_copy'
WASM_IMPL_TYPE(valtype);
```
|
Wabt fails to build with latest wasm-c-api
|
https://api.github.com/repos/WebAssembly/wabt/issues/1600/comments
| 0 |
2021-01-27T15:26:25Z
|
2023-03-15T04:21:08Z
|
https://github.com/WebAssembly/wabt/issues/1600
| 795,199,464 | 1,600 |
[
"WebAssembly",
"wabt"
] |
I have a problem in MAC, operation
cmake -- build .
thanks!
|
src/interp/interp-wasm-c-api.cc:17:10: fatal error: 'wasm.h' file not found
|
https://api.github.com/repos/WebAssembly/wabt/issues/1594/comments
| 2 |
2020-12-24T01:17:06Z
|
2024-06-26T02:41:38Z
|
https://github.com/WebAssembly/wabt/issues/1594
| 774,119,766 | 1,594 |
[
"WebAssembly",
"wabt"
] |
Max allowed number of locals is `UINT32_MAX`, however WABT rejects it:
```sh
$ cat max_locals.wat
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section
"\03\02\01\00" ;; Function section
"\0a\0a\01" ;; Code section
;; function 0
"\08\01"
"\ff\ff\ff\ff\0f\7f" ;; 0xFFFFFFFF i32
"\0b" ;; end
)
$ wat2wasm max_locals.wat
max_locals.wat:1:4: error: error in binary module: @0x0000001c: local count must be < 0x10000000
(module binary
^^^^^^
```
My guess is that this check should use `<=`:
https://github.com/WebAssembly/wabt/blob/92e4cb9df0fab16083e32bf1b0fda0c4b6a55695/src/binary-reader.cc#L2429
Also I believe error message is one `0` off (should be `< 0x100000000`)
|
Incorrect check for max allowed local count
|
https://api.github.com/repos/WebAssembly/wabt/issues/1593/comments
| 1 |
2020-12-23T16:41:48Z
|
2023-03-15T16:49:23Z
|
https://github.com/WebAssembly/wabt/issues/1593
| 773,924,487 | 1,593 |
[
"WebAssembly",
"wabt"
] |
In particular, `DecompileExpr` calls itself recursively.
Example that fails: `clang -O2 quickjs.c -c` runs out of stack at VC++ default stack size of 1MB.
|
Decompiler can run out of stack space
|
https://api.github.com/repos/WebAssembly/wabt/issues/1591/comments
| 1 |
2020-12-14T20:45:29Z
|
2022-02-28T19:32:12Z
|
https://github.com/WebAssembly/wabt/issues/1591
| 766,911,881 | 1,591 |
[
"WebAssembly",
"wabt"
] |
As per #1063 , there should probably be a CI setup for s390x (which works now that #1557 is merged), at least for catching regressions and stuff?
As far as we know that's something that needs to be done by the project maintainers, as it involves setting up hooks and whatnot.
|
Setup Travis CI (or equivalent) for big-endian (s390x)?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1587/comments
| 0 |
2020-12-07T22:15:53Z
|
2020-12-07T22:15:53Z
|
https://github.com/WebAssembly/wabt/issues/1587
| 758,892,388 | 1,587 |
[
"WebAssembly",
"wabt"
] |
They seem to be ignored:
```
(global (;15;) i32 (i32.const 172))
(global (;16;) i32 (i32.const 168))
(global (;17;) i32 (i32.const 2904))
(global (;18;) i32 (i32.const 3644))
```
|
Names for globals from name section are not used in wasm2wat
|
https://api.github.com/repos/WebAssembly/wabt/issues/1584/comments
| 3 |
2020-12-04T17:07:12Z
|
2021-06-29T03:09:48Z
|
https://github.com/WebAssembly/wabt/issues/1584
| 757,258,163 | 1,584 |
[
"WebAssembly",
"wabt"
] |
Hi there!
I'm currently importing wabt runtime by using wasm-c-api modules.
But I found that there are some missing api functions as follows.
#### Import api
* WASM_API_EXTERN own wasm_importtype_t* wasm_importtype_new(
own wasm_name_t* module, own wasm_name_t* name, own wasm_externtype_t*);
* WASM_API_EXTERN const wasm_name_t* wasm_importtype_module(const wasm_importtype_t*);
* WASM_API_EXTERN const wasm_name_t* wasm_importtype_name(const wasm_importtype_t*);
* WASM_API_EXTERN const wasm_externtype_t* wasm_importtype_type(const wasm_importtype_t*);
Would you please update these features?
Thanks in advance!
|
Missing wasm-c-api functions
|
https://api.github.com/repos/WebAssembly/wabt/issues/1578/comments
| 1 |
2020-12-02T08:07:16Z
|
2021-01-12T02:50:45Z
|
https://github.com/WebAssembly/wabt/issues/1578
| 755,045,032 | 1,578 |
[
"WebAssembly",
"wabt"
] |
The wat2wasm demo at https://webassembly.github.io/wabt/demo/wat2wasm allows the following code to compile (with flags):
```wat
(module
(func (export "selectTwo") (result i32 i32)
i32.const 0
i32.const 0
i32.const 0
i32.const 0
select (result i32 i32)
)
)
```
Have the semantics of the select operation been established if it leaves multiple values on the stack?
Should wat2wasm prevent this from compiling?
Do any WebAssembly compilers/interpreters/runtimes handle this operation yet?
|
Demo allows compilation of multi-value select operation
|
https://api.github.com/repos/WebAssembly/wabt/issues/1577/comments
| 4 |
2020-11-30T03:32:44Z
|
2020-12-04T05:24:12Z
|
https://github.com/WebAssembly/wabt/issues/1577
| 753,112,256 | 1,577 |
[
"WebAssembly",
"wabt"
] |
noticed while making a kotlin-writer: https://github.com/WebAssembly/wabt/blob/master/src/c-writer.cc#L1984
|
wasm2c defines i64_load16_u but it's never used
|
https://api.github.com/repos/WebAssembly/wabt/issues/1575/comments
| 0 |
2020-11-22T16:54:59Z
|
2020-12-14T19:25:43Z
|
https://github.com/WebAssembly/wabt/issues/1575
| 748,284,707 | 1,575 |
[
"WebAssembly",
"wabt"
] |
Hi,
I want to build all the tools in the release mode on Linux. I followed the instructions mentioned in the readme.md . but I am not able to get release version of binaries.
can someone help me
|
How to build wabt in release mode on Linux
|
https://api.github.com/repos/WebAssembly/wabt/issues/1571/comments
| 11 |
2020-11-19T07:34:09Z
|
2021-08-20T17:05:37Z
|
https://github.com/WebAssembly/wabt/issues/1571
| 746,326,649 | 1,571 |
[
"WebAssembly",
"wabt"
] |
Currently we need to install Visual C++ Redistributable on Windows in order to run WABT, which is a slight inconvenience.
Could you link it statically?
I believe it is controlled by `-MT` and `-MTd` compiler fags and which are supported in CMake build via [MSVC_RUNTIME_LIBRARY](https://cmake.org/cmake/help/v3.19/prop_tgt/MSVC_RUNTIME_LIBRARY.html) property, but I'm don't have a Windows dev box to try it myself.
|
Statically link Visual C++ runtime when releasing on Windows
|
https://api.github.com/repos/WebAssembly/wabt/issues/1568/comments
| 1 |
2020-11-10T12:45:39Z
|
2022-08-26T01:18:07Z
|
https://github.com/WebAssembly/wabt/issues/1568
| 739,879,403 | 1,568 |
[
"WebAssembly",
"wabt"
] |
I'm using `wat2wasm`. The version is reported as `1.0.13 (1.0.19)` (I installed WABT with `brew`). I'm compiling handwritten WAT code.
If I load or store a (correctly aligned) 64-bit value with `align=3`, WABT incorrectly complains:
``` html
<location> error: alignment must be power-of-two
f64.load align=3
```
Using `align=4` fixes the issue, but the spec only permits alignment values of `0`, `1`, `2` and `3` (for 8-bit, 16-bit, 32-bit and 64-bit, respectively):
> Memory is accessed with load and store instructions for the different value types. They all take a memory immediate memarg that contains an address offset and the expected alignment **(expressed as the exponent of a power of 2)**.
|
[wat2wasm] requires alignments be a power of two, which is incorrect
|
https://api.github.com/repos/WebAssembly/wabt/issues/1567/comments
| 5 |
2020-11-10T01:18:52Z
|
2020-11-11T18:41:05Z
|
https://github.com/WebAssembly/wabt/issues/1567
| 739,489,905 | 1,567 |
[
"WebAssembly",
"wabt"
] |
# How to reproduce (and why this can be a problem)
Here is the minimum code to reproduce:
table-identifier.wat:
```wasm
(module
(import "js" "tbl" (table $tblImported 1 anyfunc))
(func $f (result i32) i32.const 42)
(elem $tblImported $f)
)
```
Running `wat2wasm table-identifier.wat` generates a wasm file below:
(Update: this Wasm file is actually invalid. So the point here is wat2wasm shouldn't accept the fie above)
table-identifier.wasm (as textual form):
```wasm
(module
(type (;0;) (func (result i32)))
(import "js" "tbl" (table (;0;) 1 funcref))
(func (;0;) (type 0) (result i32)
i32.const 42)
(elem (;0;) func 0))
```
The element segment `(elem (;0;) func 0))` is ignored (at least) by V8.
For example in REPL of Node.js:
```js
> tbl = new WebAssembly.Table({initial:1, element:"anyfunc"});
> wasm = new WebAssembly.Instance(new WebAssembly.Module(fs.readFileSync('table-identifier.wasm')), { js: {
tbl: tbl } })
Instance [WebAssembly.Instance] {}
> tbl.get(0) // The 0th element should be overwritten by calling `new WebAssembly.Instance(..)`!
null
```
## For comparison: adding the offset works as expected
table-i32.const.wat:
```wasm
(module
(import "js" "tbl" (table 1 anyfunc))
(func $f (result i32) i32.const 42)
(elem (i32.const 0) $f) ;; Just changed tblImported into i32.const 0
)
```
Then run `wat2wasm table-identifier.wat`, and test with REPL of Node.js.
```js
> tbl = new WebAssembly.Table({initial:1, element:"anyfunc"});
Table [WebAssembly.Table] {}
> wasm = new WebAssembly.Instance(new WebAssembly.Module(fs.readFileSync('table-i32.const.wasm')), { js: {
tbl: tbl } })
Instance [WebAssembly.Instance] {}
> tbl.get(0) // Not null because calling `new WebAssembly.Instance(..)` implicitly overwrites the imported table!
[Function: 0]
```
# My environment
```
> wat2wasm.exe --version
1.0.13 (1.0.19)
> node --version
v15.0.1
```
|
wat2wasm: elem without offset shouldn't be accepted
|
https://api.github.com/repos/WebAssembly/wabt/issues/1566/comments
| 2 |
2020-11-09T06:35:51Z
|
2020-11-11T17:43:41Z
|
https://github.com/WebAssembly/wabt/issues/1566
| 738,731,866 | 1,566 |
[
"WebAssembly",
"wabt"
] |
some examples:



|
wasm-decompile outputs seemingly repetitive/nonsensical code
|
https://api.github.com/repos/WebAssembly/wabt/issues/1565/comments
| 5 |
2020-11-04T07:11:25Z
|
2021-04-26T23:33:30Z
|
https://github.com/WebAssembly/wabt/issues/1565
| 735,872,586 | 1,565 |
[
"WebAssembly",
"wabt"
] |
Current problems:
- wasm sandbox interoperability is slow
- wasm can be written in different languages
So it will be useful to add one .wasm from another .wasm
Solution:
What if will try to disassemble .wasm -> .wat, contact table of functions as a string and assemble it back .wat -> .wasm? The problem with function names can be solved by tool itself, main file will be the same, each function in dependency can be numerated by dependency id, so name collision will be not possible.
Should we change .wasm design by itself to make this sandbox fusion possible?
|
wasm-concat ?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1563/comments
| 4 |
2020-10-28T06:59:33Z
|
2022-09-18T06:38:03Z
|
https://github.com/WebAssembly/wabt/issues/1563
| 731,165,041 | 1,563 |
[
"WebAssembly",
"wabt"
] |
We just upgraded from using 1.0.18 to 1.0.19; when builiding with GCC 10.2 on Linux, I get the following warnings that look concerning:
(only once:)
```
[79/3359] Building CXX object _deps/wabt-build/CMakeFiles/wabt.dir/src/binary-writer-spec.cc.o
In file included from _deps/wabt-src/src/binary-writer.h:20,
from _deps/wabt-src/src/binary-writer-spec.h:24,
from _deps/wabt-src/src/binary-writer-spec.cc:17:
_deps/wabt-src/src/common.h: In member function ‘void wabt::{anonymous}::BinaryWriterSpec::WriteConst(const wabt::Const&)’:
_deps/wabt-src/src/common.h:143:40: warning: array subscript 32 is above array bounds of ‘const uint8_t [16]’ {aka ‘const unsigned char [16]’} [-Warray-bounds]
143 | memcpy(&result, &v[lane * sizeof(T)], sizeof(result));
| ~~~~~~~~~~~~~~~~~~^
_deps/wabt-src/src/common.h:154:11: note: while referencing ‘v128::v’
154 | uint8_t v[16];
| ^
```
(many times:)
```
_deps/wabt-src/src/stream.cc: In member function ‘void wabt::Stream::Writef(const char*, ...)’:
_deps/wabt-src/src/common.h:71:33: warning: argument to ‘alloca’ may be too large [-Walloca-larger-than=]
71 | buffer = static_cast<char*>(alloca(len + 1)); \
| ^~~~~~
_deps/wabt-src/src/stream.cc:88:3: note: in expansion of macro ‘WABT_SNPRINTF_ALLOCA’
88 | WABT_SNPRINTF_ALLOCA(buffer, length, format);
| ^~~~~~~~~~~~~~~~~~~~
```
|
C++ warnings while compiling wabt 1.0.19
|
https://api.github.com/repos/WebAssembly/wabt/issues/1562/comments
| 3 |
2020-10-27T16:22:14Z
|
2023-03-15T07:56:31Z
|
https://github.com/WebAssembly/wabt/issues/1562
| 730,605,661 | 1,562 |
[
"WebAssembly",
"wabt"
] |
See the comments [here](https://github.com/WebAssembly/wabt/pull/1553#issuecomment-703713792) for background.
/cc @binji @aardappel
|
Fix func.wast failures with recent testsuite updates
|
https://api.github.com/repos/WebAssembly/wabt/issues/1561/comments
| 1 |
2020-10-24T03:39:12Z
|
2022-04-01T07:05:57Z
|
https://github.com/WebAssembly/wabt/issues/1561
| 728,648,849 | 1,561 |
[
"WebAssembly",
"wabt"
] |
Trying to use the repo makefile just doesn't work. It's very inconsistent and different GNU make versions behave differently, and many tests fail when using it.
On 2 different systems, the makefile was not able to run the c-api examples. On a third system, it ran the tests instead of the examples, but the wat2wasm tests failed because it couldn't find wat2wasm somehow?
... Nevertheless, using cmake directly seemed to make it all work. So...? This is weird tbh.
|
Makefile behaves differently on different systems
|
https://api.github.com/repos/WebAssembly/wabt/issues/1558/comments
| 1 |
2020-10-11T02:57:08Z
|
2020-10-21T22:34:17Z
|
https://github.com/WebAssembly/wabt/issues/1558
| 718,745,457 | 1,558 |
[
"WebAssembly",
"wabt"
] |
The binary reader reads types (functype, but also structs and arrays) in type section using signed LEB128 encoding. The spec defines type as single byte. This causing problem because WABT accepts longer sequences of bytes as valid types while there are invalid in the spec.
I can change the [`Type::Enum`](https://github.com/WebAssembly/wabt/blob/master/src/type.h#L36) to be based on `uint8_t` unless you think this will cause some problems with any extensions.
The related spectest from https://github.com/WebAssembly/spec/pull/1254.
```webassembly
;; Type section with signed LEB128 encoded type
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01" ;; Type section id
"\05" ;; Type section length
"\01" ;; Types vector length
"\e0\7f" ;; Malformed functype, -0x20 in signed LEB128 encoding
"\00\00"
)
"integer representation too long"
)
```
|
Incorrect functype decoding
|
https://api.github.com/repos/WebAssembly/wabt/issues/1556/comments
| 3 |
2020-10-02T10:59:20Z
|
2022-09-18T06:42:50Z
|
https://github.com/WebAssembly/wabt/issues/1556
| 713,534,774 | 1,556 |
[
"WebAssembly",
"wabt"
] |
See https://github.com/WebAssembly/wabt/pull/1549 for the kind of changes that need to happen.
|
Support --relocatable and multi-memory
|
https://api.github.com/repos/WebAssembly/wabt/issues/1552/comments
| 2 |
2020-09-23T15:38:27Z
|
2022-04-27T17:40:01Z
|
https://github.com/WebAssembly/wabt/issues/1552
| 707,474,611 | 1,552 |
[
"WebAssembly",
"wabt"
] |
This looks to be related to https://github.com/WebAssembly/wabt/pull/1466
For the functions that define their type as `(type ...)` indices of local always start with 0:
```
$ cat type_sig.wast
(module
(type $sig (func (param i32) (result i32)))
(func (type $sig)
(local $var i32)
(local.get $var))
)
$ wat2wasm type_sig.wast
```
This generates binary with `local.get 0` while the correct index should be `local.get 1`:
```
$ wasm2wat type_sig.wasm
(module
(type (;0;) (func (param i32) (result i32)))
(func (;0;) (type 0) (param i32) (result i32)
(local i32)
local.get 0))
```
This also leads to `wast2json` incorrectly generating module for these spec tests https://github.com/WebAssembly/spec/blob/7526564b56c30250b66504fe795e9c1e88a938af/test/core/func.wast#L459-L485
|
wat2wasm outputs incorrect local indices on function with type use
|
https://api.github.com/repos/WebAssembly/wabt/issues/1551/comments
| 7 |
2020-09-23T15:18:55Z
|
2020-11-10T20:35:43Z
|
https://github.com/WebAssembly/wabt/issues/1551
| 707,459,043 | 1,551 |
[
"WebAssembly",
"wabt"
] |
We have been using WABT 1.0.12 interpreter as a baseline for our benchmarking while developing [Fizzy](https://github.com/wasmx/fizzy).
Recently we tried comparing WABT 1.0.12 against 1.0.19 on our benchmarks (mostly arithmetic-heavy code, crypto algos), and it showed significant slowdown in the latter (execution up to 2-3 times slower in many benchmarks; instantiation also slower but only up to ~15% slower).
We don't rule out the possibility, that we use the new interpreter API in some suboptimal way, so we would appreciate, if some obvious issues with it were pointed out.
Our code is in https://github.com/wasmx/fizzy/blob/ce3c446e62acce5db245a1287b7a524956277b87/test/utils/wabt_engine.cpp (Note: we do create one `Thread` object to be used in all `execute` iterations; with the old API we similarly created single `Executor`)
Detailed benchmarking results are in https://github.com/wasmx/fizzy/pull/443.
Thank you.
|
Performance regression using new interpreter API
|
https://api.github.com/repos/WebAssembly/wabt/issues/1550/comments
| 4 |
2020-09-23T10:02:35Z
|
2020-10-21T22:43:44Z
|
https://github.com/WebAssembly/wabt/issues/1550
| 707,224,491 | 1,550 |
[
"WebAssembly",
"wabt"
] |
For a while I've been working on a new library called wasp: https://github.com/binji/wasp. It has much of the same functionality as wabt, but written from the ground up to be a library rather than a suite of tools.
Wasp is now at the point where I'd like to look at incorporating it into wabt, so that features don't have to be implemented twice. Wasp could also end up being beneficial to binaryen, perhaps using just wasp's text parser.
Here is a high-level list of tasks that are required to start using wasp:
- [x] Move wasp library from binji/ to webassembly/
- [ ] Add wasp library as a git submodule
- [ ] Add a separate build configuration that builds wasp along with wabt
- [ ] Replace wabt components with the wasp equivalent
- [ ] binary reader
- [ ] replace reader, keep the callback-based API
- [ ] remove the callback API and use wasp visitor instead
- [ ] binary writer
- [ ] text reader
- [ ] text writer
- [ ] validator
- [ ] text -> binary conversion
- [ ] binary -> text conversion
- [ ] Remove redundant wabt components (nearly everything, aside from tools, decompiler, interpreter, wasm2c stuff)
I'd like to do this as incrementally as possible, and on the main branch. Since a lot of these components depend on wabt's IR, that likely will be the last piece to remove. In the meantime, we can convert between wasp/wabt structures at the boundary.
|
Use wasp library in wabt
|
https://api.github.com/repos/WebAssembly/wabt/issues/1543/comments
| 5 |
2020-09-11T19:17:22Z
|
2024-01-30T09:44:21Z
|
https://github.com/WebAssembly/wabt/issues/1543
| 699,661,154 | 1,543 |
[
"WebAssembly",
"wabt"
] |
Consider `c.wat`:
```wat
(module
(type (;0;) (func))
(import "env" "b" (func (;0;) (type 0)))
(func $a (type 0)
call 0)
(export "a" (func $a)))
```
If we `wat2wasm --relocatable` it and then `wasm-objdump -dx` it, we get:
```
...
Custom:
- name: "reloc.Code"
- relocations for section: 4 (Code) [1]
- R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x00002a) symbol=0 <env.b>
```
However if instead we do `wat2wasm --enable-bulk-memory`, we get
```
...
Custom:
- name: "reloc.Code"
- relocations for section: 5 (linking) [1]
- R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x00004e) symbol=0 <env.b>
```
i.e. the relocs are targetting the wrong section.
|
Enabling bulk memory borks --relocatable
|
https://api.github.com/repos/WebAssembly/wabt/issues/1538/comments
| 0 |
2020-09-09T13:57:22Z
|
2020-09-16T22:22:46Z
|
https://github.com/WebAssembly/wabt/issues/1538
| 696,838,891 | 1,538 |
[
"WebAssembly",
"wabt"
] |
Hi, The wasm-opcodecnt tool gives me the opcode count of whole binary file. But I wanted to know the opcode count for each function. Is there any way to get that info?
Ex:
```
(module
(type $t0 (func (param f64 f64) (result f64)))
(func $sum (type $t0) (param $p0 f64) (param $p1 f64) (result f64)
local.get $p0
local.get $p1
f64.add)
(func $sub (type $t0) (param $p0 f64) (param $p1 f64) (result f64)
local.get $p0
local.get $p1
f64.sub)
(table $T0 1 1 funcref)
(memory $memory 16)
(global $g0 (mut i32) (i32.const 1048576))
(global $__data_end i32 (i32.const 1048576))
(global $__heap_base i32 (i32.const 1048576))
(export "memory" (memory 0))
(export "sum" (func $sum))
(export "sub" (func $sub))
(export "__data_end" (global 1))
(export "__heap_base" (global 2)))
```
For the above code it gives me opcode count as
```
Total opcodes: 8
Opcode counts:
local.get: 4
end: 2
f64.add: 1
f64.sub: 1
```
Instead, I wanted something like
```
Opcode counts for sum :
local.get: 2
end: 1
f64.add: 1
Opcode counts for sub:
local.get: 2
end: 1
f64.sub: 1
```
|
Can we get opcode count for each function?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1536/comments
| 1 |
2020-09-09T04:21:25Z
|
2020-09-10T17:55:43Z
|
https://github.com/WebAssembly/wabt/issues/1536
| 696,397,326 | 1,536 |
[
"WebAssembly",
"wabt"
] |
Consider `a.c` which exports a function that calls something from `b.c`:
```
$ cat a.c
void b(void);
__attribute__((export_name("a"))) void a(void) { b(); }
$ cat b.c
void b(void) {}
```
With clang and wasm-ld, we can make a wasm file:
```
$ clang -Oz --target=wasm32 -nostdlib -c -o a.o a.c
$ clang -Oz --target=wasm32 -nostdlib -c -o b.o b.c
$ wasm-ld --no-entry -o clang.wasm a.clang.o b.o
```
Let's say we want to replace `a.c` with a wat file.
```
$ wasm2wat -o a.wat a.o
$ wat2wasm --relocatable -o a.wat.o a.wat
$ wasm-ld --no-entry -o wat.wasm a.wat.o b.o
```
OK great. However:
```
$ wasm2wat wat.wasm
(module
(import "env" "memory" (memory (;0;) 2))
(table (;0;) 1 1 funcref)
(global (;0;) (mut i32) (i32.const 66560)))
```
That is to say: dude, where's my export (of `a`)?
The problem is that in the a.o as produced by clang, the linking and reloc sections look like this:
```
Custom:
- name: "linking"
- symbol table [count=2]
- 0: F <a> func=1 exported no_strip binding=global vis=hidden
- 1: F <env.b> func=0 undefined binding=global vis=default
Custom:
- name: "reloc.CODE"
- relocations for section: 4 (Code) [1]
- R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x000077) symbol=1 <env.b>
Custom:
- name: "producers"
Code Disassembly:
000075 func[1] <a>:
000076: 10 80 80 80 80 00 | call 0 <env.b>
00007c: 0b | end
```
Whereas as produced by `wat2wasm`, they look like this:
```
Custom:
- name: "linking"
- symbol table [count=1]
- 0: F <env.b> func=0 undefined binding=global vis=default
Custom:
- name: "reloc.Code"
- relocations for section: 4 (Code) [1]
- R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x000063) symbol=0 <env.b>
Code Disassembly:
000061 func[1] <a>:
000062: 10 80 80 80 80 00 | call 0 <env.b>
000068: 0b | end
```
I know that on #1137 there is a question about whether to keep up the functionality of --relocatable at all, but I think that with a couple of bug-fixes it can be usable enough for me, so I will take a look at fixing this unless there's an objection.
|
wat2wasm --relocatable should record exports in linking symtab
|
https://api.github.com/repos/WebAssembly/wabt/issues/1534/comments
| 1 |
2020-09-08T09:19:02Z
|
2020-09-10T17:13:38Z
|
https://github.com/WebAssembly/wabt/issues/1534
| 695,704,546 | 1,534 |
[
"WebAssembly",
"wabt"
] |
I believe according to https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md#text-format the `i64` modifier is expected to come before the limits, but it looks like in the test added here in https://github.com/WebAssembly/wabt/pull/1500 have`i64` coming after the limits?
|
Memory64 text format parses `i64` in the wrong location
|
https://api.github.com/repos/WebAssembly/wabt/issues/1532/comments
| 11 |
2020-09-02T20:47:44Z
|
2021-08-13T00:04:38Z
|
https://github.com/WebAssembly/wabt/issues/1532
| 691,409,671 | 1,532 |
[
"WebAssembly",
"wabt"
] |
This text file:
<details>
```wasm
(module
;; 64 random types to force the block type below to get encoded as sleb
(func (param f32 f32 f32 f32 f32 f32))
(func (param i32 f32 f32 f32 f32 f32))
(func (param f32 i32 f32 f32 f32 f32))
(func (param i32 i32 f32 f32 f32 f32))
(func (param f32 f32 i32 f32 f32 f32))
(func (param i32 f32 i32 f32 f32 f32))
(func (param f32 i32 i32 f32 f32 f32))
(func (param i32 i32 i32 f32 f32 f32))
(func (param f32 f32 f32 i32 f32 f32))
(func (param i32 f32 f32 i32 f32 f32))
(func (param f32 i32 f32 i32 f32 f32))
(func (param i32 i32 f32 i32 f32 f32))
(func (param f32 f32 i32 i32 f32 f32))
(func (param i32 f32 i32 i32 f32 f32))
(func (param f32 i32 i32 i32 f32 f32))
(func (param i32 i32 i32 i32 f32 f32))
(func (param f32 f32 f32 f32 i32 f32))
(func (param i32 f32 f32 f32 i32 f32))
(func (param f32 i32 f32 f32 i32 f32))
(func (param i32 i32 f32 f32 i32 f32))
(func (param f32 f32 i32 f32 i32 f32))
(func (param i32 f32 i32 f32 i32 f32))
(func (param f32 i32 i32 f32 i32 f32))
(func (param i32 i32 i32 f32 i32 f32))
(func (param f32 f32 f32 i32 i32 f32))
(func (param i32 f32 f32 i32 i32 f32))
(func (param f32 i32 f32 i32 i32 f32))
(func (param i32 i32 f32 i32 i32 f32))
(func (param f32 f32 i32 i32 i32 f32))
(func (param i32 f32 i32 i32 i32 f32))
(func (param f32 i32 i32 i32 i32 f32))
(func (param i32 i32 i32 i32 i32 f32))
(func (param f32 f32 f32 f32 f32 i32))
(func (param i32 f32 f32 f32 f32 i32))
(func (param f32 i32 f32 f32 f32 i32))
(func (param i32 i32 f32 f32 f32 i32))
(func (param f32 f32 i32 f32 f32 i32))
(func (param i32 f32 i32 f32 f32 i32))
(func (param f32 i32 i32 f32 f32 i32))
(func (param i32 i32 i32 f32 f32 i32))
(func (param f32 f32 f32 i32 f32 i32))
(func (param i32 f32 f32 i32 f32 i32))
(func (param f32 i32 f32 i32 f32 i32))
(func (param i32 i32 f32 i32 f32 i32))
(func (param f32 f32 i32 i32 f32 i32))
(func (param i32 f32 i32 i32 f32 i32))
(func (param f32 i32 i32 i32 f32 i32))
(func (param i32 i32 i32 i32 f32 i32))
(func (param f32 f32 f32 f32 i32 i32))
(func (param i32 f32 f32 f32 i32 i32))
(func (param f32 i32 f32 f32 i32 i32))
(func (param i32 i32 f32 f32 i32 i32))
(func (param f32 f32 i32 f32 i32 i32))
(func (param i32 f32 i32 f32 i32 i32))
(func (param f32 i32 i32 f32 i32 i32))
(func (param i32 i32 i32 f32 i32 i32))
(func (param f32 f32 f32 i32 i32 i32))
(func (param i32 f32 f32 i32 i32 i32))
(func (param f32 i32 f32 i32 i32 i32))
(func (param i32 i32 f32 i32 i32 i32))
(func (param f32 f32 i32 i32 i32 i32))
(func (param i32 f32 i32 i32 i32 i32))
(func (param f32 i32 i32 i32 i32 i32))
(func (param i32 i32 i32 i32 i32 i32))
(func (result i32)
(i32.add
(block (result i32 i32)
(i32.const 32)
(i32.const 10)))))
```
</details>
changed encodings as part of #1526 (I think by accident?) as can be seen with:
```
$ wat2wasm foo.wat -o foo.wasm
$ wasm-validate foo.wasm
0000361: error: expected valid block signature type
```
so I think that the encoding of large lebs isn't correct any more?
|
Incorrect encoding of multi-value block types
|
https://api.github.com/repos/WebAssembly/wabt/issues/1531/comments
| 1 |
2020-09-02T20:44:52Z
|
2020-09-08T19:34:36Z
|
https://github.com/WebAssembly/wabt/issues/1531
| 691,407,732 | 1,531 |
[
"WebAssembly",
"wabt"
] |
I followed the instructions in the README, and tried `make emcc-release`, `make emcc-debug`, and various other combinations. Nothing works. `No rule to make target 'emcc-release'`.
Everything works perfectly fine with gcc, and I can actually get it to start compiling using with emscripten if I follow the manual instructions. I made the build directory, opened it, typed `cmake ..`, and then `cmake -G "Unix Makefiles" --build . -DCMAKE_C_COMPILER-emcc -DCMAKE_CXX_COMPILER-emcc -DCMAKE_BUILD_TYPE=Release`. this actually generates build files and I can run the makefile but I get multiple errors from emcc, including `invalid token at start of a preprocessor expression #if SIZEOF_SIZE_T == 4` and `use of undeclared identifier 'magic'`.
I have been able to build hello world with emscripten, and I do have the latest version. I may be doing something wrong with cmake, but I should at least be able to build it with emscripten when I follow the README instructions. All help is appreciated :)
|
unable to build with emscripten
|
https://api.github.com/repos/WebAssembly/wabt/issues/1529/comments
| 2 |
2020-08-28T14:08:35Z
|
2020-08-29T00:41:10Z
|
https://github.com/WebAssembly/wabt/issues/1529
| 688,102,165 | 1,529 |
[
"WebAssembly",
"wabt"
] |
When I clone your repository recursively, `mkdir build`, `cd build` and run `cmake ..`, I get this message printed 10s of times and then I get a `configuration failed` message:
```
System is unknown to cmake, create:
Platform/FreeBSD to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
```
I have tried running the Windows version from the releases, however, it is 64-bit, and 32-bit WINE (the only one available for FreeBSD) can't run it.
I have tried to download the Ubuntu version and use the Linux emulation built into FreeBSD, but that Linux emulation doesn't appear to be good enough, as I get:
```
./wasm2wat: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./wasm2wat)
```
So, what should I do?
I am using WABT as a back-end of the [compiler for my programming language](https://github.com/FlatAssembler/AECforWebAssembly) and I'd like it to work on FreeBSD as well.
|
How can I run WABT on FreeBSD?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1528/comments
| 2 |
2020-08-26T12:49:03Z
|
2020-09-03T19:05:50Z
|
https://github.com/WebAssembly/wabt/issues/1528
| 686,292,938 | 1,528 |
[
"WebAssembly",
"wabt"
] |
PoC:
```
dwfault-mbp:~ dwfault$ hexdump PoC.wasm.objdump.1ff
0000000 00 61 73 6d 01 00 00 00 01 05 01 60 01 7f 00 03
0000010 03 02 00 00 05 03 01 00 00 07 16 03 03 6d 65 6d
0000020 02 00 04 6c 6f 57 64 00 [ff ff ff ff 0f] 1a 0b 0d
0000030 00 20 1c 02 86 80 80 80 00 02 ff ff ff ff 0f 1a
0000040 0b 0d 00 20 00 41 00 36 23 f6 ff ff ff 0f 0b
000004f
```
The 0x0f ff ff ff ff in the brackets is the index of an export item in LEB128 unsigned form. And there's a crashing stack trace when parsing it:
```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x17ffffffe8)
* frame #0: 0x00000001000027d5 wasm-objdump`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__is_long(this="") const at string:1420:22
frame #1: 0x0000000100011115 wasm-objdump`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::clear(this="") at string:3063:9
frame #2: 0x000000010001104c wasm-objdump`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__clear_and_shrink(this="") at string:3820:5
frame #3: 0x0000000100010fe0 wasm-objdump`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__move_assign(this="", __str="loWd", (null)=std::__1::true_type @ 0x00007ffeefbfec98) at string:2292:5
frame #4: 0x00000001000020e4 wasm-objdump`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(this="", __str="loWd") at string:2304:5
frame #5: 0x0000000100001fef wasm-objdump`wabt::ObjdumpNames::Set(this=0x00007ffeefbff5d8, index=4294967295, name=(data_ = "loWd", size_ = 4)) at binary-reader-objdump.cc:1864:16
frame #6: 0x0000000100007d18 wasm-objdump`wabt::(anonymous namespace)::BinaryReaderObjdumpPrepass::SetFunctionName(this=0x00007ffeefbff2e0, index=4294967295, name=(data_ = "loWd", size_ = 4)) at binary-reader-objdump.cc:357:34
frame #7: 0x0000000100003c43 wasm-objdump`wabt::(anonymous namespace)::BinaryReaderObjdumpPrepass::OnExport(this=0x00007ffeefbff2e0, index=1, kind=Func, item_index=4294967295, name=(data_ = "loWd", size_ = 4)) at binary-reader-objdump.cc:320:7
frame #8: 0x000000010002e86f wasm-objdump`wabt::(anonymous namespace)::BinaryReader::ReadExportSection(this=0x00007ffeefbff090, section_size=22) at binary-reader.cc:2250:32
frame #9: 0x000000010002b893 wasm-objdump`wabt::(anonymous namespace)::BinaryReader::ReadSections(this=0x00007ffeefbff090) at binary-reader.cc:2505:26
frame #10: 0x000000010002a542 wasm-objdump`wabt::(anonymous namespace)::BinaryReader::ReadModule(this=0x00007ffeefbff090) at binary-reader.cc:2578:3
frame #11: 0x000000010002a353 wasm-objdump`wabt::ReadBinary(data=0x000000010233dcd0, size=79, delegate=0x00007ffeefbff2e0, options=0x00007ffeefbff3c0) at binary-reader.cc:2595:17
frame #12: 0x000000010000231c wasm-objdump`wabt::ReadBinaryObjdump(data="", size=79, options=0x00000001000df8c0, state=0x00007ffeefbff5a8) at binary-reader-objdump.cc:1886:14
frame #13: 0x00000001000128ba wasm-objdump`dump_file(filename="/Users/dwfault/Downloads/PoC.wasm.objdump.1ff") at wasm-objdump.cc:88:13
frame #14: 0x0000000100012cbe wasm-objdump`ProgramMain(argc=3, argv=0x00007ffeefbff760) at wasm-objdump.cc:133:16
frame #15: 0x00000001000130a2 wasm-objdump`main(argc=3, argv=0x00007ffeefbff760) at wasm-objdump.cc:143:10
frame #16: 0x00007fff67252cc9 libdyld.dylib`start + 1
```
This is because a classic error resides in ObjdumpNames::Set, the calculated result is overflowed as 0, but index(0xffffffff) is still used depite that no memory is actually available:
```C++
void ObjdumpNames::Set(Index index, string_view name) {
if (names.size() <= index) {
names.resize(index + 1);//--------0xffffffff + 1 = 0;
}
names[index] = name.to_string();
}
```
The index is read previously in BinaryReader::ReadExportSection(Macros are expanded):
```C++
Result BinaryReader::ReadExportSection(Offset section_size) {
if (!(Succeeded(delegate_->BeginExportSection(section_size)))) {
PrintError("BeginExportSection" " callback failed");
return Result::Error;
}
Index num_exports;
CHECK_RESULT(ReadCount(&num_exports, "export count"));
if (!(Succeeded(delegate_->OnExportCount(num_exports)))) {
PrintError("OnExportCount" " callback failed");
return Result::Error;
}
for (Index i = 0; i < num_exports; ++i) {
string_view name;
CHECK_RESULT(ReadStr(&name, "export item name"));
ExternalKind kind;
CHECK_RESULT(ReadExternalKind(&kind, "export kind"));
Index item_index;
CHECK_RESULT(ReadIndex(&item_index, "export item index")); //------------------->read
if (kind == ExternalKind::Event) {
if (!(options_.features.exceptions_enabled())) {
PrintError("invalid export event kind: exceptions not allowed");
return Result::Error;
}
}
if (!(Succeeded(delegate_->OnExport(i, static_cast<ExternalKind>(kind), item_index, name)))) { //-------------->crash
PrintError("OnExport" " callback failed");
return Result::Error;
}
}
if (!(Succeeded(delegate_->EndExportSection()))) {
PrintError("EndExportSection" " callback failed");
return Result::Error;
}
return Result::Ok;
}
```
And finally result in a Out-of-Bound memory access and crash. ASAN log:
```
==14531==ERROR: AddressSanitizer: SEGV on unknown address 0x001fffffffe0 (pc 0x7f6ec709ba65 bp 0x7ffff01f5d40 sp 0x7ffff01f5bf8 T0)
==14531==The signal is caused by a READ memory access.
#0 0x7f6ec709ba64 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x120a64)
#1 0x555b7b (/home/dwfault/wabt/wasm-objdump+0x555b7b)
#2 0x55a6a6 (/home/dwfault/wabt/wasm-objdump+0x55a6a6)
#3 0x579a5e (/home/dwfault/wabt/wasm-objdump+0x579a5e)
#4 0x572b02 (/home/dwfault/wabt/wasm-objdump+0x572b02)
#5 0x556571 (/home/dwfault/wabt/wasm-objdump+0x556571)
#6 0x552383 (/home/dwfault/wabt/wasm-objdump+0x552383)
#7 0x553076 (/home/dwfault/wabt/wasm-objdump+0x553076)
#8 0x7f6ec608983f (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#9 0x45c198 (/home/dwfault/wabt/wasm-objdump+0x45c198)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x120a64)
==14531==ABORTING
```
|
wasm-objdump/wabt::ObjdumpNames::Set integer overflow after reading export items' index
|
https://api.github.com/repos/WebAssembly/wabt/issues/1520/comments
| 1 |
2020-08-17T03:42:02Z
|
2020-08-19T18:28:43Z
|
https://github.com/WebAssembly/wabt/issues/1520
| 679,910,440 | 1,520 |
[
"WebAssembly",
"wabt"
] |
[PoC.wasm.zip](https://github.com/WebAssembly/wabt/files/5073300/PoC.wasm.zip)
Reproduced on git commit commit 2a15fcb, 2020.08.14(latest version).
This is null pointer reference because wasm-decompile cannot handle the situation when if branch is empty. Here's the stack trace:
```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x000000010001cf9a wasm-decompile`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__is_long(this="") const at string:1420:22
* frame #1: 0x000000010001cd65 wasm-decompile`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__get_pointer(this="") const at string:1514:17
frame #2: 0x0000000100004575 wasm-decompile`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::data(this="") const at string:1242:79
frame #3: 0x000000010000e8d8 wasm-decompile`wabt::string_view::string_view(this=0x0000000104d62920, str="") at string-view.h:247:17
frame #4: 0x000000010000450d wasm-decompile`wabt::string_view::string_view(this=0x0000000104d62920, str="") at string-view.h:247:44
frame #5: 0x000000010034c17e wasm-decompile`unsigned long wabt::cat_compute_size<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [3]>(t="", args=<no value available>) [3]) at string-view.h:232:12
frame #6: 0x000000010034bfae wasm-decompile`unsigned long wabt::cat_compute_size<char [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [3]>(t=<no value available>, args="", args=<no value available>) [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [3]) at string-view.h:232:36
frame #7: 0x000000010034bd81 wasm-decompile`unsigned long wabt::cat_compute_size<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [3]>(t="unreachable", args=<no value available>, args="", args=<no value available>) [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [3]) at string-view.h:232:36
frame #8: 0x000000010034b91e wasm-decompile`unsigned long wabt::cat_compute_size<char [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [3]>(t=<no value available>, args="unreachable", args=<no value available>, args="", args=<no value available>) [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [3]) at string-view.h:232:36
frame #9: 0x000000010032f6d0 wasm-decompile`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > wabt::cat<char [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char [3]>(args=<no value available>, args="unreachable", args=<no value available>, args="", args=<no value available>) [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const (&) [3]) at string-view.h:238:15
frame #10: 0x00000001002c121b wasm-decompile`wabt::Decompiler::DecompileExpr(this=0x0000000104f38220, n=0x0000610000001870, parent=0x0000610000001740) at decompiler.cc:509:20
frame #11: 0x00000001002ba618 wasm-decompile`wabt::Decompiler::DecompileExpr(this=0x0000000104f38220, n=0x0000610000001740, parent=0x0000000000000000) at decompiler.cc:339:22
frame #12: 0x00000001002aa84a wasm-decompile`wabt::Decompiler::Decompile(this=0x0000000104f38220) at decompiler.cc:797:20
frame #13: 0x00000001002a612c wasm-decompile`wabt::Decompile(module=0x0000000105322510, options=0x00000001053220c0) at decompiler.cc:826:21
frame #14: 0x00000001000030c8 wasm-decompile`ProgramMain(argc=2, argv=0x00007ffeefbff6a0) at wasm-decompile.cc:104:18
frame #15: 0x0000000100004812 wasm-decompile`main(argc=2, argv=0x00007ffeefbff6a0) at wasm-decompile.cc:117:10
frame #16: 0x00007fff6e695cc9 libdyld.dylib`start + 1
```
The problem resides in wabt::Decompiler::DecompileExpr:
```
case ExprType::If: {
auto ife = cast<IfExpr>(n.e);
Value *elsep = nullptr;
if (!ife->false_.empty()) {
elsep = &args[2];
}
auto& thenp = args[1];
auto& ifs = args[0];
bool multiline = ifs.v.size() > 1 || thenp.v.size() > 1;
size_t width = ifs.width() + thenp.width();
if (elsep) {
width += elsep->width();
multiline = multiline || elsep->v.size() > 1;
}
multiline = multiline || width > target_exp_width;
if (multiline) {
auto if_start = string_view("if (");
IndentValue(ifs, if_start.size(), if_start);
ifs.v.back() += ") {";
IndentValue(thenp, indent_amount, {});
std::move(thenp.v.begin(), thenp.v.end(), std::back_inserter(ifs.v));
if (elsep) {
ifs.v.push_back("} else {");
IndentValue(*elsep, indent_amount, {});
std::move(elsep->v.begin(), elsep->v.end(), std::back_inserter(ifs.v));
}
ifs.v.push_back("}");
ifs.precedence = Precedence::If;
return std::move(ifs);
} else {
auto s = cat("if (", ifs.v[0], ") { ", thenp.v[0], " }"); //---------------->
if (elsep)
s += cat(" else { ", elsep->v[0], " }");
return Value{{std::move(s)}, Precedence::If};
}
}
```
It's pretty obvious. Empty if branch should be allowed as a decompiler. The decompiled code should be as follows.
```
global g_a:int = 0;
function f_a() {
let t0, t1 = unreachable, unreachable;
if (unreachable) { }
t0;
t1;
}
export function et():int {
return g_a
}
```
|
wasm-decompile/wabt::Decompiler::DecompileExpr cannot handle when if branch is empty.
|
https://api.github.com/repos/WebAssembly/wabt/issues/1519/comments
| 1 |
2020-08-14T08:09:07Z
|
2023-01-03T19:29:48Z
|
https://github.com/WebAssembly/wabt/issues/1519
| 678,982,992 | 1,519 |
[
"WebAssembly",
"wabt"
] |
[PoC.wasm.zip](https://github.com/WebAssembly/wabt/files/5072923/PoC.wasm.zip)
Reproduced on git commit commit 2a15fcb8ba45d43f6766bf76639b0071cd3a0913, 2020.08.14(latest version).
Here's the stack trace:
```
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x605000009000)
* frame #0: 0x00000001001d64b2 wasm-decompile`wabt::Node::operator=(this=0x00000001048501a0, rhs=0x0000605000009000) at decompiler-ast.h:66:17
frame #1: 0x00000001001d642f wasm-decompile`wabt::Node::Node(this=0x00000001048501a0, rhs=0x0000605000009000) at decompiler-ast.h:64:28
frame #2: 0x00000001001c478d wasm-decompile`wabt::Node::Node(this=0x00000001048501a0, rhs=0x0000605000009000) at decompiler-ast.h:64:20
frame #3: 0x00000001001d7949 wasm-decompile`std::__1::enable_if<(is_move_constructible<wabt::Node>::value) && (is_move_assignable<wabt::Node>::value), void>::type std::__1::swap<wabt::Node>(__x=0x0000605000009000, __y=0x0000608000008fa0) at type_traits:4593:9
frame #4: 0x00000001001d75c2 wasm-decompile`std::__1::__wrap_iter<wabt::Node*> std::__1::__rotate_forward<std::__1::__wrap_iter<wabt::Node*> >(__first=__wrap_iter<wabt::Node *> @ 0x0000000104940f40, __middle=__wrap_iter<wabt::Node *> @ 0x0000000104940f60, __last=__wrap_iter<wabt::Node *> @ 0x0000000104940f80) at algorithm:2337:9
frame #5: 0x00000001001d721c wasm-decompile`std::__1::__wrap_iter<wabt::Node*> std::__1::__rotate<std::__1::__wrap_iter<wabt::Node*> >(__first=__wrap_iter<wabt::Node *> @ 0x0000000104940e40, __middle=__wrap_iter<wabt::Node *> @ 0x0000000104940e60, __last=__wrap_iter<wabt::Node *> @ 0x0000000104940e80, (null)=random_access_iterator_tag @ 0x00007ffeefbfe658) at algorithm:2461:12
frame #6: 0x00000001001c599d wasm-decompile`std::__1::__wrap_iter<wabt::Node*> std::__1::rotate<std::__1::__wrap_iter<wabt::Node*> >(__first=__wrap_iter<wabt::Node *> @ 0x0000000104940d40, __middle=__wrap_iter<wabt::Node *> @ 0x0000000104940d60, __last=__wrap_iter<wabt::Node *> @ 0x0000000104940d80) at algorithm:2473:12
frame #7: 0x00000001001ab95a wasm-decompile`wabt::AST::Construct(this=0x0000000104d195c0, es=0x00006120000074d0, nresults=0, nparams=0, is_function_body=true) at decompiler-ast.h:292:13
frame #8: 0x00000001001a5491 wasm-decompile`wabt::Decompiler::Decompile(this=0x0000000104938c20) at decompiler.cc:767:13
frame #9: 0x00000001001a3557 wasm-decompile`wabt::Decompile(module=0x0000000104d17510, options=0x0000000104d170c0) at decompiler.cc:826:21
frame #10: 0x0000000100003688 wasm-decompile`ProgramMain(argc=2, argv=0x00007ffeefbff6a8) at wasm-decompile.cc:104:18
frame #11: 0x0000000100004692 wasm-decompile`main(argc=2, argv=0x00007ffeefbff6a8) at wasm-decompile.cc:117:10
frame #12: 0x00007fff6e695cc9 libdyld.dylib`start + 1
frame #13: 0x00007fff6e695cc9 libdyld.dylib`start + 1
```
The problem resides in the 7th frame.
```C++
void Construct(const ExprList& es, Index nresults, Index nparams, bool is_function_body) {
block_stack.push_back(cur_block_id);
cur_block_id = blocks_closed.size();
blocks_closed.push_back(false);
auto start = exp_stack.size();
auto value_stack_depth_start = value_stack_depth - nparams;
auto value_stack_in_variables = value_stack_depth;
bool unreachable = false;
for (auto& e : es) {
Construct(e);
auto arity = mc.GetExprArity(e);
value_stack_depth -= arity.nargs;
value_stack_in_variables = std::min(value_stack_in_variables,
value_stack_depth);
unreachable = unreachable || arity.unreachable;
assert(unreachable || value_stack_depth >= value_stack_depth_start);
value_stack_depth += arity.nreturns;
...
```
value_stack_depth has a value of -2(0xfffffffe), because of arith result with ir instructions' mc.GetExprArity. The sequence of the ir instructions are:
```
Const LocalGet Load LocalGet Load Unreachable Unreachable LocalGet Load Return Unreachable BrIf Nop Store
```
And the crash happens when dealing with "Store".
Then, because value_stack_depth is defined as "auto", as well as "num_vars", the compilers treat them as unsigned int. So "num_vars" -2 is a huge number 0xfffffffe(4294967294), then following memory access result in out-of-bounds. For example, a valid variable is as follows:

But actually accessing somewhere far way:

The AddressSanitizer report it as heap Use-After-Free vulnerability, but it's actually a Out-Of-Bounds memory access caused by an integer overflow. Maybe the area accessed is just a previously freed area by chance. The ASAN log is as follows:
```
==16467==ERROR: AddressSanitizer: heap-use-after-free on address 0x6080000011f0 at pc 0x0000005d646f bp 0x7ffc2d5c4670 sp 0x7ffc2d5c4668
READ of size 4 at 0x6080000011f0 thread T0
#0 0x5d646e (/home/dwfault/wabt/wasm-decompile+0x5d646e)
#1 0x5d5f68 (/home/dwfault/wabt/wasm-decompile+0x5d5f68)
#2 0x5b8c89 (/home/dwfault/wabt/wasm-decompile+0x5b8c89)
#3 0x5b1dd1 (/home/dwfault/wabt/wasm-decompile+0x5b1dd1)
#4 0x5af5fd (/home/dwfault/wabt/wasm-decompile+0x5af5fd)
#5 0x567839 (/home/dwfault/wabt/wasm-decompile+0x567839)
#6 0x7f9ab6a5183f (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#7 0x4707f8 (/home/dwfault/wabt/wasm-decompile+0x4707f8)
0x6080000011f0 is located 80 bytes inside of 96-byte region [0x6080000011a0,0x608000001200)
freed by thread T0 here:
#0 0x563220 (/home/dwfault/wabt/wasm-decompile+0x563220)
#1 0x5d5bbc (/home/dwfault/wabt/wasm-decompile+0x5d5bbc)
#2 0x5af5fd (/home/dwfault/wabt/wasm-decompile+0x5af5fd)
#3 0x567839 (/home/dwfault/wabt/wasm-decompile+0x567839)
#4 0x7f9ab6a5183f (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
previously allocated by thread T0 here:
#0 0x5624e0 (/home/dwfault/wabt/wasm-decompile+0x5624e0)
#1 0x5d526f (/home/dwfault/wabt/wasm-decompile+0x5d526f)
SUMMARY: AddressSanitizer: heap-use-after-free (/home/dwfault/wabt/wasm-decompile+0x5d646e)
Shadow bytes around the buggy address:
0x0c107fff81e0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fa
0x0c107fff81f0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa
0x0c107fff8200: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa
0x0c107fff8210: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd
0x0c107fff8220: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c107fff8230: fa fa fa fa fd fd fd fd fd fd fd fd fd fd[fd]fd
0x0c107fff8240: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fff8250: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fff8260: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fff8270: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c107fff8280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==16467==ABORTING
```
|
wasm-decompile/wabt::AST::Construct cannot handle a specific stack unbalanced scenario result in a memory corruption.
|
https://api.github.com/repos/WebAssembly/wabt/issues/1518/comments
| 2 |
2020-08-14T06:44:20Z
|
2023-01-03T19:30:43Z
|
https://github.com/WebAssembly/wabt/issues/1518
| 678,940,819 | 1,518 |
[
"WebAssembly",
"wabt"
] |
Getting this error when compiling our rust project. Have been unsuccessful in finding a workaround. Seems to be affecting all our machines running Ubuntu 18.04.
```
Caused by:
process didn't exit successfully: `/root/edgeware-node/target/release/build/wabt-sys-ff144c8369c2e02a/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=WABT_CXXSTDLIB
cargo:rerun-if-env-changed=CXXSTDLIB
running: "cmake" "/root/.cargo/registry/src/github.com-1ecc6299db9ec823/wabt-sys-0.8.0/wabt" "-DBUILD_TESTS=OFF" "-DBUILD_TOOLS=OFF" "-DCMAKE_INSTALL_PREFIX=/root/edgeware-node/target/release/build/wabt-sys-b6a4798c3bb04c11/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
-- Configuring done
-- Generating done
-- Build files have been written to: /root/edgeware-node/target/release/build/wabt-sys-b6a4798c3bb04c11/out/build
running: "cmake" "--build" "." "--config" "Release" "--"
[ 1%] Building CXX object CMakeFiles/wabt.dir/src/option-parser.cc.o
CMakeFiles/wabt.dir/build.make:686: recipe for target 'CMakeFiles/wabt.dir/src/option-parser.cc.o' failed
CMakeFiles/Makefile2:136: recipe for target 'CMakeFiles/wabt.dir/all' failed
Makefile:83: recipe for target 'all' failed
--- stderr
/root/.cargo/registry/src/github.com-1ecc6299db9ec823/wabt-sys-0.8.0/wabt/src/option-parser.cc: In lambda function:
/root/.cargo/registry/src/github.com-1ecc6299db9ec823/wabt-sys-0.8.0/wabt/src/option-parser.cc:60:20: error: ‘CMAKE_PROJECT_VERSION’ was not declared in this scope
printf("%s\n", CMAKE_PROJECT_VERSION);
^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/wabt.dir/src/option-parser.cc.o] Error 1
make[1]: *** [CMakeFiles/wabt.dir/all] Error 2
make: *** [all] Error 2
thread 'main' panicked at '
command did not execute successfully, got: exit code: 2
build script failed, must exit now', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
|
Failing to compile wabt-sys 0.8.0 due to undeclared CMAKE_PROJECT_VERSION
|
https://api.github.com/repos/WebAssembly/wabt/issues/1514/comments
| 5 |
2020-08-10T19:45:01Z
|
2020-08-10T21:28:12Z
|
https://github.com/WebAssembly/wabt/issues/1514
| 676,372,323 | 1,514 |
[
"WebAssembly",
"wabt"
] |
In the project README, under *Supported Proposals*, it lists the flags for the various proposals, and says the following:
* Proposal: Name and link to the WebAssembly proposal repo
* flag: Flag to pass to the tool to enable support for the feature
* binary: Whether wabt can read/write the binary format
* text: Whether wabt can read/write the text format
* validate: Whether wabt can validate the syntax
* interpret: Whether wabt can execute these operations in wasm-interp or spectest-interp
This implies that the `multi-value` flag (for example) is required for the tools to parse multi-value WAT syntax or to generate the corresponding binary code. However, I am able to compile and run WAT code that uses the multi-value feature, without passing any flags to the tool (obviously, the feature is enabled in my browser).
In short, the README doesn't explain what the flags do very clearly.
|
Clarify how Supported Proposals work.
|
https://api.github.com/repos/WebAssembly/wabt/issues/1513/comments
| 3 |
2020-08-10T02:17:39Z
|
2020-08-11T23:59:58Z
|
https://github.com/WebAssembly/wabt/issues/1513
| 675,823,830 | 1,513 |
[
"WebAssembly",
"wabt"
] |
I'm new to WASM, I just want to reverse a WASM program. I tried to compile the C code generated by wasm2c, but I got some errors:
```
/usr/bin/ld: /tmp/ccZq4O8u.o: in function `w2c_f20':
program.c:(.text+0x1698): undefined reference to `Z_envZ_boomZ_vii'
/usr/bin/ld: /tmp/ccZq4O8u.o: in function `w2c_f28':
program.c:(.text+0xe08a): undefined reference to `Z_wasi_unstableZ_clock_time_getZ_iiji'
/usr/bin/ld: /tmp/ccZq4O8u.o: in function `w2c_f29':
program.c:(.text+0xe1b5): undefined reference to `Z_wasi_unstableZ_proc_exitZ_vi'
/usr/bin/ld: /tmp/ccZq4O8u.o: in function `w2c_f31':
program.c:(.text+0xe240): undefined reference to `Z_wasi_unstableZ_fd_closeZ_ii'
```
It seems that the definition of WASI is missing. I noticed that the program uses [wasmer](https://github.com/wasmerio/wasmer) to run the .wasm, But I can't figure out how it works in a short time.
Can someone tell me where to find the definition of these functions? Thanks a lot!
|
[wasm2c] C code is unable to compile, undefined reference to `WASI_xx`
|
https://api.github.com/repos/WebAssembly/wabt/issues/1510/comments
| 3 |
2020-08-07T13:32:41Z
|
2020-08-10T02:55:56Z
|
https://github.com/WebAssembly/wabt/issues/1510
| 675,019,188 | 1,510 |
[
"WebAssembly",
"wabt"
] |
[wasm2c
|
https://api.github.com/repos/WebAssembly/wabt/issues/1509/comments
| 0 |
2020-08-07T13:11:48Z
|
2020-08-07T14:05:38Z
|
https://github.com/WebAssembly/wabt/issues/1509
| 675,006,586 | 1,509 |
|
[
"WebAssembly",
"wabt"
] |
Noticed by the binaryen fuzzer's wasm2c integration.
Background and testcase: https://github.com/WebAssembly/spec/issues/1224
Spec tests are added in https://github.com/WebAssembly/spec/pull/1225
|
[wasm2c] Truncation of values slightly less than INT32_MIN is wrong
|
https://api.github.com/repos/WebAssembly/wabt/issues/1499/comments
| 1 |
2020-07-27T19:51:44Z
|
2022-04-27T17:53:09Z
|
https://github.com/WebAssembly/wabt/issues/1499
| 666,543,782 | 1,499 |
[
"WebAssembly",
"wabt"
] |
```
(module
(type $f_t (func (param $v i64) (result i64)))
(func $f (type $f_t) (get_local $v))
)
```
```
test.wat:3:35: error: undefined local variable "$v"
(func $f (type $f_t) (get_local $v))
```
`wat2wasm` currently doesn't accept that, and I don't know if it should.
I don't know if the WASM text format spec wants us to recognize that $v is declared in type $f_t.
Is it reasonable to refer to the name of a parameter in a separately-defined type, or should a producer generally emit wat that inlines the function type declarations into the function declaration?
|
Question: Should `local.get $v` work when `$v` is the name of a parameter declared via a separate type?
|
https://api.github.com/repos/WebAssembly/wabt/issues/1496/comments
| 3 |
2020-07-23T08:23:05Z
|
2020-07-25T10:48:09Z
|
https://github.com/WebAssembly/wabt/issues/1496
| 664,288,753 | 1,496 |
[
"WebAssembly",
"wabt"
] |
When working with a small reftypes module:
```wasm
(module
(func
ref.null func
ref.is_null
drop))
```
I think that output of `wasm2wat` is missing a newline after the `ref.is_null`:
```
$ wat2wasm --enable-all foo.wat -o foo.wasm
$ wasm2wat --enable-all foo.wasm
(module
(type (;0;) (func))
(func (;0;) (type 0)
ref.null func
ref.is_null drop))
```
which while valid, doesn't quite stylistically match the other instructions! (and I assume this is just a mistake)
|
Missing newline after `ref.is_null` in `wasm2wat`
|
https://api.github.com/repos/WebAssembly/wabt/issues/1493/comments
| 1 |
2020-07-21T22:36:06Z
|
2020-09-02T20:52:23Z
|
https://github.com/WebAssembly/wabt/issues/1493
| 663,351,261 | 1,493 |
[
"WebAssembly",
"wabt"
] |
The test located at [`test/desugar/locals.txt`](https://github.com/WebAssembly/wabt/blob/cd5ff133f84854f0b269f5cb06193ad8205f05d3/test/desugar/locals.txt) which looks like:
```wasm
(module
(type (func (param i32) (result i32)))
(func (type 0) (local $var i32)
(local.get 0)
(local.tee $var)))
```
will give `$var` local index 0, but in this case shouldn't it get local index 1? I saw this test was added recently 6bff9f079 which looks like it was intended to address the issue, but is this an accident?
tested with:
```
$ wat2wasm test/desugar/locals.txt -o foo.wasm
$ wasm2wat foo.wasm
...
local.tee 0))
```
|
Numbering of `local.get` may not account for parameters
|
https://api.github.com/repos/WebAssembly/wabt/issues/1492/comments
| 1 |
2020-07-21T22:33:13Z
|
2020-09-02T20:51:20Z
|
https://github.com/WebAssembly/wabt/issues/1492
| 663,350,152 | 1,492 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.