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"
] |
Hi 👋 and thanks for the super-helpful project!
On my Mac I ca reproduce as follows (in a tmp folder):
```bash
git clone https://github.com/WebAssembly/testsuite.git
wget https://github.com/WebAssembly/wabt/releases/download/1.0.34/wabt-1.0.34-macos-12.tar.gz
./wabt-1.0.34/bin/wast2json ./testsuite/if.wast
```
Produces the unexpected result:
```bash
./testsuite/if.wast:533:33: error: unexpected token (, expected ).
(if (i32.const 1) (i32.eqz) (then) (else))
^
./testsuite/if.wast:537:17: error: unexpected token "invoke", expected an instr.
(assert_return (invoke "empty" (i32.const 0)))
^^^^^^
```
The regression seems to be caused by this diff:
https://github.com/WebAssembly/testsuite/commit/26d62d0ad297b14218807cd20d9b568e11ec7bd9#diff-76c78c41ca3eaa954f864741d9462243de307c6e0ca747b7bcab93fba9767837
|
`wast2json` fails to parse `if.wast` from latest testsuite
|
https://api.github.com/repos/WebAssembly/wabt/issues/2347/comments
| 4 |
2023-12-04T11:45:29Z
|
2023-12-05T18:47:39Z
|
https://github.com/WebAssembly/wabt/issues/2347
| 2,023,666,826 | 2,347 |
[
"WebAssembly",
"wabt"
] |
I have a 16-core 7950X and a 16-core M3 MBP. They both build the Firefox source code in roughly the same amount of time...or would, but for the `wasm2c` invocation takes about 1 minute on the former and over 3 minutes on the latter.
For further discussion see: https://bugzilla.mozilla.org/show_bug.cgi?id=1867594#c6
Are there known reasons for wasm2c taking multiple times as long on ARM, and is there any prospect of that improving?
|
wasm2c is multiple times slower on Apple ARM processors (M3) than x86-64
|
https://api.github.com/repos/WebAssembly/wabt/issues/2343/comments
| 2 |
2023-12-01T20:17:26Z
|
2024-01-25T19:39:23Z
|
https://github.com/WebAssembly/wabt/issues/2343
| 2,021,527,656 | 2,343 |
[
"WebAssembly",
"wabt"
] |
Hi @everyone,
I need assistance with using the "wat2wasm" conversion tool correctly.
- For demonstration, I have chosen the file "left-to-right.wast," available [here](https://github.com/WebAssembly/testsuite/blob/dc27dad3e34e466bdbfea32fe3c73f5e31f88560/left-to-right.wast).
- When using the "wat2wasm" tool, I encountered an error: "error: unexpected token" at line 181, as depicted in this screenshot:
.
- For testing purposes, I eliminated all statements after line 180. The modified file is shown here:
.
- This change allowed the tool to function correctly, as seen in this screenshot:
.
- I noticed similar results with these tools:
- [demo/wat2wasm](https://webassembly.github.io/wabt/demo/wat2wasm/)

- [bytecodealliance/wasm-tools](https://github.com/bytecodealliance/wasm-tools)

- Could I be missing any specific option flags or not using the correct test specification? Your guidance would be helpful.
|
Need Help | wat2wasm: "error: unexpected token"
|
https://api.github.com/repos/WebAssembly/wabt/issues/2337/comments
| 5 |
2023-11-27T12:30:13Z
|
2023-11-29T16:21:55Z
|
https://github.com/WebAssembly/wabt/issues/2337
| 2,012,171,181 | 2,337 |
[
"WebAssembly",
"wabt"
] |
I can see that _wat2wasm_ does have the option to enable "gc", but when running the example below (with all features enabled), it fail. The example is from the article: https://v8.dev/blog/wasm-gc-porting
```wat
(module
(type $Node (struct (field $next (ref null $Node)) (field $value (mut i32))))
(global $global (mut (ref null $Node)) (ref.null $Node))
(export "global" (global $global))
(export "_start" (func $_start))
(func $_start
(local $i i32)
(loop $loop
(global.set $global
(struct.new $Node
(global.get $global)
(local.get $i)
)
)
(local.set $i
(i32.add
(local.get $i)
(i32.const 1)
)
)
(br_if $loop
(i32.le_u
(local.get $i)
(i32.const 1000)
)
)
)
)
)
```
The error:
```
Error: parseWat failed:
test.wast:2:41: error: unexpected token "null", expected a numeric index or a name (e.g. 12 or $foo).
(type $Node (struct (field $next (ref null $Node)) (field $value (mut i32))))
```
Is there any roadmap for the GC spec in _wat2wasm_?
|
Unexpected token "null" with WasmGC example
|
https://api.github.com/repos/WebAssembly/wabt/issues/2333/comments
| 1 |
2023-11-20T09:17:52Z
|
2023-12-05T01:24:35Z
|
https://github.com/WebAssembly/wabt/issues/2333
| 2,001,710,359 | 2,333 |
[
"WebAssembly",
"wabt"
] |
wasm2c memories currently only take size into account. Splitting into size and capacity would impact threads/shared memory support (since realloc is unsound) but is also relevant for big-endian (both guard pages and shared memory). cc @shravanrn
(This also lets the runtime use more efficient memory growth strategies, if desired.)
|
wasm2c: Split size and capacity
|
https://api.github.com/repos/WebAssembly/wabt/issues/2329/comments
| 0 |
2023-11-15T10:08:39Z
|
2023-11-15T10:09:33Z
|
https://github.com/WebAssembly/wabt/issues/2329
| 1,994,455,065 | 2,329 |
[
"WebAssembly",
"wabt"
] |
Instead of merely emitting data segments as array initializers, it would be neat if we could (optionally) use `#embed` too.
Too bad `offset(...)` isn't standard so we'll need to emit separate files for each data segment.
|
wasm2c: Optionally support #embed
|
https://api.github.com/repos/WebAssembly/wabt/issues/2325/comments
| 7 |
2023-11-11T12:36:28Z
|
2023-11-12T07:06:48Z
|
https://github.com/WebAssembly/wabt/issues/2325
| 1,988,929,525 | 2,325 |
[
"WebAssembly",
"wabt"
] |
wasm2c.exe on Windows 10, ran through MSys2, does nothing at all since wabt 1.0.33. Nothing in stdout, nothing in output files, it appears to just not do anything. Only wabt 1.0.32 works correctly.
The following are tested using the last 3 releases named `wabt-1.0.3x-windows.tar.gz`
```
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.32/bin/wasm2c.exe
wasm2c: expected filename argument.
Try '--help' for more information.
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.33/bin/wasm2c.exe
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm2c.exe
user@DESKTOP-AP5KGUV ~/home/wasm_app
$
```
All the other utilities appear to work correctly in wabt 1.0.34:
```
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm-decompile.exe
wasm-decompile: expected filename argument.
Try '--help' for more information.
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm-objdump.exe
wasm-objdump: expected filename argument.
Try '--help' for more information.
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm-strip.exe
wasm-strip: expected filename argument.
Try '--help' for more information.
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm2c.exe
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm-interp.exe
wasm-interp: expected filename argument.
Try '--help' for more information.
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm-stats.exe
wasm-stats: expected filename argument.
Try '--help' for more information.
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm-validate.exe
wasm-validate: expected filename argument.
Try '--help' for more information.
user@DESKTOP-AP5KGUV ~/home/wasm_app
$/home/lib/wabt-1.0.34/bin/wasm2wat.exe
wasm2wat: expected filename argument.
Try '--help' for more information.
```
|
wasm2c does nothing at all
|
https://api.github.com/repos/WebAssembly/wabt/issues/2323/comments
| 4 |
2023-11-08T11:05:54Z
|
2023-12-05T18:37:14Z
|
https://github.com/WebAssembly/wabt/issues/2323
| 1,983,344,340 | 2,323 |
[
"WebAssembly",
"wabt"
] |
## Environments
**OS** : Ubuntu 18.04 5.4.0-150-generic
**Commit** : e97d53c5fcbb604fc36432df4fc117d13558d7fd
**Version** : 1.0.34
## Vulnerability Description
**Affected Tool** : wasm-decompile
**Affected Version** : <= 1.0.34
**Impact** : Denial of Service
* The assertion 'false' in /src/decompiler.cc:414( in wabt 1.0.34 can cause a denial of service(assertion failure) via a crafted wasm file.
```CC
case NodeType::Uninitialized:
assert(false);
break;
```
## PoC
**1. Input File**
[wasm-decompile-PoC.zip](https://github.com/WebAssembly/wabt/files/13260356/wasm-decompile-PoC.zip)
**2. Reproduce**
```shell
$ ~/wabt/bin/wasm-decompile wasm-decompile-PoC
```
**3. Stack Trace**
```shell
$ ~/wabt/bin/wasm-decompile wasm-decompile-PoC
wasm-decompile: ../../../../src/decompiler.cc:414: wabt::Decompiler::Value wabt::Decompiler::DecompileExpr(const wabt::Node &, const wabt::Node *): Assertion `false' failed.
Aborted
```
|
wasm-decompile: Assertion `false' failed.
|
https://api.github.com/repos/WebAssembly/wabt/issues/2322/comments
| 1 |
2023-11-06T05:27:20Z
|
2023-11-06T05:44:07Z
|
https://github.com/WebAssembly/wabt/issues/2322
| 1,978,321,551 | 2,322 |
[
"WebAssembly",
"wabt"
] |
I noticed that wasm-objdump can dump all functions and symbols
but it does it weirdly
it doesen't quite go functions (then their data) it seems to switch between all the diffrent data assocated whether being size, where it is pulled from etc
|
[Feature/Binary Request] List Exported functions only
|
https://api.github.com/repos/WebAssembly/wabt/issues/2320/comments
| 11 |
2023-11-02T19:23:17Z
|
2023-11-04T06:03:57Z
|
https://github.com/WebAssembly/wabt/issues/2320
| 1,974,904,203 | 2,320 |
[
"WebAssembly",
"wabt"
] |
## Environments
**OS** : Ubuntu 18.04 5.4.0-150-generic
**Commit** : e97d53c5fcbb604fc36432df4fc117d13558d7fd
**Version** : 1.0.34
## Vulnerability Description
**Affected Tool** : wasm2c
**Affected Version** : <= 1.0.34
**Impact** : Denial of Service
* The 'std::out_of_range' error in wabt 1.0.34 can cause a denial of service or crash via a crafted wasm file.
## PoC
**1. Input File**
[wasm2c-DOS-poc01.zip](https://github.com/WebAssembly/wabt/files/13198284/wasm2c-DOS-poc01.zip)
**2. Reproduce**
```shell
$ ~/wabt/bin/wasm2c wasm2c-DOS-poc01 -o /dev/null
```
**3. Stack Trace**
```shell
$ ~/wabt/bin/wasm2c wasm2c-DOS-poc01 -o /dev/null
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string_view::substr: __pos (which is 18446744073709551615) > this->size() (which is 9)
Aborted
```
|
Invalid basic_string_view::substr:__pos() number cause DoS
|
https://api.github.com/repos/WebAssembly/wabt/issues/2318/comments
| 2 |
2023-10-29T14:22:47Z
|
2023-11-05T17:19:28Z
|
https://github.com/WebAssembly/wabt/issues/2318
| 1,967,011,228 | 2,318 |
[
"WebAssembly",
"wabt"
] |
## Environments
**OS** : Ubuntu 18.04 5.4.0-150-generic
**Commit** : e97d53c5fcbb604fc36432df4fc117d13558d7fd
**Version** : 1.0.34
## Vulnerability Description
**Affected Tool** : wasm-decompile
**Affected Version** : <= 1.0.34
**Impact** : Denial of Service
* The assertion 'exp_stack.size() >= nargs' fail in /include/wabt/decompiler-ast.h in wabt 1.0.34 can cause a denial of service(assertion failure) via a crafted wasm file.
## PoC
**1. Input File**
[wasm-decompile-DOS-poc02.zip](https://github.com/WebAssembly/wabt/files/13198265/wasm-decompile-DOS-poc02.zip)
**2. Reproduce**
```shell
$ ~/wabt/bin/wasm-decompile wasm-decompile-DOS-poc02
```
**3. Stack Trace**
```shell
$ ~/wabt/bin/wasm-decompile wasm-decompile-DOS-poc02
wasm-decompile: ../../../../include/wabt/decompiler-ast.h:98: wabt::Node &wabt::AST::InsertNode(wabt::NodeType, wabt::ExprType, const wabt::Expr *, wabt::Index): Assertion `exp_stack.size() >= nargs' failed.
Aborted
```
|
wasm-decompile: Assertion `exp_stack.size() >= nagrs' failure cause DoS
|
https://api.github.com/repos/WebAssembly/wabt/issues/2317/comments
| 0 |
2023-10-29T14:09:33Z
|
2023-10-29T14:09:33Z
|
https://github.com/WebAssembly/wabt/issues/2317
| 1,967,006,559 | 2,317 |
[
"WebAssembly",
"wabt"
] |
## Environments
**OS** : Ubuntu 18.04 5.4.0-150-generic
**Commit** : e97d53c5fcbb604fc36432df4fc117d13558d7fd
**Version** : 1.0.34
## Vulnerability Description
**Affected Tool** : wasm-decompile
**Affected Version** : <= 1.0.34
**Impact** : Denial of Service
* The assertion '!empty()' fail in /include/wabt/intrusive-list.h in wabt 1.0.34 can cause a denial of service(assertion failure) via a crafted wasm file.
## PoC
**1. Input File**
[wasm-decompile-DOS-poc01.zip](https://github.com/WebAssembly/wabt/files/13198250/wasm-decompile-DOS-poc01.zip)
**2. Reproduce**
```shell
$ ~/wabt/bin/wasm-decompile wasm-decompile-DOS-poc01
```
**3. Stack Trace**
```shell
$ ~/wabt/bin/wasm-decompile wasm-decompile-DOS-poc01
wasm-decompile: ../../../../include/wabt/intrusive-list.h:394: typename intrusive_list<T>::const_reference wabt::intrusive_list<wabt::Expr>::front() const [T = wabt::Expr]: Assertion `!empty()' failed.
Aborted
```
|
wasm-decompile: Assertion `!empty()' failure cause DoS
|
https://api.github.com/repos/WebAssembly/wabt/issues/2316/comments
| 0 |
2023-10-29T14:03:47Z
|
2023-10-29T14:03:47Z
|
https://github.com/WebAssembly/wabt/issues/2316
| 1,967,004,525 | 2,316 |
[
"WebAssembly",
"wabt"
] |
## Environments
**OS** : Ubuntu 18.04 5.4.0-150-generic
**Commit** : e97d53c5fcbb604fc36432df4fc117d13558d7fd
**Version** : 1.0.34
## Vulnerability Description
**Affected Tool** : wasm-interp
**Affected Version** : <= 1.0.34
**Impact** : Denial of Service
* The ReadBinaryInterp function in src/interp/binary-reader-interp.cc in wabt 1.0.34 can cause a denial of service(memory allocation error) via a crafted wasm file.
## PoC
**1. Input File**
[wasm-interp-DOS-poc01.zip](https://github.com/WebAssembly/wabt/files/13198216/wasm-interp-DOS-poc01.zip)
**2. Reproduce**
```shell
$ ~/wabt/bin/wasm-interp wasm-interp-DOS-poc01.wasm
```
**3. Stack Trace**
```shell
$ ~/wabt/bin/wasm-interp wasm-interp-DOS-poc01.wasm
==3917==AddressSanitizer's allocator is terminating the process instead of returning 0
==3917==If you don't like this behavior set allocator_may_return_null=1
==3917==AddressSanitizer CHECK failed: /build/llvm-toolchain-6.0-QjOn7h/llvm-toolchain-6.0-6.0/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:225 "((0)) != (0)" (0x0, 0x0)
#0 0x4e5935 in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/home/dskim/wabt/bin/wasm-interp+0x4e5935)
#1 0x5031e5 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/home/dskim/wabt/bin/wasm-interp+0x5031e5)
#2 0x4ebd26 in __sanitizer::ReportAllocatorCannotReturnNull() (/home/dskim/wabt/bin/wasm-interp+0x4ebd26)
#3 0x4ebd8d in __sanitizer::ReturnNullOrDieOnFailure::OnOOM() (/home/dskim/wabt/bin/wasm-interp+0x4ebd8d)
#4 0x4276de in __asan::Allocator::Allocate(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool) (/home/dskim/wabt/bin/wasm-interp+0x4276de)
#5 0x427b27 in __asan::asan_memalign(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType) (/home/dskim/wabt/bin/wasm-interp+0x427b27)
#6 0x514d5f in operator new(unsigned long) (/home/dskim/wabt/bin/wasm-interp+0x514d5f)
#7 0x5b18fb in __gnu_cxx::new_allocator<wabt::interp::DataDesc>::allocate(unsigned long, void const*) /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ext/new_allocator.h:111:27
#8 0x5b18fb in std::allocator_traits<std::allocator<wabt::interp::DataDesc> >::allocate(std::allocator<wabt::interp::DataDesc>&, unsigned long) /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/alloc_traits.h:436
#9 0x5b18fb in std::_Vector_base<wabt::interp::DataDesc, std::allocator<wabt::interp::DataDesc> >::_M_allocate(unsigned long) /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:172
#10 0x5b18fb in wabt::interp::DataDesc* std::vector<wabt::interp::DataDesc, std::allocator<wabt::interp::DataDesc> >::_M_allocate_and_copy<std::move_iterator<wabt::interp::DataDesc*> >(unsigned long, std::move_iterator<wabt::interp::DataDesc*>, std::move_iterator<wabt::interp::DataDesc*>) /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:1260
#11 0x5b18fb in std::vector<wabt::interp::DataDesc, std::allocator<wabt::interp::DataDesc> >::reserve(unsigned long) /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/vector.tcc:73
#12 0x596d95 in wabt::interp::(anonymous namespace)::BinaryReaderInterp::OnDataCount(unsigned int) /home/dskim/wabt/out/clang/Debug/asan/../../../../src/interp/binary-reader-interp.cc:756:17
#13 0x6f28ce in wabt::(anonymous namespace)::BinaryReader::ReadDataCountSection(unsigned long) /home/dskim/wabt/out/clang/Debug/asan/../../../../src/binary-reader.cc:2846:3
#14 0x6f28ce in wabt::(anonymous namespace)::BinaryReader::ReadSections(wabt::(anonymous namespace)::BinaryReader::ReadSectionsOptions const&) /home/dskim/wabt/out/clang/Debug/asan/../../../../src/binary-reader.cc:2969
#15 0x6eef6e in wabt::(anonymous namespace)::BinaryReader::ReadModule(wabt::(anonymous namespace)::BinaryReader::ReadModuleOptions const&) /home/dskim/wabt/out/clang/Debug/asan/../../../../src/binary-reader.cc:3012:3
#16 0x6eef6e in wabt::ReadBinary(void const*, unsigned long, wabt::BinaryReaderDelegate*, wabt::ReadBinaryOptions const&) /home/dskim/wabt/out/clang/Debug/asan/../../../../src/binary-reader.cc:3029
#17 0x56b7df in wabt::interp::ReadBinaryInterp(std::basic_string_view<char, std::char_traits<char> >, void const*, unsigned long, wabt::ReadBinaryOptions const&, std::vector<wabt::Error, std::allocator<wabt::Error> >*, wabt::interp::ModuleDesc*) /home/dskim/wabt/out/clang/Debug/asan/../../../../src/interp/binary-reader-interp.cc:1604:10
#18 0x51cbdd in ProgramMain(int, char**) /home/dskim/wabt/out/clang/Debug/asan/../../../../src/tools/wasm-interp.cc:324:3
#19 0x7f7407598c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
#20 0x41c929 in _start (/home/dskim/wabt/bin/wasm-interp+0x41c929)
```
|
Memory allocation error in ReadBinaryInterp() cause DoS
|
https://api.github.com/repos/WebAssembly/wabt/issues/2315/comments
| 0 |
2023-10-29T13:49:22Z
|
2023-10-29T13:49:22Z
|
https://github.com/WebAssembly/wabt/issues/2315
| 1,966,999,344 | 2,315 |
[
"WebAssembly",
"wabt"
] |
The wasm-stats tool outputs opcode counts for a wasm file. It would be really helpful if it could also build a markov chain from the opcodes in a wasm file, or the probability that a given opcode is followed by any other opcodes. As we now know, inlining isn't actually helpful with wasm, and such markov chains would help with analyzing areas of excessive inlining in wasm modules.
Might implement this ourselves... at some point. Been busy. If anyone else wants to work on it, do let us know so we can avoid duplicate work.
|
wasm-stats: support markov chain style listings
|
https://api.github.com/repos/WebAssembly/wabt/issues/2312/comments
| 7 |
2023-10-08T13:16:52Z
|
2023-10-10T06:56:17Z
|
https://github.com/WebAssembly/wabt/issues/2312
| 1,931,802,335 | 2,312 |
[
"WebAssembly",
"wabt"
] |
### Environment
```shell
OS : Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Commit : 0e78c24fd231d5ee67ccd271bfa317faa963281c
Version : 1.0.33 (git~1.0.33-35-gdddc03d3)
Clang Verison : 12.0.1
Build : mkdir build && cd build && export CC=clang CXX=clang++ CFLAGS="-fsanitize=address -g" CXXFLAGS="-fsanitize=address -g" && cmake .. && cmake --build .
Affected Tool : wasm-interp
Enabled Features : None
Impact : Out-of-Bound Memory Write Access
```
### Proof of Concept
[poc-wasm-interp-02.zip](https://github.com/WebAssembly/wabt/files/12840051/poc-wasm-interp-02.zip)
### Stack Trace Provide By AddressSanitizer
```shell
$ ~/wabt_asan/bin/wasm-interp poc.wasm
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3641==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x00000067f426 bp 0x7ffd04e28310 sp 0x7ffd04e28300 T0)
==3641==The signal is caused by a WRITE memory access.
==3641==Hint: address points to the zero page.
#0 0x67f426 in wabt::interp::DataSegment::Drop() /home/lain/wabt_asan/include/wabt/interp/interp-inl.h:906:9
#1 0x6670be in wabt::interp::Thread::DoDataDrop(wabt::interp::Instr) /home/lain/wabt_asan/src/interp/interp.cc:2081:33
#2 0x65b29a in wabt::interp::Thread::StepInternal(wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:1511:32
#3 0x65352b in wabt::interp::Thread::Run(int, wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:1086:19
#4 0x645a70 in wabt::interp::Thread::Run(wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:1078:14
#5 0x644caf in wabt::interp::DefinedFunc::DoCall(wabt::interp::Thread&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> > const&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> >&, wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:428:19
#6 0x64417d in wabt::interp::Func::Call(wabt::interp::Store&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> > const&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> >&, wabt::interp::RefPtr<wabt::interp::Trap>*, wabt::Stream*) /home/lain/wabt_asan/src/interp/interp.cc:394:10
#7 0x6512e6 in wabt::interp::Instance::Instantiate(wabt::interp::Store&, wabt::interp::Ref, std::vector<wabt::interp::Ref, std::allocator<wabt::interp::Ref> > const&, wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:944:22
#8 0x5693e5 in InstantiateModule(std::vector<wabt::interp::Ref, std::allocator<wabt::interp::Ref> >&, wabt::interp::RefPtr<wabt::interp::Module> const&, wabt::interp::RefPtr<wabt::interp::Instance>*) /home/lain/wabt_asan/src/tools/wasm-interp.cc:340:19
#9 0x562e82 in ReadAndRunModule(char const*) /home/lain/wabt_asan/src/tools/wasm-interp.cc:423:3
#10 0x561f67 in ProgramMain(int, char**) /home/lain/wabt_asan/src/tools/wasm-interp.cc:450:25
#11 0x563191 in main /home/lain/wabt_asan/src/tools/wasm-interp.cc:456:10
#12 0x7f77c7bdc082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#13 0x4845ed in _start (/home/lain/wabt_asan/bin/wasm-interp+0x4845ed)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/lain/wabt_asan/include/wabt/interp/interp-inl.h:906:9 in wabt::interp::DataSegment::Drop()
==3641==ABORTING
```
|
Out-of-Bound Memory Write in DataSegment::Drop()
|
https://api.github.com/repos/WebAssembly/wabt/issues/2311/comments
| 0 |
2023-10-08T07:46:31Z
|
2023-10-08T18:41:21Z
|
https://github.com/WebAssembly/wabt/issues/2311
| 1,931,692,043 | 2,311 |
[
"WebAssembly",
"wabt"
] |
### Environment
```shell
OS : Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Commit : 0e78c24fd231d5ee67ccd271bfa317faa963281c
Version : 1.0.33 (git~1.0.33-35-gdddc03d3)
Clang Verison : 12.0.1
Build : mkdir build && cd build && export CC=clang CXX=clang++ CFLAGS="-fsanitize=address -g" CXXFLAGS="-fsanitize=address -g" && cmake .. && cmake --build .
Affected Tool : wasm-interp
Enabled Features : None
Impact : Out-of-Bound Memory Read Access
```
### Proof of Concept
[poc-wasm-interp-01.zip](https://github.com/WebAssembly/wabt/files/12840027/poc-wasm-interp-01.zip)
### Stack Trace Provide By AddressSanitizer
```shell
$ ~/wabt_asan/bin/wasm-interp poc.wasm
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3549==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x00000064a0fe bp 0x7ffcceb61670 sp 0x7ffcceb61640 T0)
==3549==The signal is caused by a READ memory access.
==3549==Hint: address points to the zero page.
#0 0x64a0fe in wabt::interp::DataSegment::IsValidRange(unsigned long, unsigned long) const /home/lain/wabt_asan/src/interp/interp.cc:734:19
#1 0x649cd7 in wabt::interp::Memory::Init(unsigned long, wabt::interp::DataSegment const&, unsigned long, unsigned long) /home/lain/wabt_asan/src/interp/interp.cc:617:11
#2 0x666cb4 in wabt::interp::Thread::DoMemoryInit(wabt::interp::Instr, wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:2075:3
#3 0x65b199 in wabt::interp::Thread::StepInternal(wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:1510:32
#4 0x65352b in wabt::interp::Thread::Run(int, wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:1086:19
#5 0x645a70 in wabt::interp::Thread::Run(wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:1078:14
#6 0x644caf in wabt::interp::DefinedFunc::DoCall(wabt::interp::Thread&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> > const&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> >&, wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:428:19
#7 0x64417d in wabt::interp::Func::Call(wabt::interp::Store&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> > const&, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value> >&, wabt::interp::RefPtr<wabt::interp::Trap>*, wabt::Stream*) /home/lain/wabt_asan/src/interp/interp.cc:394:10
#8 0x6512e6 in wabt::interp::Instance::Instantiate(wabt::interp::Store&, wabt::interp::Ref, std::vector<wabt::interp::Ref, std::allocator<wabt::interp::Ref> > const&, wabt::interp::RefPtr<wabt::interp::Trap>*) /home/lain/wabt_asan/src/interp/interp.cc:944:22
#9 0x5693e5 in InstantiateModule(std::vector<wabt::interp::Ref, std::allocator<wabt::interp::Ref> >&, wabt::interp::RefPtr<wabt::interp::Module> const&, wabt::interp::RefPtr<wabt::interp::Instance>*) /home/lain/wabt_asan/src/tools/wasm-interp.cc:340:19
#10 0x562e82 in ReadAndRunModule(char const*) /home/lain/wabt_asan/src/tools/wasm-interp.cc:423:3
#11 0x561f67 in ProgramMain(int, char**) /home/lain/wabt_asan/src/tools/wasm-interp.cc:450:25
#12 0x563191 in main /home/lain/wabt_asan/src/tools/wasm-interp.cc:456:10
#13 0x7f9f8fa00082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#14 0x4845ed in _start (/home/lain/wabt_asan/bin/wasm-interp+0x4845ed)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/lain/wabt_asan/src/interp/interp.cc:734:19 in wabt::interp::DataSegment::IsValidRange(unsigned long, unsigned long) const
==3549==ABORTING
```
|
Out-of-Bound Memory Read in DataSegment::IsValidRange()
|
https://api.github.com/repos/WebAssembly/wabt/issues/2310/comments
| 0 |
2023-10-08T07:32:47Z
|
2023-10-08T18:41:08Z
|
https://github.com/WebAssembly/wabt/issues/2310
| 1,931,687,191 | 2,310 |
[
"WebAssembly",
"wabt"
] |
I am trying to understand how memory is shared between the host and a WebAssembly module (generated using `wasm2c` from an object file generated with `emcc`).
Consider the following very simple example:
```c
int foo(char *buff) {
return buff[0];
}
```
This is compiled using `emcc` and then `wasm2c` and `clang` to get an object file. However, the function signature eventually becomes:
```c
u32 w2c_unsafe_foo(w2c_unsafe*, u32);
```
I assume, based on the available WebAssembly types, there is no available (semantic) equivalence between the original C code and a WebAssembly representation?
In this case, naturally, passing a pointer to this function casts it to a `u32`, and then the `buff[0]` access causes a trap (I suppose because the pointer is to a region of memory outside of the WebAssembly module's allocated memory?).
What is the correct way to share memory in and out of a WebAssembly module? I have had a look at the [rot13 example](https://github.com/WebAssembly/wabt/blob/main/wasm2c/examples/rot13/main.c), but this uses a `.wat` file, where it is possible to import an external library (e.g., `host`). As was alluded to me elsewhere (https://github.com/WebAssembly/wabt/issues/2289#issuecomment-1701224778), this seems to be what is required to access 'things' (functions/memory) from the host.
Is it possible to do this in C code, which is then compiled into a WebAssebly module?
---
Based on the `rot13` example, I think I need to do something like the following:
```c
int foo() {
char buff[1024];
host_get_buff(buff, 1024);
return buff[0];
}
```
`host_get_buff` would be implemented in the host code and copy the relevant data into `buff`? The questions I have are as follows.
1. Copying into `buff` requires access to this region of memory in `host_get_buff`. In the ro13 example, this appears to be done by allocating a page into `w2c_host`, which is passed as the first argument to `host_get_buff` when it is called. I think the WebAssebly module is then set to use this page for all of its memory uses?
https://github.com/WebAssembly/wabt/blob/dddc03d3bc4df2bca26a880e8f078f84ea3d2454/wasm2c/examples/rot13/rot13.wat#L1
2. Given that the module appears to have its memory set 'globally' to that of `w2c_host`, does this mean that it is not possible to have multiple host libraries, each sharing data into the module? If it is, how could it be achieved?
3. I think that in my example, what I actually need is `buff` to be a pointer to a valid memory region from that allocated in the host by `wasm_rt_allocate_memory`? Then both the host and module can access this shared memory? But how do I guarantee this? Doesn't the C to WASM compiler decide what memory is used to back `buff`?
---
Suppose I wanted to pass a deep data structure from the host into a WebAssebly module. This structure has numerous pointers to sub-structures, pointers to buffers etc.
Am I correct in thinking that I need a function which is capable of deep-copying the data structure from one region of memory to another? Then, once copied to memory accessible by the WebAssembly module, any changes made by the module need to be copied back to the host?
If this is the case, then it is not too dissimilar to implementing IPC between two processes?
|
Sharing memory between the host and a WebAssembly module
|
https://api.github.com/repos/WebAssembly/wabt/issues/2307/comments
| 7 |
2023-09-27T13:51:22Z
|
2023-10-31T17:13:22Z
|
https://github.com/WebAssembly/wabt/issues/2307
| 1,915,640,569 | 2,307 |
[
"WebAssembly",
"wabt"
] |
Hello there, the following code snippet is the sample webassembly module (in textual format) I extracted from [here](https://github.com/WebAssembly/spec/blob/main/test/core/bulk.wast#L154):
```wasm
(module
(type (;0;) (func))
(type (;1;) (func (param i32)))
(func (;0;) (type 0)
data.drop 0)
(func (;1;) (type 1) (param i32)
i32.const 0
i32.const 0
local.get 0
memory.init 0)
(func (;2;) (type 0)
data.drop 1)
(func (;3;) (type 1) (param i32)
i32.const 0
i32.const 0
local.get 0
memory.init 1)
(func (;4;) (type 0)
i32.const 1
call 1
call 0
call 0
i32.const 0
call 1
i32.const 0
call 1
call 2
i32.const 0
call 3
i32.const 0
call 3)
(memory (;0;) 1)
(export "drop_passive" (func 0))
(export "init_passive" (func 1))
(export "drop_active" (func 2))
(export "init_active" (func 3))
(export "_start" (func 4))
(start 4)
(data (;0;) "x")
(data (;1;) (i32.const 0) "x"))
```
Since it comes from offical test suite, I assume it's semantically correct, however when running this wasm module with `wasm-interp`, it gives following error:
```sh
$ ~/wabt/bin/wasm-interp test.wasm -r "_start"
_start() => error: out of bounds memory access: memory.init out of bounds
```
Does anybody know why `wasm-interp` gives OOB error on this module? The `wabt` version I'm currently using is 9008bc808. (The newest commit version dddc03d3bc has the same error)
|
wasm-interp errors on seemingly semantically-correct wasm module
|
https://api.github.com/repos/WebAssembly/wabt/issues/2306/comments
| 1 |
2023-09-27T07:21:49Z
|
2023-09-27T09:01:07Z
|
https://github.com/WebAssembly/wabt/issues/2306
| 1,914,865,352 | 2,306 |
[
"WebAssembly",
"wabt"
] |
wasm-decompile crashes when trying to process [this WAT file](https://github.com/WebAssembly/wabt/files/12731218/test.zip). Interestingly enough, it works after being processed with wasm-opt.
The full text of the error is:
```
wabt-main/include/wabt/ir.h:62: const string& wabt::Var::name() const: Assertion `is_name()' failed.
```
|
wasm-decompile: Assertion `is_name()' failed.
|
https://api.github.com/repos/WebAssembly/wabt/issues/2304/comments
| 1 |
2023-09-26T19:40:55Z
|
2023-10-05T19:44:03Z
|
https://github.com/WebAssembly/wabt/issues/2304
| 1,914,182,850 | 2,304 |
[
"WebAssembly",
"wabt"
] |
Just experienced an error when trying to run one of the tools on Ubuntu focal / Mint 20.3 (Una). Is it supported?
```
$ wasm2wat plugin.wasm
wasm2wat: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by wasm2wat)
wasm2wat: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by wasm2wat)
wasm2wat: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by wasm2wat)
```
```
$ uname -a
Linux mint-vm 5.4.0-155-generic #172-Ubuntu SMP Fri Jul 7 16:10:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```
```
$ apt list --installed libc-*
Listing... Done
libc-ares2/focal-updates,focal-security,now 1.15.0-1ubuntu0.3 amd64 [installed]
libc-bin/focal-updates,now 2.31-0ubuntu9.9 amd64 [installed]
libc-dev-bin/focal-updates,now 2.31-0ubuntu9.9 amd64 [installed,automatic]
```
|
Can't run on Ubuntu focal
|
https://api.github.com/repos/WebAssembly/wabt/issues/2303/comments
| 7 |
2023-09-24T20:54:59Z
|
2023-09-25T22:29:15Z
|
https://github.com/WebAssembly/wabt/issues/2303
| 1,910,376,169 | 2,303 |
[
"WebAssembly",
"wabt"
] |
This is an extension of #2301. However, this one is a bit harder - mandoc doesn't appear to have reproducible output, particularly around dates. Anyway, the relevant script is `scripts/generate-html-docs.sh` (which should really be `.bash` but anyway).
|
Tech debt: keep mandoc html up to date
|
https://api.github.com/repos/WebAssembly/wabt/issues/2302/comments
| 0 |
2023-09-19T22:57:49Z
|
2023-09-19T22:59:21Z
|
https://github.com/WebAssembly/wabt/issues/2302
| 1,903,833,125 | 2,302 |
[
"WebAssembly",
"wabt"
] |
There is a script, `scripts/help2man.lua` which can be used to generate manpages from `$wabt_tool --help` output. It could be used in CI to fail if man pages are outdated.
|
Tech debt: keep man pages up to date
|
https://api.github.com/repos/WebAssembly/wabt/issues/2301/comments
| 0 |
2023-09-19T22:53:00Z
|
2023-09-19T22:53:00Z
|
https://github.com/WebAssembly/wabt/issues/2301
| 1,903,829,731 | 2,301 |
[
"WebAssembly",
"wabt"
] |
Currently, wabt has opcodecnt, used to output opcode counts. We would kinda like to see a more general tool to output (and in some sense, visualize) various stats for a given wasm file.
Function/global/import/export counts, opcodes per function, local count (okay it's currently possible to find the max locals using `opcodecnt|grep` but anyway), max stack size, honestly the list is kinda endless...
We do appreciate the existing opcodecnt functionality and its 2 data visualization outputs:
- Count of each opcode by type. (e.g. "local.get")
- Count of each opcode by instance. (e.g. "local.get 1")
|
Proposal: stats
|
https://api.github.com/repos/WebAssembly/wabt/issues/2295/comments
| 3 |
2023-09-13T23:44:15Z
|
2023-10-08T13:07:48Z
|
https://github.com/WebAssembly/wabt/issues/2295
| 1,895,404,206 | 2,295 |
[
"WebAssembly",
"wabt"
] |
Hey, it's Pedro (see #2245) and I'm back with a new security suggestion!
When developing with CI workflows, it's common to version-pin dependencies (i.e. `actions/checkout@v3`). However, version tags are mutable, so a malicious attacker could overwrite a version tag to point to a malicious or vulnerable commit instead.
Pinning workflow dependencies by hash ensures the dependency is immutable and its behavior is guaranteed.
These hashes can be automatically updated by dependabot. Whenever new versions Actions are released, you'll receive a single PR updating all of their hashes and version comments at once (see [this example](https://github.com/pnacht/libarchive/pull/1)).
I'll send a PR pinning the Actions along with this issue.
|
Hash-pin workflow GitHub Actions
|
https://api.github.com/repos/WebAssembly/wabt/issues/2290/comments
| 1 |
2023-09-06T13:47:06Z
|
2023-09-15T03:16:56Z
|
https://github.com/WebAssembly/wabt/issues/2290
| 1,884,057,721 | 2,290 |
[
"WebAssembly",
"wabt"
] |
I have the following C file, which I have compiled into a `.wasm` module, and then translated to C using `wasm2c`:
```c
#include <stdio.h>
#include <unistd.h>
#include <emscripten.h>
int EMSCRIPTEN_KEEPALIVE unsafe_printf() {
printf("Hello World\n");
return 0;
}
int EMSCRIPTEN_KEEPALIVE unsafe_unlink() {
unlink("/tmp/thisshouldnotexistatall");
return 0;
}
```
When linking, I get the following errors:
```
ld: error: undefined symbol: w2c_env_0x5F_syscall_unlinkat
>>> referenced by unsafe.wasm.c
>>> unsafe.wasm.o:(w2c_unsafe_unsafe_unlink)
ld: error: undefined symbol: w2c_wasi__snapshot__preview1_fd_write
>>> referenced by unsafe.wasm.c
>>> unsafe.wasm.o:(w2c_unsafe_f7)
>>> referenced by unsafe.wasm.c
>>> unsafe.wasm.o:(w2c_unsafe_f7)
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:24: programme] Error 1
```
It's my understanding that the `w2c_wasi__snapshot__preview1_fd_write` error is because I need to provide an implementation of the WASI API. What does the `__snapshot__preview1` aspect mean in the function call name?
And what about `w2c_env_0x5F_syscall_unlinkat`? Why is this not translated into the `path_unlink_file` WASI call?
Furthermore, the signature for the instantiate function is as follows:
```c
void wasm2c_unsafe_instantiate(w2c_unsafe*, struct w2c_env*, struct w2c_wasi__snapshot__preview1*);
````
What is `struct w2c_env` and `struct w2c_wasi__snapshot__preview1`? How are these initialised? Are they documented anywhere?
|
`w2c_env` and `w2c_wasi`: what are they?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2289/comments
| 6 |
2023-08-31T11:54:53Z
|
2023-09-06T22:32:27Z
|
https://github.com/WebAssembly/wabt/issues/2289
| 1,875,378,445 | 2,289 |
[
"WebAssembly",
"wabt"
] |
Say we have the file repro.wat with an $invalid function, which doesn't match it's return signature, and a following valid function
with a select instruction:
```
(module
(func $invalid (result i32))
(func $normal (local i32)
i32.const 1
i32.const 2
i32.const 3
select
local.set 0
)
)
```
Trying to build it...
```
$ wat2wasm repro.wat
repro.wat:2:16: error: type mismatch in implicit return, expected [i32] but got []
(func $invalid (result i32))
^
repro.wat:8:1: error: type mismatch at end of function, expected [] but got [i32]
local.set 0
^^^^^^^^^
```
...gives an error in the valid function. Let's force the build with:
```
$ wat2wasm repro.wat --no-check
```
Now we have an invalid repro.wasm, and validating it...
```
$ wasm-validate repro.wasm
repro.wasm:000001b: error: type mismatch in implicit return, expected [i32] but got []
repro.wasm:000002a: error: type mismatch at end of function, expected [] but got [i32]
```
again gives an error in the valid function.
If you comment out the $invalid function:
```
(;(func $invalid (result i32));)
```
The remaining $normal function builds and validates successfully.
The errors seem to show up after `select` instructions, at the end of the function in version 1.0.33. In 1.0.27 it's a bit different, the errors seem to show up for the instruction immediately after the `select`. Keep in mind this bug that may account for some of the off-by-ones https://github.com/WebAssembly/wabt/issues/1217
Ideally, wasm-validate would be able to re-synchronise itself after errors like this, or abort immediately after an unrecoverable error (with a message saying as such and where validation stopped), so users don't think there are more issues than there actually are.
|
`wasm-validate` gives false positive errors that occur after a true positive.
|
https://api.github.com/repos/WebAssembly/wabt/issues/2283/comments
| 1 |
2023-08-15T03:39:58Z
|
2023-08-23T20:49:42Z
|
https://github.com/WebAssembly/wabt/issues/2283
| 1,850,860,565 | 2,283 |
[
"WebAssembly",
"wabt"
] |
I'm encountering an error when trying to convert my wasm file to a wat file using `wasm2wat`. The error is `0003778: error: unexpected opcode: 0xfe 0x25`. I am able to run other tools such as `wasm-decompile` and `wasm-objdump` on the same wasm file. It appears that the opcode means `i32.atomic.rmw.sub` as far as I can tell from the disassembly :
```
003776: fe 25 02 04 | i32.atomic.rmw.sub 2 4
```
I notice a difference between the address in the error message (0003778) and the one from the disassembly (003776). Is it meaningful?
Otherwise, my main objective is to successfully convert my existing wasm file. Any idea how I can solve or debug this opcode issue?
|
wasm2wat : Unexpected opcode 0xfe 0x25
|
https://api.github.com/repos/WebAssembly/wabt/issues/2281/comments
| 2 |
2023-08-10T20:58:33Z
|
2023-08-11T13:48:44Z
|
https://github.com/WebAssembly/wabt/issues/2281
| 1,845,892,592 | 2,281 |
[
"WebAssembly",
"wabt"
] |
currently the target `libwabtjs` will export APIs:
```
validate(): void;
resolveNames(): void;
generateNames(): void;
applyNames(): void;
toText(options: ToTextOptions): string;
toBinary(options: ToBinaryOptions): ToBinaryResult;
destroy(): void;
```
is it possible to export the objdump API for the JS side, so if user want to get the objdump info, they do not need to start up a process?
I suppose the `objDump()` just return the text will be good, how do you think? Thank you.
|
Shall the objdump API be included in libwabtjs target
|
https://api.github.com/repos/WebAssembly/wabt/issues/2279/comments
| 0 |
2023-08-03T09:44:29Z
|
2023-08-03T09:44:29Z
|
https://github.com/WebAssembly/wabt/issues/2279
| 1,834,685,260 | 2,279 |
[
"WebAssembly",
"wabt"
] |
## version
```shell
$ git log
commit e37de9dedfc7037cea09ca3c75fd5a544d68cb2a (HEAD -> main, origin/main, origin/HEAD)
Author: Shravan Narayan <[email protected]>
Date: Tue Jun 20 00:06:25 2023 -0400
C++20 compatibility fixes
```
## Env
```shell
host : Linux user 5.19.0-50-generic #50-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 10 18:24:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
build : make clang-debug-asan
```
## Description
During the parsing of the Type section of a wasm binary, an incorrect `datacount` value triggers a huge memory allocation.
When the `new` function is called, it is computed with the value of `sizeof(_Tp)`, a memory allocation of about 40 GB is performed, and out-of-memory is triggered.

poc file : [poc.zip](https://github.com/WebAssembly/wabt/files/12212696/poc.zip)
## ASAN
```shell
./wasm-interp poc
=================================================================
==3235933==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x97fffff68 bytes
#0 0x55c65fb65fad in operator new(unsigned long) (/home/user/wabt_native/wabt/out/clang/Debug/asan/wasm-interp+0x194fad) (BuildId: 0dc6d9725e694cbc297e840e0803233df453bca7)
#1 0x55c65fb9d1f9 in __gnu_cxx::new_allocator<wabt::interp::DataDesc>::allocate(unsigned long, void const*) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/ext/new_allocator.h:127:27
#2 0x55c65fb9d180 in std::allocator_traits<std::allocator<wabt::interp::DataDesc> >::allocate(std::allocator<wabt::interp::DataDesc>&, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/alloc_traits.h:464:20
#3 0x55c65fb9d13f in std::_Vector_base<wabt::interp::DataDesc, std::allocator<wabt::interp::DataDesc> >::_M_allocate(unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:346:20
#4 0x55c65fc44805 in std::vector<wabt::interp::DataDesc, std::allocator<wabt::interp::DataDesc> >::reserve(unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/vector.tcc:78:22
#5 0x55c65fbff044 in wabt::interp::(anonymous namespace)::BinaryReaderInterp::OnDataCount(unsigned int) /home/user/wabt_native/wabt/src/interp/binary-reader-interp.cc:761:17
#6 0x55c65fd52598 in wabt::(anonymous namespace)::BinaryReader::ReadDataCountSection(unsigned long) /home/user/wabt_native/wabt/src/binary-reader.cc:2827:3
#7 0x55c65fd3d147 in wabt::(anonymous namespace)::BinaryReader::ReadSections(wabt::(anonymous namespace)::BinaryReader::ReadSectionsOptions const&) /home/user/wabt_native/wabt/src/binary-reader.cc:2950:26
#8 0x55c65fd39eaa in wabt::(anonymous namespace)::BinaryReader::ReadModule(wabt::(anonymous namespace)::BinaryReader::ReadModuleOptions const&) /home/user/wabt_native/wabt/src/binary-reader.cc:2993:3
#9 0x55c65fd38eab in wabt::ReadBinary(void const*, unsigned long, wabt::BinaryReaderDelegate*, wabt::ReadBinaryOptions const&) /home/user/wabt_native/wabt/src/binary-reader.cc:3010:17
#10 0x55c65fbdc59c in wabt::interp::ReadBinaryInterp(std::basic_string_view<char, std::char_traits<char> >, void const*, unsigned long, wabt::ReadBinaryOptions const&, std::vector<wabt::Error, std::allocator<wabt::Error> >*, wabt::interp::ModuleDesc*) /home/user/wabt_native/wabt/src/interp/binary-reader-interp.cc:1609:10
#11 0x55c65fb71e8e in ReadModule(char const*, std::vector<wabt::Error, std::allocator<wabt::Error> >*, wabt::interp::RefPtr<wabt::interp::Module>*) /home/user/wabt_native/wabt/src/tools/wasm-interp.cc:324:3
#12 0x55c65fb6b452 in ReadAndRunModule(char const*) /home/user/wabt_native/wabt/src/tools/wasm-interp.cc:351:19
#13 0x55c65fb6a554 in ProgramMain(int, char**) /home/user/wabt_native/wabt/src/tools/wasm-interp.cc:450:25
#14 0x55c65fb6b951 in main /home/user/wabt_native/wabt/src/tools/wasm-interp.cc:456:10
#15 0x7f0079029d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
==3235933==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: out-of-memory (/home/user/wabt_native/wabt/out/clang/Debug/asan/wasm-interp+0x194fad) (BuildId: 0dc6d9725e694cbc297e840e0803233df453bca7) in operator new(unsigned long)
==3235933==ABORTING
```
## native execution without ASAN
```shell
git commit : 45bd6a34859551ecd96b8c8ad34bd9c899d70602
```
```shell
./wasm-interp poc
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
```
|
huge memory alloc causes SIGABORT signal at reserve function in binary-reader-interp.cc:761
|
https://api.github.com/repos/WebAssembly/wabt/issues/2277/comments
| 6 |
2023-07-31T08:05:24Z
|
2023-08-01T00:43:22Z
|
https://github.com/WebAssembly/wabt/issues/2277
| 1,828,635,108 | 2,277 |
[
"WebAssembly",
"wabt"
] |
wat-desugar (1.0.33) seems to have an overflow issue for the `typeidx` of the `call_indirect` instruction.
e.g.:
This module (located [here](https://github.com/WebAssembly/spec/blob/master/test/core/ref_func.wast)):
``` wat
(module
(func $f (import "M" "f") (param i32) (result i32))
(func $g (param $x i32) (result i32)
(i32.add (local.get $x) (i32.const 1))
)
(global funcref (ref.func $f))
(global funcref (ref.func $g))
(global $v (mut funcref) (ref.func $f))
(global funcref (ref.func $gf1))
(global funcref (ref.func $gf2))
(func (drop (ref.func $ff1)) (drop (ref.func $ff2)))
(elem declare func $gf1 $ff1)
(elem declare funcref (ref.func $gf2) (ref.func $ff2))
(func $gf1)
(func $gf2)
(func $ff1)
(func $ff2)
(func (export "is_null-f") (result i32)
(ref.is_null (ref.func $f))
)
(func (export "is_null-g") (result i32)
(ref.is_null (ref.func $g))
)
(func (export "is_null-v") (result i32)
(ref.is_null (global.get $v))
)
(func (export "set-f") (global.set $v (ref.func $f)))
(func (export "set-g") (global.set $v (ref.func $g)))
(table $t 1 funcref)
(elem declare func $f $g)
(func (export "call-f") (param $x i32) (result i32)
(table.set $t (i32.const 0) (ref.func $f))
(call_indirect $t (param i32) (result i32) (local.get $x) (i32.const 0))
)
(func (export "call-g") (param $x i32) (result i32)
(table.set $t (i32.const 0) (ref.func $g))
(call_indirect $t (param i32) (result i32) (local.get $x) (i32.const 0))
)
(func (export "call-v") (param $x i32) (result i32)
(table.set $t (i32.const 0) (global.get $v))
(call_indirect $t (param i32) (result i32) (local.get $x) (i32.const 0))
)
)
```
will look like this when run through `wat-desugar`:
``` wat
(module
(import "M" "f" (func $f (param i32) (result i32)))
(func $g (param $x i32) (result i32)
local.get $x
i32.const 1
i32.add)
(global (;0;) funcref (ref.func $f))
(global (;1;) funcref (ref.func $g))
(global $v (mut funcref) (ref.func $f))
(global (;3;) funcref (ref.func $gf1))
(global (;4;) funcref (ref.func $gf2))
(func (;2;)
ref.func $ff1
drop
ref.func $ff2
drop)
(elem (;0;) declare func $gf1 $ff1)
(elem (;1;) declare func $gf2 $ff2)
(func $gf1)
(func $gf2)
(func $ff1)
(func $ff2)
(func (;7;) (result i32)
ref.func $f
ref.is_null)
(export "is_null-f" (func 7))
(func (;8;) (result i32)
ref.func $g
ref.is_null)
(export "is_null-g" (func 8))
(func (;9;) (result i32)
global.get $v
ref.is_null)
(export "is_null-v" (func 9))
(func (;10;)
ref.func $f
global.set $v)
(export "set-f" (func 10))
(func (;11;)
ref.func $g
global.set $v)
(export "set-g" (func 11))
(table $t 1 funcref)
(elem (;2;) declare func $f $g)
(func (;12;) (param $x i32) (result i32)
i32.const 0
ref.func $f
table.set $t
local.get $x
i32.const 0
call_indirect $t (type 4294967295))
(export "call-f" (func 12))
(func (;13;) (param $x i32) (result i32)
i32.const 0
ref.func $g
table.set $t
local.get $x
i32.const 0
call_indirect $t (type 4294967295))
(export "call-g" (func 13))
(func (;14;) (param $x i32) (result i32)
i32.const 0
global.get $v
table.set $t
local.get $x
i32.const 0
call_indirect $t (type 4294967295))
(export "call-v" (func 14))
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func))
(type (;2;) (func (result i32))))
```
Notice that the `typeidx` of `call_indirect` is **4294967295** when it should be **0** (in this case).
|
desugar: overflow issue for typeidx of call_indirect instruction
|
https://api.github.com/repos/WebAssembly/wabt/issues/2270/comments
| 5 |
2023-07-18T09:34:03Z
|
2023-08-01T16:35:20Z
|
https://github.com/WebAssembly/wabt/issues/2270
| 1,809,550,104 | 2,270 |
[
"WebAssembly",
"wabt"
] |
thx
|
Where I can find binary .exe files?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2269/comments
| 1 |
2023-07-14T13:41:20Z
|
2023-07-25T10:08:48Z
|
https://github.com/WebAssembly/wabt/issues/2269
| 1,804,907,978 | 2,269 |
[
"WebAssembly",
"wabt"
] |
When compiling Firefox (which uses wasm2c) for MIPS with clang, the following error happens:
```
rlbox.wasm.c:142:1: error: couldn't allocate input reg for constraint 'r'
DEFINE_LOAD(f32_load, f32, f32, f32)
^
rlbox.wasm.c:128:14: note: expanded from macro 'DEFINE_LOAD'
wasm_asm("" ::"r"(result)); \
```
GCC is happy with it, but fundamentally, the asm constraint is wrong (r is for GPRs, and here the result is a floating point value).
Those constraints were added in a7d484ef3d1f64649dd9f48cb1d5434f0fda561b, and the reason given was:
> Preventing load instructions from being optimized away if their value is unused (using inline assembly with an input operand and empty code). This is necessary to f
orce an OOB trap on platforms that use mprotect and the signal handler to detect OOB.
Would using `__attribute__((used))` work instead? Or volatile?
|
error: couldn't allocate input reg for constraint 'r' on MIPS with clang when compiling wasm2c-generated source
|
https://api.github.com/repos/WebAssembly/wabt/issues/2266/comments
| 10 |
2023-06-30T22:10:20Z
|
2023-07-30T19:18:51Z
|
https://github.com/WebAssembly/wabt/issues/2266
| 1,783,211,051 | 2,266 |
[
"WebAssembly",
"wabt"
] |
The module below has two function types declared, `0: () -> ()` and `1: (i32) -> ()`. It also has a single function defined with the second function type i.e. `(i32) -> ()`. That function has a single local defined. Since it has a parameter, my understanding is that the local should have the index 1 in the "Code Disassembly" section of wasm-objdump, but instead has the index 0:
```
module.wasm: file format wasm 0x1
Section Details:
Type[2]:
- type[0] () -> nil
- type[1] (i32) -> nil
Function[1]:
- func[0] sig=1 <f1>
Code[1]:
- func[0] size=4 <f1>
Custom:
- name: "name"
- func[0] <f1>
- func[0] local[0] <paramA>
- func[0] local[1] <localA>
Custom:
- name: "linking"
- symbol table [count=1]
- 0: F <f1> func=0 [ binding=global vis=default ]
Code Disassembly:
00002a func[0] <f1>:
00002b: 01 7e | local[0] type=i64
00002d: 0b | end
```
Removing the first type (`() -> ()`) results in the local having the index 1, as I'd expect.
Looking through the code, I believe the issue is that in `binary-reader-objdump.cc`:
* In `OnFuncType`, we have:
```cpp
objdump_state_->function_param_counts[index] = param_count;
```
where `index` is the index of the type i.e. we treat the keys of `function_param_counts` as type indices.
* In `BeginFunctionBody`, we have:
```cpp
local_index_ = objdump_state_->function_param_counts[index];
```
where `index` is the index of the function i.e. we treat the keys of `function_param_counts` as function indices.
This seems to be consistent with the output I'm seeing.
It's entirely possible I've misunderstood something, so please feel free to correct me! If my diagnosis is correct, I'm happy to try putting together a fix, but I'm equally happy if it's simpler for someone else to write one.
[module.zip](https://github.com/WebAssembly/wabt/files/11886114/module.zip)
|
wasm-objdump has incorrect local numbering
|
https://api.github.com/repos/WebAssembly/wabt/issues/2264/comments
| 2 |
2023-06-27T18:56:23Z
|
2023-06-27T21:26:21Z
|
https://github.com/WebAssembly/wabt/issues/2264
| 1,777,572,674 | 2,264 |
[
"WebAssembly",
"wabt"
] |
I noticed that the macos archive name in the release is inconsistent vs ubuntu/windows. It has the version name, `-12` while the others don't. This is because the name is computed by stripping out the GHA runner name of `-latest`, but for macos the runner is not `-latest`
https://github.com/WebAssembly/wabt/blob/main/.github/actions/release-archive/action.yml#L16
https://github.com/WebAssembly/wabt/blob/main/.github/workflows/build.yml#L33
Presumably these are all supposed to be symmetric. One option to fix would be to switch to using lowercase of `runner.os` instead of `matrix.os`, that word contains `Linux`, `MacOS`, `Windows`. Note that it is linux instead of ubuntu, this would be a relatively significant change to the current name but perhaps it's a more appropriate one?
|
Inconsistent archive name for macos
|
https://api.github.com/repos/WebAssembly/wabt/issues/2259/comments
| 3 |
2023-06-12T05:26:26Z
|
2024-05-15T01:39:26Z
|
https://github.com/WebAssembly/wabt/issues/2259
| 1,751,922,281 | 2,259 |
[
"WebAssembly",
"wabt"
] |
@keithw @sbc100 I've been looking at finishing the wait/notify part of the thread atomics proposal (https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md) and after going through a few different implementations, I have come to the conclusion that we would definitely need a map and list data structures we can use from C. Especially for the map data structure, I want to avoid rolling my own and wanted to see if we could figure out a standard C data structure library we can pull into wasm2c's output. Please let me know your thoughts on this.
|
wasm2c: we need to pick standard C data structure implementations to finish thread proposal
|
https://api.github.com/repos/WebAssembly/wabt/issues/2258/comments
| 10 |
2023-06-09T07:30:31Z
|
2023-06-17T11:10:33Z
|
https://github.com/WebAssembly/wabt/issues/2258
| 1,749,299,094 | 2,258 |
[
"WebAssembly",
"wabt"
] |
WastParser seems to:
- allow `(module binary "...")` in `ParseModule` (even though this is not valid syntax for the Wasm text format; it's only valid for scripts), and
- forbid `(module quote "...")`in `ParseScript`, even though this is a valid script command. (It does allow `(module quote)` when inside `(assert_malformed)`, which is the only thing the spec tests actually use.)
Not saying either of these edge cases is critical, but just documenting for the record. I think it would be nice to tighten up the first one since this seems like a possible avenue for mischief.
|
WastParser handling of `(module binary)` and `(module quote)`
|
https://api.github.com/repos/WebAssembly/wabt/issues/2249/comments
| 1 |
2023-06-07T17:27:28Z
|
2023-12-05T08:07:52Z
|
https://github.com/WebAssembly/wabt/issues/2249
| 1,746,368,256 | 2,249 |
[
"WebAssembly",
"wabt"
] |
if my reading of the spec is correct, an empty wast file is valid.
https://github.com/WebAssembly/spec/blob/main/interpreter/README.md#scripts
an example of such a file:
https://github.com/WebAssembly/multi-memory/blob/4f6b8f53ec11e59f5e38033db4199db18df83706/test/core/multi-memory/memory_copy1.wast#L1
how other implementations behave:
```
spacetanuki% touch empty.wast
spacetanuki% wast2json empty.wast
empty.wast:1:1: error: unexpected token "EOF", expected a module field or a command.
spacetanuki% ~/git/wasm/spec/interpreter/wasm empty.wast
spacetanuki% wasmtime wast empty.wast
Error: failed to run script file 'empty.wast'
Caused by:
expected at least one module field
--> empty.wast:1:1
|
1 |
| ^
spacetanuki% wasmer wast empty.wast
error: failed to test the wast `empty.wast`
│ 1: tests failed
╰─▶ 2: expected at least one module field
--> empty.wast:1:1
|
1 |
| ^
spacetanuki%
```
|
wast2json should not complain on an empty wast file
|
https://api.github.com/repos/WebAssembly/wabt/issues/2246/comments
| 1 |
2023-06-07T02:15:31Z
|
2023-06-07T20:25:54Z
|
https://github.com/WebAssembly/wabt/issues/2246
| 1,744,909,556 | 2,246 |
[
"WebAssembly",
"wabt"
] |
A security policy (SECURITY.md) explains how the project wishes to receive and handle responsible disclosure of potential vulnerabilities. [GitHub recommends](https://docs.github.com/en/code-security/getting-started/securing-your-repository#setting-a-security-policy) that projects have one.
The security policy can be found by users who enter the project's "Security" panel. They'll also see references to it in the "New issue" page.
There are two main ways to receive disclosures:
- register an email or website available to receive such reports; and/or
- use [GitHub's private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository)
If you want to use GitHub's reporting system, it must be activated for the repository:
1. Open the repo's settings
2. Click on [Code security & analysis](https://github.com/WebAssembly/wabt/settings/security_analysis)
3. Click "Enable" for "Private vulnerability reporting"
I'll send a PR with a draft policy along with this issue.
Alternatively, the policy can be created in the [WebAssembly/.github](https://github.com/WebAssembly/.github) repository. In this case, the policy will be available in all of the org's repos.
---
**Disclosure:** My name is Pedro and I work with Google and the [Open Source Security Foundation (OpenSSF)](https://www.openssf.org/) to improve the supply-chain security of the open-source ecosystem.
|
Add a security policy
|
https://api.github.com/repos/WebAssembly/wabt/issues/2244/comments
| 0 |
2023-06-06T20:35:20Z
|
2023-08-30T23:08:49Z
|
https://github.com/WebAssembly/wabt/issues/2244
| 1,744,560,641 | 2,244 |
[
"WebAssembly",
"wabt"
] |
This is a silly request but it'd be neat if CI simply randomized LC_ALL.
Yeah it'd mean failure is probabilistic instead of guaranteed, but it'd help expand the test surface.
|
Randomize LC_ALL in CI?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2243/comments
| 7 |
2023-06-01T21:28:04Z
|
2023-08-30T22:45:05Z
|
https://github.com/WebAssembly/wabt/issues/2243
| 1,737,121,720 | 2,243 |
[
"WebAssembly",
"wabt"
] |
wasm-interp crashes with no error message when the wrong number of arguments is given.
For example, when running the identity function:
```wasm
(module
(func (export "id") (param i32) (result i32) (local.get 0))
)
```
```
% wasm-interp identity.wasm --run-export=id
[1] 102759 segmentation fault (core dumped) wasm-interp identity.wasm --run-export=id
% wasm-interp identity.wasm --run-export=id --argument=i32:7
id(i32:7) => i32:7
% wasm-interp identity.wasm --run-export=id --argument=i32:7 --argument=i32:8
[1] 102811 abort (core dumped) wasm-interp identity.wasm --run-export=id --argument=i32:7 --argument=i32:8
```
Version:
```
% wasm-interp --version
1.0.33
```
|
wasm-interp crashes when wrong number of arguments passed
|
https://api.github.com/repos/WebAssembly/wabt/issues/2242/comments
| 5 |
2023-05-29T15:54:24Z
|
2023-06-09T18:26:37Z
|
https://github.com/WebAssembly/wabt/issues/2242
| 1,730,973,298 | 2,242 |
[
"WebAssembly",
"wabt"
] |
The following wat program works fine in wat2wasm without function references enabled:
```
(module
(func $example (export "example") (result funcref)
ref.func $example))
```
However, enabling the "function references" feature causes the following error:
```
Error: validate failed:
test.wast:3:5: error: type mismatch in implicit return, expected [funcref] but got [(ref 0)]
ref.func $example))
^^^^^^^^
```
It looks like `ref 0` is not marked as a subtype of `funcref`.
Tested with the online demo: https://webassembly.github.io/wabt/demo/wat2wasm/
|
Incorrect type for ref.func when function references are enabled
|
https://api.github.com/repos/WebAssembly/wabt/issues/2241/comments
| 1 |
2023-05-28T19:28:30Z
|
2023-05-29T22:52:33Z
|
https://github.com/WebAssembly/wabt/issues/2241
| 1,729,631,247 | 2,241 |
[
"WebAssembly",
"wabt"
] |
When running the test suite of wabt-1.0.33 on aarch64 on Fedora 38, I get this (new) test failure:
```
- test/wasm2c/spec/simd_address.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,11 @@
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.33/test/run-spec-wasm2c.py", line 648, in <module>
+ sys.exit(main(sys.argv[1:]))
+ ^^^^^^^^^^^^^^^^^^
+ File "/builddir/build/BUILD/wabt-1.0.33/test/run-spec-wasm2c.py", line 642, in main
+ utils.Executable(main_exe, forward_stdout=True).RunWithArgs()
+ File "/builddir/build/BUILD/wabt-1.0.33/test/utils.py", line 95, in RunWithArgs
+ raise error
+utils.Error: Error running "out/test/wasm2c/spec/simd_address/simd_address" (1):
+None
+out/test/wasm2c/spec/simd_address/simd_address-main.c:499: assertion failed: expected w2c_simd__address__1__wasm_v1280x2Eload_offset_65521(&simd__address__1__wasm_instance) to trap.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1 @@
-42/42 tests passed.
+41/42 tests passed.
```
|
wasm2c/spec/simd_address.txt fails on non-x86
|
https://api.github.com/repos/WebAssembly/wabt/issues/2240/comments
| 5 |
2023-05-25T19:58:59Z
|
2023-05-26T09:54:17Z
|
https://github.com/WebAssembly/wabt/issues/2240
| 1,726,412,675 | 2,240 |
[
"WebAssembly",
"wabt"
] |
In some cases, WastParser rejects constructs that use disabled features (e.g. multi-memory, exceptions) and in some cases it appears to allow them (e.g. extended-const, memory64) even if disabled. (As seen in https://github.com/WebAssembly/wabt/pull/2234 where the lack of `--enable-extended-const` didn't affect `wast2json`.)
Do we think it's important for `wat2wasm` to reject these constructs if disabled (and if so, should the spec testsuite or our regression tests include these kinds of negative examples)?
Related to https://github.com/WebAssembly/wabt/issues/1837
|
Enforce disabled features in WastParser for extended-const and memory64?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2235/comments
| 1 |
2023-05-11T20:50:28Z
|
2023-05-11T21:14:13Z
|
https://github.com/WebAssembly/wabt/issues/2235
| 1,706,536,550 | 2,235 |
[
"WebAssembly",
"wabt"
] |
simd-everywhere has just merged fixes to pass the Wasm testsuite (https://github.com/simd-everywhere/simde/pull/1010), so I think we're close to being able to close this out, cut a release, and check the box on webassembly.org. This will also be the first time in a while that wasm2c is passing 100% of the current Wasm core testsuite (which we should enjoy until tail-calls get merged).
Here's my thinking/proposal on next steps to get there:
- [x] Update our simde submodule pointer
- [x] Add the five missing tests
- [x] Check the SIMD box in the wasm2c README
- [x] Augment the IR to track whether SIMD is actually used in the module (later we can do the same for exceptions)
- [x] Include SIMD support in the generated code only if the module uses it + SIMD is enabled
- ~Maybe controversial: When SIMD is being used, include the simde header in the generated code (like we do with the scalar operations) so the user doesn't need to have a compatible dev repo of SIMDe in their include path to compile the wasm2c output.~
- ~~Create the "amalgamated" simd128.h header along with the other source templates~~
- ~~Check in the "amalgamated" header as a prebuilt file to keep Firefox and others happy (similar to #2193)?~~
- [x] Eliminate WASM_RT_ENABLE_SIMD preprocessor macro and conditionally `#include <simde/wasm/simd128>` instead.
- [x] CWriter tracks whether SIMD is used in the module's external interface to decide whether the `#include` should be in the header file or only the C file (avoid pulling all of SIMDe simd128.h into the embedder's namespace unless necessary)
- [x] Cut a 1.0.33 release
- [x] Submit a PR to WebAssembly/website that wasm2c 1.0.33 supports SIMD (and extended-const)
@wrv @sbc100 @shravanrn wdyt?
|
wasm2c SIMD final approach checklist
|
https://api.github.com/repos/WebAssembly/wabt/issues/2224/comments
| 6 |
2023-05-03T22:38:22Z
|
2023-07-12T19:29:35Z
|
https://github.com/WebAssembly/wabt/issues/2224
| 1,694,942,085 | 2,224 |
[
"WebAssembly",
"wabt"
] |
#2219
|
Validator doesn't quite pass all the spec tests
|
https://api.github.com/repos/WebAssembly/wabt/issues/2220/comments
| 0 |
2023-04-27T09:23:42Z
|
2023-04-27T16:28:29Z
|
https://github.com/WebAssembly/wabt/issues/2220
| 1,686,465,971 | 2,220 |
[
"WebAssembly",
"wabt"
] |
same as #2210 but for OpenBSD, cf https://bugzilla.mozilla.org/show_bug.cgi?id=1830036 for the context.
|
[wasm2c] alloca.h on OpenBSD
|
https://api.github.com/repos/WebAssembly/wabt/issues/2216/comments
| 1 |
2023-04-26T11:15:54Z
|
2023-04-26T15:06:50Z
|
https://github.com/WebAssembly/wabt/issues/2216
| 1,684,820,073 | 2,216 |
[
"WebAssembly",
"wabt"
] |
Does it... make any sense to have source maps for wasm2c?
|
Source maps for wasm2c?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2215/comments
| 5 |
2023-04-25T18:01:21Z
|
2023-06-15T13:40:56Z
|
https://github.com/WebAssembly/wabt/issues/2215
| 1,683,610,559 | 2,215 |
[
"WebAssembly",
"wabt"
] |
Sorry if this has been answered elsewhere. I am building directly with CMake and curious about targets in provided Makefile vs the ones generated by CMake, in particular `test-everything` (Makefile) vs `check` (CMake) and `update-gperf` (Makefile only).
Readme doesn't seem to recommend using `check`, though it does work and seems at first glance to match what CI does. Not 100% sure if `test-everything` covers the same actions.
For `update-gpref`, it is probably possible to detect `gperf` and generate the command from CMake, and maybe even run it when source changes. Not sure if all platforms have `gperf`.
|
[Question] CMake-generated targets vs top-level makefile
|
https://api.github.com/repos/WebAssembly/wabt/issues/2211/comments
| 1 |
2023-04-21T20:51:58Z
|
2023-04-22T04:55:01Z
|
https://github.com/WebAssembly/wabt/issues/2211
| 1,679,083,156 | 2,211 |
[
"WebAssembly",
"wabt"
] |
When I try to build on FreeBSD wasm2c tests fail due to lack of `alloca.h` headers (using wasm2c should be problematic because of that). I'm not sure if this happens on other platforms. There are a few potential ways to fix it, for example include `stdlib.h` instead or make the include conditional, either via a preprocessor check in place or by generating the template via CMake.
|
[wasm2c] alloca.h
|
https://api.github.com/repos/WebAssembly/wabt/issues/2210/comments
| 3 |
2023-04-21T20:43:07Z
|
2023-04-22T07:28:25Z
|
https://github.com/WebAssembly/wabt/issues/2210
| 1,679,068,888 | 2,210 |
[
"WebAssembly",
"wabt"
] |
Executing the sequence `wasm_rt_init(); ...; wasm_rt_free();` from `wasm-rt-impl` _twice_ triggers a double free.
This can be reproduced by just duplicating the code of the main function in example `rot13`.
To my understanding the reason is that
1. the first `wasm_rt_free` doesn't reset `g_signal_handler_installed`,
2. so the second `wasm_rt_init` doesn't install the signal handler,
3. but the second `wasm_rt_free` attempts to free `g_alt_stack` again.
|
wasm2c double free
|
https://api.github.com/repos/WebAssembly/wabt/issues/2206/comments
| 2 |
2023-04-21T01:34:17Z
|
2023-04-21T16:58:31Z
|
https://github.com/WebAssembly/wabt/issues/2206
| 1,677,628,988 | 2,206 |
[
"WebAssembly",
"wabt"
] |
```wast
(func (export "break-try")
(try (do (br 0)) (delegate 0))
)
```
|
wasm2c exception handling is more broken than we thought
|
https://api.github.com/repos/WebAssembly/wabt/issues/2205/comments
| 0 |
2023-04-21T00:59:23Z
|
2023-05-08T20:49:43Z
|
https://github.com/WebAssembly/wabt/issues/2205
| 1,677,604,976 | 2,205 |
[
"WebAssembly",
"wabt"
] |
```
;;; TOOL: run-spec-wasm2c
;;; ARGS*: --enable-exceptions
(module
(tag $e0)
(func $throw (throw $e0))
(func (export "break-throw") (result i32)
(try $outer (result i32)
(do
(try (result i32)
(do
(block $a
(try (do (br $a)) (delegate $outer))
)
(call $throw)
(i32.const 0)
)
(catch $e0 (i32.const 1))
)
)
(catch $e0 (i32.const 2))
)
)
)
(assert_return (invoke "break-throw") (i32.const 1))
(;; STDOUT ;;;
1/1 tests passed.
;;; STDOUT ;;)
```
|
wasm2c exception handling is broken
|
https://api.github.com/repos/WebAssembly/wabt/issues/2203/comments
| 3 |
2023-04-20T18:02:01Z
|
2023-04-21T07:12:12Z
|
https://github.com/WebAssembly/wabt/issues/2203
| 1,677,180,574 | 2,203 |
[
"WebAssembly",
"wabt"
] |
As far as I can tell from the webassembly spec, it should be valid to use the `global.get` instruction in an element segment.
However I am unable to use `wat2wasm` on this module
```wat
(module
(import "m" "f" (global funcref))
(table 0 10 funcref)
(elem 0 (offset (i32.const 0)) funcref (global.get 0)))
```
If I try, I get this error:
```
foo.wat:4:43: error: invalid elem expression expression; must be either ref.null or ref.func.
(elem 0 (offset (i32.const 0)) funcref (global.get 0)))
^^^^^^^^^^
```
If I use the `--no-check` flag I am able to override the check and generate a resulting `.wasm` file.
Looking at the generated file in a hexdump, it looks exactly like I would expect it to. However I am unable to get `wasm2wat` to accept this generated module, even if I use the `--no-check` flag.
Am I misreading the spec, or is this a bug in wabt?
|
Is `global.get` allowed in element segments?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2201/comments
| 2 |
2023-04-16T20:18:20Z
|
2023-09-06T22:54:14Z
|
https://github.com/WebAssembly/wabt/issues/2201
| 1,670,120,538 | 2,201 |
[
"WebAssembly",
"wabt"
] |
I read the instructions in the root README.md file. I chose to do "Building using the top-level Makefile (Linux and macOS)". It complained about the fact that I don't have clang. So I installed it. Then I tried "make" again and it complained about not being able to find "lstdc++" (which I take to mean that the library "stdc++" is missing). "stdc++" is apparently the standard library from GCC (which I do already have installed), even though we're using clang in this context. Based on my forum browsing, stdc++ has to get "borrowed" from GCC because of something to do with GPL license terms. Anyway, I searched for how to install this library, and just turned up a lot of threads with people arguing over how to do it. Nothing seemed to work on my end. (To make matters worse, the "++" sometimes gets confused with a regex expression when you try to install it, and escape characters don't seem to fix the problem. Surely there's a better way but I haven't discovered it.) I had to completely give up and go back to the "cmake" approach. In the interest of saving others the wasted time, maybe just delete the section on building from Makefile, or explain how to resolve this problem on systems that don't have clang preinstalled.
By the way, in the "Running wasm2wat" section, it gives some examples using "test.wat", as though it's a test file that one can compile. There is no such file and the user is left to guess how to create such an example. Probably it's easy but a little more explanation would go a long way.
|
Docfix: clang issues
|
https://api.github.com/repos/WebAssembly/wabt/issues/2200/comments
| 9 |
2023-04-16T17:15:51Z
|
2023-07-31T00:04:10Z
|
https://github.com/WebAssembly/wabt/issues/2200
| 1,670,051,842 | 2,200 |
[
"WebAssembly",
"wabt"
] |
### Describe the bug
Certain wasm binary causes `wasm2wat`, `wasm2c`, `wasm-decompile`, and `wasm-validate` to crash.
`--version` (for all of them): 1.0.32 (git~1.0.32-57-gad5f1385)
_________________
### Steps to reproduce
The following `wasm` module causes a crash:
[crash.wasm.txt](https://github.com/WebAssembly/wabt/files/11230092/crash.wasm.txt) (Remove .txt extension and save as .wasm)
* Install and build WABT
* Run `wasm2c`, `wasm2wat`, `wasm-decompile` and `wasm-validate` on the test file: crash.wasm
* Observe the crash:
```
Assertion failed: (!empty()), function back, file intrusive-list.h, line 400.
zsh: abort ./wabt/bin/wasm2c crash.wasm
```
```
wasm-validate: /path/to/wabt/include/wabt/intrusive-list.h:400: wabt::intrusive_list<T>::value_type& wabt::intrusive_list<T>::back() [with T = wabt::Expr; wabt::intrusive_list<T>::reference = wabt::Expr&]: Assertion `!empty()' failed.
Aborted
```
______________
### Expected behavior:
Expected behavior should be an error like the one `wasm-interp` provides:
`wasm-interp crash.wasm`:
```
crash.wasm:0000038: error: invalid initializer: instruction not valid in initializer expression: unreachable
0000038: error: OnUnreachableExpr callback failed
```
Because the tools crashed I could not analyze deeper to find the root cause.
`wasm-objdump -d crash.wasm`:
```
000065 func[1]:
000066: 01 7f | local[0] type=i32
000068: 01 7e | local[1] type=i64
00006a: 01 7d | local[2] type=f32
00006c: 01 7c | local[3] type=f64
00006e: 01 7f | local[4] type=i32
000070: 41 b0 03 | i32.const 432
000073: 2d 00 41 | i32.load8_u 0 65
000076: 64 | f64.gt
000077: fd 48 | f64x2.ne
000079: 48 | i32.lt_s
00007a: 48 | i32.lt_s
00007b: 48 | i32.lt_s
00007c: 48 | i32.lt_s
00007d: 48 | i32.lt_s
00007e: 48 | i32.lt_s
00007f: 48 | i32.lt_s
000080: 48 | i32.lt_s
000081: 48 | i32.lt_s
000082: 48 | i32.lt_s
000083: b7 | f64.convert_i32_s
000084: 48 | i32.lt_s
000085: 48 | i32.lt_s
000086: 8d | f32.ceil
000087: 48 | i32.lt_s
000088: 48 | i32.lt_s
000089: 48 | i32.lt_s
00008a: 48 | i32.lt_s
00008b: 48 | i32.lt_s
00008c: aa | i32.trunc_f64_s
00008d: 71 | i32.and
00008e: bc | i32.reinterpret_f32
00008f: 0b | end
```
_______________
### Additional information
A combination of afl-fuzz++4.03a and Wasmlike, an Xsmith-based random program generator produced the wasm module that caused the crash.
|
Certain wasm binary causes `wasm2wat`, `wasm2c`, `wasm-decompile`, and `wasm-validate` to crash.
|
https://api.github.com/repos/WebAssembly/wabt/issues/2199/comments
| 1 |
2023-04-14T07:36:31Z
|
2023-05-10T00:46:32Z
|
https://github.com/WebAssembly/wabt/issues/2199
| 1,667,696,676 | 2,199 |
[
"WebAssembly",
"wabt"
] |
Per discussion in #2194
@sbc100 @keith We can definitely write a custom test for this, but would you have thoughts on the best way to add this to the existing harness. The test probably has to look something like this.
```
**Wasm module**
memory size = 1
func foo that accesses memory index 2
**Compilation**
Compile above module with
- flag `-DWASM_RT_TRAP_HANDLER=trap_handler`
- A main func that invokes the foo
- A `trap_handler` func
Test succeeds if trap_handler is called and fails otherwise.
```
|
wasm2c: custom trap handler function needs testing
|
https://api.github.com/repos/WebAssembly/wabt/issues/2195/comments
| 0 |
2023-04-10T17:33:36Z
|
2023-04-11T03:30:52Z
|
https://github.com/WebAssembly/wabt/issues/2195
| 1,661,105,435 | 2,195 |
[
"WebAssembly",
"wabt"
] |
In file `wabt/src/leb128.cc`, function `ReadU64Leb128`:
This snippet is incorrect. It appears to have been copied from `ReadU32Leb128`:
```
else if (p + 9 < end && (p[9] & 0x80) == 0) {
// The top bits set represent values > 32 bits.
if (p[9] & 0xf0) {
return 0;
}
*out_value = LEB128_10(uint64_t);
return 10;
}
```
The right code is:
```
else if (p + 9 < end && (p[9] & 0x80) == 0) {
// The top bits set represent values > 64 bits.
if (p[9] & 0xfe) {
return 0;
}
*out_value = LEB128_10(uint64_t);
return 10;
}
```
The number of used bits in byte 10 equals 64 - 9*7 = 1 bit. Only one bit in the final byte is a part of the 64-bit value. Therefore, all the remaining 7 bits of the last byte must be zero. The check for that is `if (p[9] & 0xfe) {`.
|
Copy/paste bug in ReadU64LEB128
|
https://api.github.com/repos/WebAssembly/wabt/issues/2192/comments
| 2 |
2023-04-08T10:17:35Z
|
2023-06-09T19:07:11Z
|
https://github.com/WebAssembly/wabt/issues/2192
| 1,659,477,193 | 2,192 |
[
"WebAssembly",
"wabt"
] |
Trying to get #2046 closed off (use of globals preventing the wasm2c runtime from being thread-safe).
It looks like the only remaining blocker is the `static char* g_alt_stack` variable, which currently gets malloc'ed once per process via `wasm_rt_init()` which calls `os_install_signal_handler()`.
The challenge is that: if we want the runtime to be thread-safe, every thread will need a **different** allocated region for the alt stack, so that each thread can (in theory) be handling stack exhaustion by running the SIGSEGV signal handler at the same time. Each thread will have to install its own alt stack separately by calling `sigaltstack()`. (The signal handler itself only has to be installed once per process.)
I think my preferred way to fix this would be:
- we eliminate the global `g_alt_stack` variable
- we add a new API pair that looks like:
```c
void* wasm_rt_thread_init();
wasm_rt_thread_free(void*);
```
`wasm_rt_thread_init()` is responsible for (a) malloc'ing the altstack (sadly this has to be done at runtime because SIGSTKSZ is only known at runtime), (b) installing it via `sigaltstack()`, and (c) returning it via an opaque `void*` that the caller has to keep around. `wasm_rt_thread_free()` does the reverse (de-installing the altstack **if** it's still the current altstack, and freeing the memory either way)
If the host wants to use wasm2c-generated code across multiple threads, it needs to call `wasm_rt_thread_init()` in each thread before calling in to a wasm2c-generated module.
- we don't require every user to call these functions (especially not in single-threaded code), but we change the signature of `wasm_rt_init()` and `wasm_rt_free()` to be:
```c
void* wasm_rt_init();
wasm_rt_free(void*);
```
so that they can internally call `wasm_rt_thread_init()` and `wasm_rt_thread_free()` for whatever thread they are run on.
I think I like this design better than the gymnastics of trying to make `g_alt_stack` a thread-local global and worrying about managing it on a per-thread basis (e.g., what happens if the user calls `wasm_rt_thread_init()` on the same thread that they called `wasm_rt_free()` on), but it does increase the burden for the host of having to keep this `void*` around.
@shravanrn @sbc100 Do you have thoughts?
|
wasm2c runtime: add per-thread init/free, and make wasm_rt_init/free return and take a `void*`?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2189/comments
| 3 |
2023-04-06T18:40:21Z
|
2023-12-04T02:23:04Z
|
https://github.com/WebAssembly/wabt/issues/2189
| 1,657,882,802 | 2,189 |
[
"WebAssembly",
"wabt"
] |
I don't know to what degree that matters, but #1968 disabled building on latest LTS Ubuntu (22.04), which only has CMake 3.14 at the moment. Ubuntu tends to lag behind Debian.
|
Ubuntu 22.04 doesn't have CMake 3.16
|
https://api.github.com/repos/WebAssembly/wabt/issues/2187/comments
| 4 |
2023-04-06T17:17:06Z
|
2023-04-06T18:42:12Z
|
https://github.com/WebAssembly/wabt/issues/2187
| 1,657,784,969 | 2,187 |
[
"WebAssembly",
"wabt"
] |
Consider this snippet
```
(module
(func $f (param $y f32) (param $y1 f32) (result f32) (result f32) (result f32)
(local $y2 f32)
(local.set $y2 (f32.const 11.0))
(f32.sub (f32.const -1.0) local.get $y) ;; A
(f32.sub local.get $y local.get $y1 local.get $y2) ;; B
)
(func (export "main") (result f32) (result f32) (result f32)
(call $f (f32.const 2.0) (f32.const 10.0))
)
)
```
Per specification,

Seemingly, both (;A;) and (;B;) don't comply with the grammar. However,
# Observed behaviour
The code is processed with wabt.
# Expected behaviour
When ran with wabt, a parse error is raised on line 5 saying that "(" was expected, but "local.get" found.
|
Compliance with 6.5.10
|
https://api.github.com/repos/WebAssembly/wabt/issues/2186/comments
| 3 |
2023-03-30T11:39:04Z
|
2023-03-31T22:58:12Z
|
https://github.com/WebAssembly/wabt/issues/2186
| 1,647,445,783 | 2,186 |
[
"WebAssembly",
"wabt"
] |
### Describe the bug
Certain `hang.wasm` causes `wasm2c` an infinite loop. `wasm2c` tries to access a memory that is not permitted instead of providing `type mismatch` error for a while.
`wasm2c --version`: 1.0.32 (git~1.0.32-46-g47a589a1)
--------------------------
### Content of the file that causes the issue:
`vim hang.wasm`:
```
^@asm^A^@^@^@^A^G^A`^B{^?^A~^C^B^A^@^@^L^A^H^@^@^@#^@^@^@^@^@^?
^A^G^Aàÿÿ^O^?^K
```
`cat hang.wasm`:
```
asm`{~
#
???
```
--------------------------
### Steps to reproduce:
Here is the file for the bug:
[hang.wasm.txt](https://github.com/WebAssembly/wabt/files/11082815/hang.wasm.txt) (Remove .txt extension and save as .wasm)
* Install and build WABT
* Run wasm2c on the test file: `wasm2c hang.wasm`
* Observe the crash: It will be observed that `wasm2c` cannot finish the execution.
`wasm-validate hang.wasm` output: `Segmentation fault`
`gdb wasm-validate` and subsequent `run hang.wasm` output:
```
Program received signal SIGSEGV, Segmentation fault.
0x000000000047d8c6 in std::vector<wabt::TypeChecker::Label, std::allocator<wabt::TypeChecker::Label> >::_M_realloc_insert<wabt::LabelType&, std::vector<wabt::Type, std::allocator<wabt::Type> > const&, std::vector<wabt::Type, std::allocator<wabt::Type> > const&, unsigned long> (this=this@entry=0x7fffffffdd10, __position=__position@entry=non-dereferenceable iterator for std::vector, __args=@0x7fffffffd8d8: 0, __args=@0x7fffffffd8d8: 0, __args=@0x7fffffffd8d8: 0, __args=@0x7fffffffd8d8: 0) at /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:1762
1762 return (__len < size() || __len > max_size()) ? max_size() : __len;
```
--------------------------
### Expected Behavior:
The expected output should be an error like other related tools would provide as below. To cite an example, run `wasm2wat` on the test file:
`wasm2wat hang.wasm`:
The output will be:
```
Expected_Behavior/hang.wasm:0000027: error: type mismatch in implicit return, expected [i64] but got []
```
--------------------------
### Additional information
A combination of afl-fuzz++4.03a and Wasmlike, an Xsmith-based random program generator produced the snippet of code that caused the crash. https://www.flux.utah.edu/project/xsmith
|
wasm2c hangs on certain inputs and cannot finish execution for a while.
|
https://api.github.com/repos/WebAssembly/wabt/issues/2180/comments
| 5 |
2023-03-27T20:41:27Z
|
2023-03-31T17:02:49Z
|
https://github.com/WebAssembly/wabt/issues/2180
| 1,642,781,849 | 2,180 |
[
"WebAssembly",
"wabt"
] |
```c
/* Construct the module instance. */
wasm2c_fac_instantiate(&fac);
````
this api changed, use `wasm2c_fac_instantiate(&db2, NULL, NULL);` get this linker error:
```sh
lld: error: undefined symbol: _w2c_env_0x5F_main_argc_argv
>>> referenced by sqlite.c:327248 (test.c:327248)
>>> db2.o:(symbol _w2c_db2_0x5F_main_void+0x2b5)
lld: error: undefined symbol: _w2c_wasi__snapshot__preview1_proc_exit
>>> referenced by sqlite.c:327315 (sqlite.c:327315)
>>> db2.o:(symbol _w2c_db2_0x5F_wasi_proc_exit+0x4f)
lld: error: undefined symbol: _w2c_wasi__snapshot__preview1_args_sizes_get
>>> referenced by sqlite.c:327304 (sqlite.c:327304)
>>> db2.o:(symbol _w2c_db2_0x5F_wasi_args_sizes_get+0x5b)
lld: error: undefined symbol: _w2c_wasi__snapshot__preview1_args_get
>>> referenced by sqlite.c:327292 (sqlite.c:327292)
>>> db2.o:(symbol _w2c_db2_0x5F_wasi_args_get+0x5b)
```
|
wasm2c docs expired, build with linker error
|
https://api.github.com/repos/WebAssembly/wabt/issues/2175/comments
| 9 |
2023-03-15T13:22:54Z
|
2023-03-16T07:48:16Z
|
https://github.com/WebAssembly/wabt/issues/2175
| 1,625,523,997 | 2,175 |
[
"WebAssembly",
"wabt"
] |
I want build `libwasm-rt-impl.a` without `libwabt.a` for cross build. (libwabt.a not needed)
try build with `-DBUILD_TESTS=OFF -DWITH_WASI=OFF -DBUILD_TOOLS=OFF -DBUILD_LIBWASM=OFF `, can not turn it off.
|
need a cmake option turn off build libwabt.a ( libwasm-rt-impl.a only)
|
https://api.github.com/repos/WebAssembly/wabt/issues/2174/comments
| 1 |
2023-03-15T06:16:13Z
|
2023-03-15T06:34:41Z
|
https://github.com/WebAssembly/wabt/issues/2174
| 1,624,829,637 | 2,174 |
[
"WebAssembly",
"wabt"
] |
### Describe the bug
'@' before a quote (") causes a libc++abi.dylib crash while converting ".wat" format into ".wasm" format using wat2wasm.
`wat2wasm --version`: 1.0.32 (git~1.0.32-35-g9990b0cf)
---------------
The following minimized code causes wat2wasm to crash.
```
(module (memory $mem 1)
;;(@_memory " (memory $mem)) ;; Space in between '@' and '"' avoids crash
;; A comment below the next line containing a '"' will also avoid a crash
(@_memory" (memory $mem))
(func
$main
(export "_main")
(result i32)
i32.const 21))
```
Absolute minimum example:
```
(@"
```
---------------
### Steps to reproduce:
Here are the test files: (Remove ".txt" and save them ".wat" files)
[wabt_crash.wat.txt](https://github.com/WebAssembly/wabt/files/10936843/wabt_crash.wat.txt)
[wabt_crash_min.wat.txt](https://github.com/WebAssembly/wabt/files/10936844/wabt_crash_min.wat.txt)
* Install and build WABT
* Run wat2wasm on the test file: `wat2wasm wabt_crash.wat` and `wat2wasm wabt_crash_min.wat`
* Observe the crash:
```
libc++abi.dylib: terminating with uncaught exception of type std::length_error: basic_string
[1] 4522 abort wat2wasm wabt_crash.wat
```
---------------
### Expected Behavior:
Expected output should be an error (like the one below) produced by ` wat2wasm` instead of a crash.
For example, if the test file replaces the '@' with a '*', `wat2wasm` gives the expected error below when run with `wat2wasm expected.wat`, which points out the missing end quote.
```
expected.wat:4:29: error: newline in string
(*_memory" (memory $mem))
^
expected.wat:5:9: error: newline in string
(func
^
expected.wat:6:10: error: newline in string
$main
^
expected.wat:7:21: error: newline in string
(export "_main")
^
expected.wat:8:17: error: newline in string
(result i32)
^
expected.wat:9:19: error: newline in string
i32.const 21))
^
expected.wat:4:4: error: unexpected token (, expected ).
(*_memory" (memory $mem))
```
---------------------
### Additional information
A combination of afl-fuzz++4.03a and Wasmlike, an Xsmith-based random program generator produced the snippet of code that caused the crash. https://www.flux.utah.edu/project/xsmith
---------------
|
'@' before a quote (") causes a libc++abi.dylib crash using wat2wasm.
|
https://api.github.com/repos/WebAssembly/wabt/issues/2165/comments
| 2 |
2023-03-09T23:07:30Z
|
2023-06-17T09:47:53Z
|
https://github.com/WebAssembly/wabt/issues/2165
| 1,618,118,032 | 2,165 |
[
"WebAssembly",
"wabt"
] |
Error message:
`wasm-decompile: /home/kangm/code/wabt/src/decompiler.cc:688: std::__cxx11::string wabt::Decompiler::InitExp(const ExprList&): Assertion `!el.empty()' failed.`
PR:
https://github.com/WebAssembly/wabt/pull/2163
|
wasm-decompile fails on wasm files containing passive data segments
|
https://api.github.com/repos/WebAssembly/wabt/issues/2164/comments
| 0 |
2023-03-08T11:22:30Z
|
2023-07-30T23:27:39Z
|
https://github.com/WebAssembly/wabt/issues/2164
| 1,615,105,948 | 2,164 |
[
"WebAssembly",
"wabt"
] |
Some functions return a `Result` enum - and because the return value is taken up by the `Result` value, these functions also pass in a pointer to write the intended 'output' into - a good example are the `Parse*` functions in [`literal.cc`](https://github.com/WebAssembly/wabt/blob/main/src/literal.cc).
Personally, I find that this is needlessly confusing given Rust's [Result enums](https://doc.rust-lang.org/std/result/enum.Result.html) - it kinda feels like this is emulating half of Rust's Result counterpart, but not quite, and makes the resulting function calls less readable as well.
I suggest that the Result struct should also encapsulate return values as well, so [this line]((https://github.com/WebAssembly/wabt/blob/main/src/literal.cc#L283)) in `literal.cc` would go from something like this:
```c++
} else if (Succeeded(ParseHexdigit(*s, &digit))) {
```
to something like this:
```c++
} else if (auto result = ParseHexdigit(*s); Succeeded(result)) {
digit = result.get()
```
I don't think this should yield any runtime costs either, since the copy operation should be elided - wondering if you will be open to a pr on this
|
Lexer: Refactor Result and make functions more pure
|
https://api.github.com/repos/WebAssembly/wabt/issues/2159/comments
| 3 |
2023-03-05T15:42:12Z
|
2023-04-13T18:45:17Z
|
https://github.com/WebAssembly/wabt/issues/2159
| 1,610,249,088 | 2,159 |
[
"WebAssembly",
"wabt"
] |
Can wasm-interp be built for wasm?
Solving for https://github.com/WebAssembly/binaryen/issues/5530
|
wasm-interp for the web
|
https://api.github.com/repos/WebAssembly/wabt/issues/2157/comments
| 13 |
2023-03-03T22:33:08Z
|
2023-03-05T18:24:09Z
|
https://github.com/WebAssembly/wabt/issues/2157
| 1,609,337,471 | 2,157 |
[
"WebAssembly",
"wabt"
] |
Is there way to tell wasm-strip not to remove the calls that are being called with Module.ccall. Currently it strips everything and then javascript cannot call the wasm functions :-)
|
wasm-strip removes also names that are being used for Module.ccall
|
https://api.github.com/repos/WebAssembly/wabt/issues/2156/comments
| 9 |
2023-03-02T06:17:55Z
|
2023-03-03T19:14:13Z
|
https://github.com/WebAssembly/wabt/issues/2156
| 1,606,178,387 | 2,156 |
[
"WebAssembly",
"wabt"
] |
Hi,
I used emcsripten to compile a c/c++ program to webassembly. It generated some wasm files.
Now, I want to identify which source code (.c/.cpp file) generated a wasm file? How can I identify?
I also used wasm2wat, wasm-decompile, wasm-objdump, and wasm2c to identify a link to a source code, but I couldn't find any link between them to a c/c++ file.
|
How to find source code that generated a wasm file?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2155/comments
| 2 |
2023-02-28T06:53:26Z
|
2023-03-07T05:41:07Z
|
https://github.com/WebAssembly/wabt/issues/2155
| 1,602,470,952 | 2,155 |
[
"WebAssembly",
"wabt"
] |
```
===> Building for wabt-1.0.32
[ 0% 7/137] /usr/local/libexec/ccache/c++ -D__STDC_FORMAT_MACROS=1 -D__STDC_LIMIT_MACROS=1 -Dwabt_fuzz_EXPORTS -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -Wold-style-cast -fno-exceptions -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -DNDEBUG -fPIC -Wall -Wextra -Wno-unused-parameter -Wpointer-arith -Wuninitialized -fsanitize=fuzzer,address -std=c++17 -MD -MT CMakeFiles/wabt-fuzz.dir/src/binary-reader-logging.cc.o -MF CMakeFiles/wabt-fuzz.dir/src/binary-reader-logging.cc.o.d -o CMakeFiles/wabt-fuzz.dir/src/binary-reader-logging.cc.o -c /usr/ports/www/wabt/work/wabt-1.0.32/src/binary-reader-logging.cc
FAILED: CMakeFiles/wabt-fuzz.dir/src/binary-reader-logging.cc.o
/usr/local/libexec/ccache/c++ -D__STDC_FORMAT_MACROS=1 -D__STDC_LIMIT_MACROS=1 -Dwabt_fuzz_EXPORTS -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -Wold-style-cast -fno-exceptions -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -DNDEBUG -fPIC -Wall -Wextra -Wno-unused-parameter -Wpointer-arith -Wuninitialized -fsanitize=fuzzer,address -std=c++17 -MD -MT CMakeFiles/wabt-fuzz.dir/src/binary-reader-logging.cc.o -MF CMakeFiles/wabt-fuzz.dir/src/binary-reader-logging.cc.o.d -o CMakeFiles/wabt-fuzz.dir/src/binary-reader-logging.cc.o -c /usr/ports/www/wabt/work/wabt-1.0.32/src/binary-reader-logging.cc
/usr/ports/www/wabt/work/wabt-1.0.32/src/binary-reader-logging.cc:17:10: fatal error: 'wabt/binary-reader-logging.h' file not found
#include "wabt/binary-reader-logging.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Version: 1.0.32
clang-14
FteeBSD 13.1
|
Build with BUILD_FUZZ_TOOLS=ON fails: fatal error: 'wabt/binary-reader-logging.h' file not found
|
https://api.github.com/repos/WebAssembly/wabt/issues/2153/comments
| 0 |
2023-02-28T02:38:18Z
|
2023-03-02T01:43:29Z
|
https://github.com/WebAssembly/wabt/issues/2153
| 1,602,268,911 | 2,153 |
[
"WebAssembly",
"wabt"
] |
oss-fuzz has discovered that if a module includes an extremely deep series of nested blocks (e.g. a huge number of nested `if` instructions, each in the parent's "true" block), that `wasm2wat` will crash when trying to run the `Module` destructor, just because each `Block` recursively runs the destructor of its child `IfExpr` which runs the destructor of its child `Block`, etc., and eventually all those nested stack frames cause a stack overflow.
(This is [oss-fuzz #53958](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53958), currently still under embargo.)
I guess I sort of have two ideas for how we can fix this:
1. make `BinaryReaderIR` establish a maximum nesting depth (a `static constexpr BinaryReaderIR::kMaxNestingDepth` member variable?) that would be enforced in `BinaryReaderIR::PushLabel`. This seems to be allowed by https://webassembly.github.io/spec/core/appendix/implementation.html#structure ("the nesting depth of structured control instructions"), although it's a little weird that BinaryReaderIR doesn't seem to enforce *any* implementation-defined limits right now, so this would seemingly be a first for us?
2. somehow make `wabt::intrusive_list`, `Expr`, and `Block` a lot more clever and figure out how to destroy (and traverse?) these deeply nested data structures without literal recursion
Idea 1 seems a lot easier, but less satisfying. I'm guessing some limit like 16,384 is probably safe (both in terms of stack space as well as accommodating all reasonable modules). But it would be interesting to know what other major Wasm implementations do here or if there's a cleaner way to solve this...
|
Very deep nested labels can cause BinaryReaderIR to crash (stack overflow in Module destructor)
|
https://api.github.com/repos/WebAssembly/wabt/issues/2151/comments
| 0 |
2023-02-27T19:25:58Z
|
2023-03-14T06:18:40Z
|
https://github.com/WebAssembly/wabt/issues/2151
| 1,601,810,647 | 2,151 |
[
"WebAssembly",
"wabt"
] |
While wasm-objdump can read the Type section according to the GC proposal:
```
Type[2]:
- type[0] () -> i64
- type[1] (struct (mut i32) (mut i32) (mut i32))
```
It fails reading the Code sections new 0xFB prefix:
`error: 0x64 missing opcode callback at 0x55 (0xfb=<invalid>)`
where `wasm-dis` outputs:
```
(struct.get $1 1
(struct.new $1
(i32.const 1)
(i32.const 2)
(i32.const 3)
)
)
```
|
wasm-objdump GC proposal
|
https://api.github.com/repos/WebAssembly/wabt/issues/2145/comments
| 1 |
2023-02-14T21:33:39Z
|
2023-02-14T21:40:47Z
|
https://github.com/WebAssembly/wabt/issues/2145
| 1,584,861,502 | 2,145 |
[
"WebAssembly",
"wabt"
] |
It would also be great to have support for [WebAssembly / stringref](https://github.com/WebAssembly/stringref) proposal
|
[Feature requiest] stringref proposal
|
https://api.github.com/repos/WebAssembly/wabt/issues/2144/comments
| 1 |
2023-02-13T13:05:54Z
|
2023-03-14T06:23:37Z
|
https://github.com/WebAssembly/wabt/issues/2144
| 1,582,319,317 | 2,144 |
[
"WebAssembly",
"wabt"
] |
Hi~
After reading src code of wasm2c, I found that wasm2c mainly uses enumeration to match and generate C code.And this makes the generated C code look similar to wat.
eg. if I want generated c code like this:
```
if (*hex == '#') {
hex++;
}
```
for now, it would generated like this:
```static void _colorFromHexString(u32 p0, u32 p1) {
u32 l0 = 0, l1 = 0, l2 = 0, l3 = 0;
FUNC_PROLOGUE;
u32 i0, i1, i2, i3;
f32 f1;
f64 d1, d2;
i0 = p0;
i1 = 1u;
i0 += i1;
l0 = i0;
i0 = p0;
i0 = i32_load8_s(Z_envZ_memory, (u64)(i0));
i1 = 35u;
i0 = i0 != i1;
if (i0) {
i0 = p0;
l0 = i0;
}
```
corresponding to wat:
```(func (;7;) (type 3) (param i32 i32)
(local i32 i32 i32 i32)
get_local 0
i32.const 1
i32.add
set_local 2
get_local 0
i32.load8_s
i32.const 35
i32.ne
if ;; label = @1
get_local 0
set_local 2
end
```
Is it possible that we use some method like regular expression to make it easier?
like:
```i0 = i32_load8_s(Z_envZ_memory, (u64)(hex));
if (i0 != 35u) {
l0 = hex + 1u;
}
```
Does it sound feasible?
|
Make wasm2c more readable
|
https://api.github.com/repos/WebAssembly/wabt/issues/2141/comments
| 4 |
2023-02-03T13:04:02Z
|
2023-02-04T11:45:39Z
|
https://github.com/WebAssembly/wabt/issues/2141
| 1,569,811,564 | 2,141 |
[
"WebAssembly",
"wabt"
] |
## Environment:
Host: Windows 10, x86_64
Target: Windows 11, ARM64.
Compiler:
Visual Studio 2022 Version 17.4.4
WABT Version:
```shell
git rev-parse HEAD
8a7b7497bdf78f9099f8d5a3a2c9bde87ddd52da
```
## Reproduce steps:
```shell
mkdir build_win_arm
cd build_win_arm
cmake -G "Visual Studio 17 2022" -A ARM64 ..
cmake --build .
```
### Observed behavior
Failed with error
```shell
config.cc
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\config.cc) [D:\code\workspace\github\wabt\build_win_
arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\binary-writer.cc) [D:\code\workspace\github\wabt\bui
ld_win_arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\c-writer.cc) [D:\code\workspace\github\wabt\build_wi
n_arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\binary.cc) [D:\code\workspace\github\wabt\build_win_
arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\common.cc) [D:\code\workspace\github\wabt\build_win_
arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\apply-names.cc) [D:\code\workspace\github\wabt\build
_win_arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\binary-reader-ir.cc) [D:\code\workspace\github\wabt\
build_win_arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\binary-reader-logging.cc) [D:\code\workspace\github\
wabt\build_win_arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\color.cc) [D:\code\workspace\github\wabt\build_win_a
rm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\binary-reader.cc) [D:\code\workspace\github\wabt\bui
ld_win_arm\wabt.vcxproj]
D:\code\workspace\github\wabt\build_win_arm\include\wabt/config.h(175,1): fatal error C1189: #error: unexpected architecture (compiling source file D:\code\workspace\github\wabt\src\binary-writer-spec.cc) [D:\code\workspace\github\wab
t\build_win_arm\wabt.vcxproj]
```
### Expected Behavior
Build success
|
WABT is not supported on ARM64 windows
|
https://api.github.com/repos/WebAssembly/wabt/issues/2139/comments
| 0 |
2023-02-02T06:13:49Z
|
2023-02-09T02:47:55Z
|
https://github.com/WebAssembly/wabt/issues/2139
| 1,567,393,179 | 2,139 |
[
"WebAssembly",
"wabt"
] |
I've been looking over at using the wabt JS API, as well as [wabt.js](https://github.com/AssemblyScript/wabt.js).
I'm a little confused about why the compiled wabt toolkit is essentially exported as function that returns a promise which resolves to a `WabtModule` class.
This kinda means that for projects incrementally adopting wabt (as I am currently trying to do), (1) there is no tree-shaking available, and (2) many projects (that build to older ES versions without top-level await support) will need to do some major refactoring to support asynchronous loading of the module.
What confuses me even more is that emscripten api seems to load any wasm function synchronously, without any promises - so this tells me that this promise-module thing is a decision made?
I'm wondering if there are reasons for why the emscripten compilation has been done this way, and also if you guys are open to alternative build paths that expose and load the wabt functions independently to support synchronous loading and tree shaking. Could anyone help me with this?
|
Why is the JS api module- and promise-based? / Alternative non-`Promise` Emscripten compilation path
|
https://api.github.com/repos/WebAssembly/wabt/issues/2138/comments
| 2 |
2023-02-01T07:55:25Z
|
2023-02-08T06:38:04Z
|
https://github.com/WebAssembly/wabt/issues/2138
| 1,565,615,123 | 2,138 |
[
"WebAssembly",
"wabt"
] |
This module (assembled with `--debug-names`) can cause an assertion failure in wasm2c:
```wat
(module
(func (param $B0 i32)
(block
(br 0))))
```
The problem is that the `$B0` param conflicts with the generated name of the block label. This is similar to #2035. We may need to split out labels from `DefineLocalScopeName` into maybe a `DefineLabelName` or something. :-/
|
wasm2c local names for params can conflict with names for labels
|
https://api.github.com/repos/WebAssembly/wabt/issues/2136/comments
| 0 |
2023-01-31T07:40:51Z
|
2023-02-07T16:50:08Z
|
https://github.com/WebAssembly/wabt/issues/2136
| 1,563,813,009 | 2,136 |
[
"WebAssembly",
"wabt"
] |
Building wabt 1.0.32 and running testsuite with gcc 13.0.0 on Fedora rawhide (development branch) yields one new test failure, on x86_64, aarch64 and ppc64le (I haven't tested on s390x or i686 yet):
```
- test/wasm2c/spec/float_exprs.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,18 @@
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.32/test/run-spec-wasm2c.py", line 569, in <module>
+ sys.exit(main(sys.argv[1:]))
+ ^^^^^^^^^^^^^^^^^^
+ File "/builddir/build/BUILD/wabt-1.0.32/test/run-spec-wasm2c.py", line 563, in main
+ utils.Executable(main_exe, forward_stdout=True).RunWithArgs()
+ File "/builddir/build/BUILD/wabt-1.0.32/test/utils.py", line 96, in RunWithArgs
+ raise error
+utils.Error: Error running "out/test/wasm2c/spec/float_exprs/float_exprs" (1):
+None
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3083: assertion failed: in Z_float_exprs_86_wasmZ_f32Z2Eno_trichotomy_lt(&Z_float_exprs_86_wasm_instance, 0.f, make_nan_f32(0x400000)): expected 0, got 1.
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3086: assertion failed: in Z_float_exprs_86_wasmZ_f32Z2Eno_trichotomy_le(&Z_float_exprs_86_wasm_instance, 0.f, make_nan_f32(0x400000)): expected 0, got 1.
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3089: assertion failed: in Z_float_exprs_86_wasmZ_f32Z2Eno_trichotomy_gt(&Z_float_exprs_86_wasm_instance, 0.f, make_nan_f32(0x400000)): expected 0, got 1.
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3092: assertion failed: in Z_float_exprs_86_wasmZ_f32Z2Eno_trichotomy_ge(&Z_float_exprs_86_wasm_instance, 0.f, make_nan_f32(0x400000)): expected 0, got 1.
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3095: assertion failed: in Z_float_exprs_86_wasmZ_f64Z2Eno_trichotomy_lt(&Z_float_exprs_86_wasm_instance, 0.0000000000000000L, make_nan_f64(0x8000000000000)): expected 0, got 1.
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3098: assertion failed: in Z_float_exprs_86_wasmZ_f64Z2Eno_trichotomy_le(&Z_float_exprs_86_wasm_instance, 0.0000000000000000L, make_nan_f64(0x8000000000000)): expected 0, got 1.
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3101: assertion failed: in Z_float_exprs_86_wasmZ_f64Z2Eno_trichotomy_gt(&Z_float_exprs_86_wasm_instance, 0.0000000000000000L, make_nan_f64(0x8000000000000)): expected 0, got 1.
+out/test/wasm2c/spec/float_exprs/float_exprs-main.c:3104: assertion failed: in Z_float_exprs_86_wasmZ_f64Z2Eno_trichotomy_ge(&Z_float_exprs_86_wasm_instance, 0.0000000000000000L, make_nan_f64(0x8000000000000)): expected 0, got 1.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1 @@
-794/794 tests passed.
+786/794 tests passed.
```
Full dependency chain changes and build logs at [Fedora continuous rebuild service](https://koschei.fedoraproject.org/package/wabt?collection=f38)
|
wasm2c/spec/float_exprs.txt fails with GCC 13.0.0
|
https://api.github.com/repos/WebAssembly/wabt/issues/2130/comments
| 5 |
2023-01-17T16:56:36Z
|
2023-05-04T05:40:34Z
|
https://github.com/WebAssembly/wabt/issues/2130
| 1,536,722,347 | 2,130 |
[
"WebAssembly",
"wabt"
] |
When I tried to transform .wasm file to other type file, i got the error message "invalid section size: extends past end". Is there anyone who can help?

|
[Error] invalid section size: extends past end
|
https://api.github.com/repos/WebAssembly/wabt/issues/2128/comments
| 0 |
2023-01-16T03:09:36Z
|
2023-01-16T03:23:45Z
|
https://github.com/WebAssembly/wabt/issues/2128
| 1,534,199,705 | 2,128 |
[
"WebAssembly",
"wabt"
] |
When I run `wast2json` on the `test/core/select.wast` test from https://github.com/WebAssembly/spec, I see the following failure:
```
wast2json test/core/select.wast
test/core/select.wast:526:55: error: unexpected token "result", expected an instr.
(func (result i32) unreachable select (result i32) (result))
^^^^^^
test/core/select.wast:527:55: error: unexpected token "result", expected an instr.
(func (result i32) unreachable select (result i32) (result) select)
^^^^^^
test/core/select.wast:528:51: error: unexpected token "result", expected an instr.
...nc (result i32) unreachable select (result) (result i32) select (result i32))
```
|
wast2json fails on test/core/select.wast
|
https://api.github.com/repos/WebAssembly/wabt/issues/2125/comments
| 3 |
2023-01-10T02:24:00Z
|
2023-01-11T00:50:47Z
|
https://github.com/WebAssembly/wabt/issues/2125
| 1,526,655,990 | 2,125 |
[
"WebAssembly",
"wabt"
] |
Not sure how feasible it would be, but it would be great if the generated C file implemented the [WebAssembly C API](https://github.com/WebAssembly/wasm-c-api/blob/main/include/wasm.h) for instantiation, dynamic enumeration of exports, integration with imports etc. for better interop with other engines.
|
Implement WebAssembly C API for wasm2c output
|
https://api.github.com/repos/WebAssembly/wabt/issues/2123/comments
| 2 |
2023-01-07T15:29:51Z
|
2023-01-11T09:05:02Z
|
https://github.com/WebAssembly/wabt/issues/2123
| 1,523,917,332 | 2,123 |
[
"WebAssembly",
"wabt"
] |
When running 1.0.32 testsuite on aarch64 under Fedora 36, I get the following new failure:
```
- test/spec/relaxed-simd/relaxed_madd_nmadd.txt
expected error code 0, got 2.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1,3 @@
-7/7 tests passed.
+out/test/spec/relaxed-simd/relaxed_madd_nmadd.wast:38: mismatch in result of assert_return: expected v128 f32:0.000000f32:0.000000f32:0.000000f32:0.000000 (2 alternatives), got v128 i32x4:0xad000000 0xad000000 0xad000000 0xad000000
+out/test/spec/relaxed-simd/relaxed_madd_nmadd.wast:73: mismatch in result of assert_return: expected v128 f64:0.000000f64:0.000000 (2 alternatives), got v128 i32x4:0x00000000 0xbca00000 0x00000000 0xbca00000
+5/7 tests passed.
```
Similarly on ppc64le:
```
- test/spec/relaxed-simd/relaxed_madd_nmadd.txt
expected error code 0, got 2.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1,3 @@
-7/7 tests passed.
+out/test/spec/relaxed-simd/relaxed_madd_nmadd.wast:38: mismatch in result of assert_return: expected v128 f32:0.000000f32:0.000000f32:0.000000f32:0.000000 (2 alternatives), got v128 i32x4:0xad000000 0xad000000 0xad000000 0xad000000
+out/test/spec/relaxed-simd/relaxed_madd_nmadd.wast:73: mismatch in result of assert_return: expected v128 f64:0.000000f64:0.000000 (2 alternatives), got v128 i32x4:0x00000000 0xbca00000 0x00000000 0xbca00000
+5/7 tests passed.
```
And on s390x (big-endian):
```
- test/spec/relaxed-simd/relaxed_madd_nmadd.txt
expected error code 0, got 2.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1,3 @@
-7/7 tests passed.
+out/test/spec/relaxed-simd/relaxed_madd_nmadd.wast:38: mismatch in result of assert_return: expected v128 f32:0.000000f32:0.000000f32:0.000000f32:0.000000 (2 alternatives), got v128 i32x4:0xad000000 0xad000000 0xad000000 0xad000000
+out/test/spec/relaxed-simd/relaxed_madd_nmadd.wast:73: mismatch in result of assert_return: expected v128 f64:0.000000f64:0.000000 (2 alternatives), got v128 i32x4:0x00000000 0xbca00000 0x00000000 0xbca00000
+5/7 tests passed.
```
|
spec/relaxed-simd/relaxed_madd_nmadd.txt test fails on ARM 64-bit (aarch64), Power8 (ppc64le), z/Architecture (s390x)
|
https://api.github.com/repos/WebAssembly/wabt/issues/2118/comments
| 2 |
2023-01-03T18:19:11Z
|
2023-01-11T09:06:29Z
|
https://github.com/WebAssembly/wabt/issues/2118
| 1,517,758,634 | 2,118 |
[
"WebAssembly",
"wabt"
] |
0001722: error: unable to read string: section name
|
这反编译出这错什么原因? [What is the reason for this error in decompilation?]
|
https://api.github.com/repos/WebAssembly/wabt/issues/2112/comments
| 1 |
2022-12-28T14:45:26Z
|
2022-12-28T17:54:46Z
|
https://github.com/WebAssembly/wabt/issues/2112
| 1,512,865,996 | 2,112 |
[
"WebAssembly",
"wabt"
] |
If wabt was compiled for a wasi target, any wasi runtime can run it which provides flexibility both for ad-hoc CLI use (broader than the binaries on the release page) as well embedded use (without dynamic libraries)
For example, wazero could use this to keep dev dependencies light for wat based tests and also spec tests. Right now, we need an offline installation step and shell forking to use `wat2wasm`
|
build and publish a wasi binary on release
|
https://api.github.com/repos/WebAssembly/wabt/issues/2101/comments
| 8 |
2022-12-14T02:32:11Z
|
2023-06-12T05:15:55Z
|
https://github.com/WebAssembly/wabt/issues/2101
| 1,495,505,227 | 2,101 |
[
"WebAssembly",
"wabt"
] |
Currently wasm-validate outputs the offending operation, however the context needs to be grep'ed manually:
```
wasm-validate main.wasm
main.wasm:000007b: error: type mismatch in i32.and, expected [i32, i32] but got [... i64, i32]
wasm-objdump main.wasm -d | grep -B3 7b
000077: 20 03 | local.get 3 <width>
000079: 53 | i64.lt_s
00007a: 71 | i32.and
00007b: 04 40 | if
```
It would be nice to have a flag for wasm-validate to directly output the context, maybe even smart enough to trace back all relevant preceding ops.
|
option for wasm-validate to output context
|
https://api.github.com/repos/WebAssembly/wabt/issues/2100/comments
| 0 |
2022-12-13T12:05:49Z
|
2023-03-15T11:58:23Z
|
https://github.com/WebAssembly/wabt/issues/2100
| 1,494,103,649 | 2,100 |
[
"WebAssembly",
"wabt"
] |
The `spectest_make_externref()` in [test/spec-wasm2c-prefix.c:203](https://github.com/WebAssembly/wabt/blob/main/test/spec-wasm2c-prefix.c#L203) assumes that `u64` (`uint64_t`) can be converted to `wasm_rt_externref_t` (`void *`). This is not the case on 32-bit platforms:
```
- test/regress/regress-2039.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,19 @@
+out/test/regress/regress-2039/regress-2039-main.c: In function ‘spectest_make_externref’:
+out/test/regress/regress-2039/regress-2039-main.c:205:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
+ 205 | return (wasm_rt_externref_t)(x + 1); // externref(0) is not null
+ | ^
+At top level:
+cc1: note: unrecognized command-line option ‘-Wno-tautological-constant-out-of-range-compare’ may have been intended to silence earlier diagnostics
+cc1: note: unrecognized command-line option ‘-Wno-ignored-optimization-argument’ may have been intended to silence earlier diagnostics
+cc1: all warnings being treated as errors
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.31/test/run-spec-wasm2c.py", line 554, in <module>
+ sys.exit(main(sys.argv[1:]))
+ File "/builddir/build/BUILD/wabt-1.0.31/test/run-spec-wasm2c.py", line 536, in main
+ o_filenames.append(Compile(cc, main_filename, out_dir, includes))
+ File "/builddir/build/BUILD/wabt-1.0.31/test/run-spec-wasm2c.py", line 408, in Compile
+ cc.RunWithArgsForStdout(*args)
+ File "/builddir/build/BUILD/wabt-1.0.31/test/utils.py", line 88, in RunWithArgsForStdout
+ raise error
+utils.Error: Error running "gcc -I/builddir/build/BUILD/wabt-1.0.31/wasm2c -c out/test/regress/regress-2039/regress-2039-main.c -o out/test/regress/regress-2039/regress-2039-main.o -O2 -Wall -Werror -Wno-unused -Wno-ignored-optimization-argument -Wno-tautological-constant-out-of-range-compare -Wno-infinite-recursion -Wno-array-bounds -Wbidi-chars=none -fno-optimize-sibling-calls -frounding-math -fsignaling-nans -std=c99 -D_DEFAULT_SOURCE" (1):
+None
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +0,0 @@
-0/0 tests passed.
```
The same error occurs with all wasm2c tests. This can be fixed with a trivial patch:
```diff
diff -up wabt-1.0.31/test/spec-wasm2c-prefix.c.32bit wabt-1.0.31/test/spec-wasm2c-prefix.c
--- wabt-1.0.31/test/spec-wasm2c-prefix.c.32bit 2022-11-14 05:43:40.000000000 +0100
+++ wabt-1.0.31/test/spec-wasm2c-prefix.c 2022-12-11 22:17:36.181299604 +0100
@@ -200,7 +200,7 @@ static bool is_equal_wasm_rt_funcref_t(w
(x.module_instance == y.module_instance);
}
-wasm_rt_externref_t spectest_make_externref(u64 x) {
+wasm_rt_externref_t spectest_make_externref(uintptr_t x) {
return (wasm_rt_externref_t)(x + 1); // externref(0) is not null
}
```
Additionally, the example code in [wasm2c/examples/fac/fac.c](https://github.com/WebAssembly/wabt/blob/main/wasm2c/examples/fac/fac.c) makes assumptions that memory addresses are 64-bit, too, for example in lines [71](https://github.com/WebAssembly/wabt/blob/main/wasm2c/examples/fac/fac.c#L71), [81](https://github.com/WebAssembly/wabt/blob/main/wasm2c/examples/fac/fac.c#L81), [97](https://github.com/WebAssembly/wabt/blob/main/wasm2c/examples/fac/fac.c#L97) and [106](https://github.com/WebAssembly/wabt/blob/main/wasm2c/examples/fac/fac.c#L106). The code should use `uintptr_t` instead in the above lines, too.
|
wasm2c tests fail on 32-bit due to assumption that pointers are 64-bit
|
https://api.github.com/repos/WebAssembly/wabt/issues/2099/comments
| 3 |
2022-12-11T21:37:24Z
|
2023-01-08T22:21:30Z
|
https://github.com/WebAssembly/wabt/issues/2099
| 1,490,471,257 | 2,099 |
[
"WebAssembly",
"wabt"
] |
A function type which references another function type as a parameter type corrupts the internal state of wat2wasm, causing type lookup to fail, apparently returning (-1 / 0xffffffff / 4294967295) internally. The module and output are included below. This happens both with the current HEAD of the main branch and with the package version for Ubuntu 20.04. Removing the line that defines `$T2` alllows wat2wasm to complete successfully.
Module:
```
(module
(type $T1 (func (result i32)))
(type $T2 (func (param (ref $T1)) (result i32)))
(func (param $f (ref $T1)) (result i32)
(call_ref (local.get $f))))
```
Output follows:
```
pat@quercus:~/src/crack$ wat2wasm --enable-function-references scratch2.wat -o scratch2.wasm
scratch2.wat:7:5: error: function type variable out of range: 4294967295 (max 2)
(call_ref (local.get $f))
^^^^^^^^
scratch2.wat:7:5: error: type mismatch in implicit return, expected [i32] but got []
(call_ref (local.get $f))
^^^^^^^^
pat@quercus:~/src/crack$ wat2wasm --version
1.0.27
pat@quercus:~/src/crack$ ../wabt/bin/wat2wasm --enable-function-references scratch2.wat -o scratch2.wasm
scratch2.wat:7:5: error: function type variable out of range: 4294967295 (max 2)
(call_ref (local.get $f))
^^^^^^^^
scratch2.wat:7:5: error: type mismatch in implicit return, expected [i32] but got []
(call_ref (local.get $f))))
^^^^^^^^
pat@quercus:~/src/crack$ ../wabt/bin/wat2wasm --version
1.0.31 (git~1.0.31-22-ged0b720c)
```
|
wat2wasm internal corruption due to presence of functor type
|
https://api.github.com/repos/WebAssembly/wabt/issues/2098/comments
| 1 |
2022-12-04T20:51:44Z
|
2022-12-04T21:13:16Z
|
https://github.com/WebAssembly/wabt/issues/2098
| 1,475,174,777 | 2,098 |
[
"WebAssembly",
"wabt"
] |
The following module
(module
(func (param (ref $T)) (result)
(nop)))
aborts in both the current main HEAD and the most recent package version on Ubuntu 20.04:
pat@quercus:~/src/crack$ ../wabt/bin/wat2wasm --version
1.0.31 (git~1.0.31-22-ged0b720c)
pat@quercus:~/src/crack$ ../wabt/bin/wat2wasm --enable-function-references scratch.wat -o scratch.wasm
wat2wasm: /home/pat/src/wabt/src/wast-parser.cc:327: void wabt::(anonymous namespace)::ResolveTypeName(const wabt::Module &, wabt::Type &, wabt::Index, const std::unordered_map<uint32_t, std::string> &): Assertion `type_index != kInvalidIndex' failed.
Aborted (core dumped)
pat@quercus:~/src/crack$ wat2wasm --version
1.0.27
pat@quercus:~/src/crack$ wat2wasm --enable-function-references scratch.wat -o scratch.wasm
wat2wasm: ./src/wast-parser.cc:279: void wabt::{anonymous}::ResolveTypeName(const wabt::Module&, wabt::Type&, wabt::Index, const std::unordered_map<unsigned int, std::__cxx11::basic_string<char> >&): Assertion `type_index != kInvalidIndex' failed.
Aborted (core dumped)
If `(ref $T)` is replaced with `$T`, I get an error message. Not a huge problem, just a little confusing.
|
wat2wasm aborts when function has undefined reference type in parameter
|
https://api.github.com/repos/WebAssembly/wabt/issues/2097/comments
| 1 |
2022-12-04T19:32:27Z
|
2022-12-04T21:10:26Z
|
https://github.com/WebAssembly/wabt/issues/2097
| 1,475,113,515 | 2,097 |
[
"WebAssembly",
"wabt"
] |
'wasm2c' is not recognized as an internal or external command,
operable program or batch file.
There is no .exe file in the project :{
|
'wasm2c' is not recognized as an internal or external command, operable program or batch file.
|
https://api.github.com/repos/WebAssembly/wabt/issues/2076/comments
| 2 |
2022-11-27T09:47:27Z
|
2022-12-01T02:15:13Z
|
https://github.com/WebAssembly/wabt/issues/2076
| 1,465,386,231 | 2,076 |
[
"WebAssembly",
"wabt"
] |
see https://github.com/yamt/toywasm/blob/424755e4210568ed112b155000c05d772b02e989/test/run-ffmpeg.sh#L18-L22
the same wasm binary works fine on other engines listed in https://github.com/yamt/toywasm/blob/424755e4210568ed112b155000c05d772b02e989/test/run-ffmpeg.sh#L4-L8
|
wasm-interp: possible misexecution issue
|
https://api.github.com/repos/WebAssembly/wabt/issues/2074/comments
| 2 |
2022-11-19T05:58:05Z
|
2022-11-19T07:04:00Z
|
https://github.com/WebAssembly/wabt/issues/2074
| 1,456,245,537 | 2,074 |
[
"WebAssembly",
"wabt"
] |
I'm trying to release 1.0.30 packages for Fedora and I'm getting these new test failures on s390x:
```
- test/wasm2c/spec/bulk.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,29 @@
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 545, in <module>
+ sys.exit(main(sys.argv[1:]))
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 539, in main
+ utils.Executable(main_exe, forward_stdout=True).RunWithArgs()
+ File "/builddir/build/BUILD/wabt-1.0.30/test/utils.py", line 96, in RunWithArgs
+ raise error
+utils.Error: Error running "out/test/wasm2c/spec/bulk/bulk" (1):
+None
+out/test/wasm2c/spec/bulk/bulk-main.c:336: assertion failed: in Z_bulk_2_wasmZ_load8_u(&Z_bulk_2_wasm_instance, 1u): expected 255, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:339: assertion failed: in Z_bulk_2_wasmZ_load8_u(&Z_bulk_2_wasm_instance, 2u): expected 255, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:342: assertion failed: in Z_bulk_2_wasmZ_load8_u(&Z_bulk_2_wasm_instance, 3u): expected 255, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:351: assertion failed: in Z_bulk_2_wasmZ_load8_u(&Z_bulk_2_wasm_instance, 0u): expected 170, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:354: assertion failed: in Z_bulk_2_wasmZ_load8_u(&Z_bulk_2_wasm_instance, 1u): expected 170, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:386: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 10u): expected 170, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:389: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 11u): expected 187, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:392: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 12u): expected 204, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:395: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 13u): expected 221, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:404: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 8u): expected 170, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:407: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 9u): expected 187, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:410: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 10u): expected 204, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:413: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 11u): expected 221, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:416: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 12u): expected 204, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:419: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 13u): expected 221, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:428: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 11u): expected 170, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:431: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 12u): expected 187, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:434: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 13u): expected 204, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:437: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 14u): expected 221, got 0.
+out/test/wasm2c/spec/bulk/bulk-main.c:440: assertion failed: in Z_bulk_3_wasmZ_load8_u(&Z_bulk_3_wasm_instance, 15u): expected 204, got 0.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1 @@
-66/66 tests passed.
+46/66 tests passed.
...
- test/wasm2c/spec/memory_fill.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,15 @@
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 545, in <module>
+ sys.exit(main(sys.argv[1:]))
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 539, in main
+ utils.Executable(main_exe, forward_stdout=True).RunWithArgs()
+ File "/builddir/build/BUILD/wabt-1.0.30/test/utils.py", line 96, in RunWithArgs
+ raise error
+utils.Error: Error running "out/test/wasm2c/spec/memory_fill/memory_fill" (1):
+None
+out/test/wasm2c/spec/memory_fill/memory_fill-main.c:321: assertion failed: in Z_memory_fill_0_wasmZ_checkRange(&Z_memory_fill_0_wasm_instance, 0u, 65280u, 0u): expected 4294967295, got 0.
+out/test/wasm2c/spec/memory_fill/memory_fill-main.c:324: assertion failed: in Z_memory_fill_0_wasmZ_checkRange(&Z_memory_fill_0_wasm_instance, 65280u, 65536u, 85u): expected 4294967295, got 65280.
+out/test/wasm2c/spec/memory_fill/memory_fill-main.c:398: assertion failed: in Z_memory_fill_7_wasmZ_checkRange(&Z_memory_fill_7_wasm_instance, 18u, 21u, 85u): expected 4294967295, got 18.
+out/test/wasm2c/spec/memory_fill/memory_fill-main.c:401: assertion failed: in Z_memory_fill_7_wasmZ_checkRange(&Z_memory_fill_7_wasm_instance, 21u, 25u, 170u): expected 4294967295, got 21.
+out/test/wasm2c/spec/memory_fill/memory_fill-main.c:404: assertion failed: in Z_memory_fill_7_wasmZ_checkRange(&Z_memory_fill_7_wasm_instance, 25u, 28u, 85u): expected 4294967295, got 25.
+out/test/wasm2c/spec/memory_fill/memory_fill-main.c:407: assertion failed: in Z_memory_fill_7_wasmZ_checkRange(&Z_memory_fill_7_wasm_instance, 28u, 65536u, 0u): expected 4294967295, got 65508.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1 @@
-20/20 tests passed.
+14/20 tests passed.
...
- test/wasm2c/spec/memory_init.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,16 @@
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 545, in <module>
+ sys.exit(main(sys.argv[1:]))
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 539, in main
+ utils.Executable(main_exe, forward_stdout=True).RunWithArgs()
+ File "/builddir/build/BUILD/wabt-1.0.30/test/utils.py", line 96, in RunWithArgs
+ raise error
+utils.Error: Error running "out/test/wasm2c/spec/memory_init/memory_init" (1):
+None
+out/test/wasm2c/spec/memory_init/memory_init-main.c:667: assertion failed: in Z_memory_init_3_wasmZ_load8_u(&Z_memory_init_3_wasm_instance, 13u): expected 0, got 5.
+out/test/wasm2c/spec/memory_init/memory_init-main.c:670: assertion failed: in Z_memory_init_3_wasmZ_load8_u(&Z_memory_init_3_wasm_instance, 14u): expected 7, got 2.
+out/test/wasm2c/spec/memory_init/memory_init-main.c:673: assertion failed: in Z_memory_init_3_wasmZ_load8_u(&Z_memory_init_3_wasm_instance, 15u): expected 5, got 9.
+out/test/wasm2c/spec/memory_init/memory_init-main.c:685: assertion failed: in Z_memory_init_3_wasmZ_load8_u(&Z_memory_init_3_wasm_instance, 19u): expected 9, got 0.
+out/test/wasm2c/spec/memory_init/memory_init-main.c:691: assertion failed: in Z_memory_init_3_wasmZ_load8_u(&Z_memory_init_3_wasm_instance, 21u): expected 7, got 0.
+out/test/wasm2c/spec/memory_init/memory_init-main.c:697: assertion failed: in Z_memory_init_3_wasmZ_load8_u(&Z_memory_init_3_wasm_instance, 23u): expected 8, got 0.
+out/test/wasm2c/spec/memory_init/memory_init-main.c:700: assertion failed: in Z_memory_init_3_wasmZ_load8_u(&Z_memory_init_3_wasm_instance, 24u): expected 8, got 0.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1 @@
-140/140 tests passed.
+133/140 tests passed.
...
- test/wasm2c/spec/memory_copy.txt
expected error code 0, got 1.
STDERR MISMATCH:
--- expected
+++ actual
@@ -0,0 +1,264 @@
+Traceback (most recent call last):
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 545, in <module>
+ sys.exit(main(sys.argv[1:]))
+ File "/builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py", line 539, in main
+ utils.Executable(main_exe, forward_stdout=True).RunWithArgs()
+ File "/builddir/build/BUILD/wabt-1.0.30/test/utils.py", line 96, in RunWithArgs
+ raise error
+utils.Error: Error running "out/test/wasm2c/spec/memory_copy/memory_copy" (1):
+None
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:480: assertion failed: in Z_memory_copy_1_wasmZ_load8_u(&Z_memory_copy_1_wasm_instance, 13u): expected 3, got 5.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:483: assertion failed: in Z_memory_copy_1_wasmZ_load8_u(&Z_memory_copy_1_wasm_instance, 14u): expected 1, got 2.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:486: assertion failed: in Z_memory_copy_1_wasmZ_load8_u(&Z_memory_copy_1_wasm_instance, 15u): expected 4, got 3.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:614: assertion failed: in Z_memory_copy_2_wasmZ_load8_u(&Z_memory_copy_2_wasm_instance, 25u): expected 3, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:617: assertion failed: in Z_memory_copy_2_wasmZ_load8_u(&Z_memory_copy_2_wasm_instance, 26u): expected 6, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:676: assertion failed: in Z_memory_copy_3_wasmZ_load8_u(&Z_memory_copy_3_wasm_instance, 13u): expected 0, got 5.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:679: assertion failed: in Z_memory_copy_3_wasmZ_load8_u(&Z_memory_copy_3_wasm_instance, 14u): expected 0, got 2.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:682: assertion failed: in Z_memory_copy_3_wasmZ_load8_u(&Z_memory_copy_3_wasm_instance, 15u): expected 0, got 3.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:911: assertion failed: in Z_memory_copy_5_wasmZ_load8_u(&Z_memory_copy_5_wasm_instance, 26u): expected 3, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:914: assertion failed: in Z_memory_copy_5_wasmZ_load8_u(&Z_memory_copy_5_wasm_instance, 27u): expected 1, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:961: assertion failed: in Z_memory_copy_6_wasmZ_load8_u(&Z_memory_copy_6_wasm_instance, 10u): expected 7, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:964: assertion failed: in Z_memory_copy_6_wasmZ_load8_u(&Z_memory_copy_6_wasm_instance, 11u): expected 5, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:967: assertion failed: in Z_memory_copy_6_wasmZ_load8_u(&Z_memory_copy_6_wasm_instance, 12u): expected 2, got 7.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:970: assertion failed: in Z_memory_copy_6_wasmZ_load8_u(&Z_memory_copy_6_wasm_instance, 13u): expected 3, got 5.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:973: assertion failed: in Z_memory_copy_6_wasmZ_load8_u(&Z_memory_copy_6_wasm_instance, 14u): expected 6, got 2.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:976: assertion failed: in Z_memory_copy_6_wasmZ_load8_u(&Z_memory_copy_6_wasm_instance, 15u): expected 0, got 3.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:979: assertion failed: in Z_memory_copy_6_wasmZ_load8_u(&Z_memory_copy_6_wasm_instance, 16u): expected 0, got 6.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:1065: assertion failed: in Z_memory_copy_7_wasmZ_load8_u(&Z_memory_copy_7_wasm_instance, 12u): expected 0, got 7.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:1068: assertion failed: in Z_memory_copy_7_wasmZ_load8_u(&Z_memory_copy_7_wasm_instance, 13u): expected 0, got 5.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:1071: assertion failed: in Z_memory_copy_7_wasmZ_load8_u(&Z_memory_copy_7_wasm_instance, 14u): expected 7, got 2.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:1074: assertion failed: in Z_memory_copy_7_wasmZ_load8_u(&Z_memory_copy_7_wasm_instance, 15u): expected 5, got 3.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:1077: assertion failed: in Z_memory_copy_7_wasmZ_load8_u(&Z_memory_copy_7_wasm_instance, 16u): expected 2, got 6.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:1080: assertion failed: in Z_memory_copy_7_wasmZ_load8_u(&Z_memory_copy_7_wasm_instance, 17u): expected 3, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:1083: assertion failed: in Z_memory_copy_7_wasmZ_load8_u(&Z_memory_copy_7_wasm_instance, 18u): expected 6, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12741: assertion failed: in Z_memory_copy_83_wasmZ_checkRange(&Z_memory_copy_83_wasm_instance, 9u, 20u, 85u): expected 4294967295, got 9.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12744: assertion failed: in Z_memory_copy_83_wasmZ_checkRange(&Z_memory_copy_83_wasm_instance, 20u, 65536u, 0u): expected 4294967295, got 65516.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12758: assertion failed: in Z_memory_copy_84_wasmZ_checkRange(&Z_memory_copy_84_wasm_instance, 10u, 21u, 85u): expected 4294967295, got 10.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12761: assertion failed: in Z_memory_copy_84_wasmZ_checkRange(&Z_memory_copy_84_wasm_instance, 21u, 65536u, 0u): expected 4294967295, got 65515.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12804: assertion failed: in Z_memory_copy_89_wasmZ_checkRange(&Z_memory_copy_89_wasm_instance, 0u, 32768u, 85u): expected 4294967295, got 0.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12807: assertion failed: in Z_memory_copy_89_wasmZ_checkRange(&Z_memory_copy_89_wasm_instance, 32768u, 65536u, 170u): expected 4294967295, got 32768.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12869: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 124u, 1517u, 9u): expected 4294967295, got 124.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12872: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 1517u, 2132u, 0u): expected 4294967295, got 1517.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12875: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 2132u, 2827u, 10u): expected 4294967295, got 2132.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12878: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 2827u, 2921u, 92u): expected 4294967295, got 2827.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12881: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 2921u, 3538u, 83u): expected 4294967295, got 2921.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12884: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 3538u, 3786u, 77u): expected 4294967295, got 3538.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12887: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 3786u, 4042u, 97u): expected 4294967295, got 3786.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12890: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 4042u, 4651u, 99u): expected 4294967295, got 4042.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12893: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 4651u, 5057u, 0u): expected 4294967295, got 4651.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12896: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 5057u, 5109u, 99u): expected 4294967295, got 5057.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12899: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 5109u, 5291u, 0u): expected 4294967295, got 5109.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12902: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 5291u, 5524u, 72u): expected 4294967295, got 5291.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12905: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 5524u, 5691u, 92u): expected 4294967295, got 5524.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12908: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 5691u, 6552u, 83u): expected 4294967295, got 5691.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12911: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 6552u, 7133u, 77u): expected 4294967295, got 6552.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12914: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 7133u, 7665u, 99u): expected 4294967295, got 7133.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12917: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 7665u, 8314u, 0u): expected 4294967295, got 7665.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12920: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 8314u, 8360u, 62u): expected 4294967295, got 8314.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12923: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 8360u, 8793u, 86u): expected 4294967295, got 8360.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12926: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 8793u, 8979u, 83u): expected 4294967295, got 8793.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12929: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 8979u, 9373u, 79u): expected 4294967295, got 8979.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12932: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 9373u, 9518u, 95u): expected 4294967295, got 9373.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12935: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 9518u, 9934u, 59u): expected 4294967295, got 9518.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12938: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 9934u, 10087u, 77u): expected 4294967295, got 9934.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12941: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 10087u, 10206u, 5u): expected 4294967295, got 10087.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12944: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 10206u, 10230u, 77u): expected 4294967295, got 10206.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12947: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 10230u, 10249u, 41u): expected 4294967295, got 10230.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12950: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 10249u, 11148u, 83u): expected 4294967295, got 10249.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12953: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 11148u, 11356u, 74u): expected 4294967295, got 11148.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12956: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 11356u, 11380u, 93u): expected 4294967295, got 11356.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12959: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 11380u, 11939u, 74u): expected 4294967295, got 11380.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12962: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 11939u, 12159u, 68u): expected 4294967295, got 11939.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12965: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 12159u, 12575u, 83u): expected 4294967295, got 12159.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12968: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 12575u, 12969u, 79u): expected 4294967295, got 12575.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12971: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 12969u, 13114u, 95u): expected 4294967295, got 12969.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12974: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 13114u, 14133u, 59u): expected 4294967295, got 13114.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12977: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 14133u, 14404u, 76u): expected 4294967295, got 14133.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12980: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 14404u, 14428u, 57u): expected 4294967295, got 14404.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12983: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 14428u, 14458u, 59u): expected 4294967295, got 14428.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12986: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 14458u, 14580u, 32u): expected 4294967295, got 14458.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12989: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 14580u, 14777u, 89u): expected 4294967295, got 14580.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12992: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 14777u, 15124u, 59u): expected 4294967295, got 14777.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12995: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 15124u, 15126u, 36u): expected 4294967295, got 15124.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:12998: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 15126u, 15192u, 100u): expected 4294967295, got 15126.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13001: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 15192u, 15871u, 96u): expected 4294967295, got 15192.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13004: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 15871u, 15998u, 95u): expected 4294967295, got 15871.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13007: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 15998u, 17017u, 59u): expected 4294967295, got 15998.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13010: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17017u, 17288u, 76u): expected 4294967295, got 17017.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13013: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17288u, 17312u, 57u): expected 4294967295, got 17288.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13016: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17312u, 17342u, 59u): expected 4294967295, got 17312.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13019: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17342u, 17464u, 32u): expected 4294967295, got 17342.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13022: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17464u, 17661u, 89u): expected 4294967295, got 17464.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13025: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17661u, 17727u, 59u): expected 4294967295, got 17661.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13028: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17727u, 17733u, 5u): expected 4294967295, got 17727.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13031: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17733u, 17893u, 96u): expected 4294967295, got 17733.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13034: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 17893u, 18553u, 77u): expected 4294967295, got 17893.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13037: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 18553u, 18744u, 42u): expected 4294967295, got 18553.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13040: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 18744u, 18801u, 76u): expected 4294967295, got 18744.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13043: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 18801u, 18825u, 57u): expected 4294967295, got 18801.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13046: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 18825u, 18876u, 59u): expected 4294967295, got 18825.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13049: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 18876u, 18885u, 77u): expected 4294967295, got 18876.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13052: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 18885u, 18904u, 41u): expected 4294967295, got 18885.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13055: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 18904u, 19567u, 83u): expected 4294967295, got 18904.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13058: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 19567u, 20403u, 96u): expected 4294967295, got 19567.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13061: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 20403u, 21274u, 77u): expected 4294967295, got 20578.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13064: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 21274u, 21364u, 100u): expected 4294967295, got 21274.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13067: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 21364u, 21468u, 74u): expected 4294967295, got 21364.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13070: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 21468u, 21492u, 93u): expected 4294967295, got 21468.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13073: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 21492u, 22051u, 74u): expected 4294967295, got 21492.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13076: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 22051u, 22480u, 68u): expected 4294967295, got 22051.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13079: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 22480u, 22685u, 100u): expected 4294967295, got 22480.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13082: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 22685u, 22694u, 68u): expected 4294967295, got 22685.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13085: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 22694u, 22821u, 10u): expected 4294967295, got 22694.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13088: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 22821u, 22869u, 100u): expected 4294967295, got 22821.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13091: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 22869u, 24107u, 97u): expected 4294967295, got 22869.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13094: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 24107u, 24111u, 37u): expected 4294967295, got 24107.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13097: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 24111u, 24236u, 77u): expected 4294967295, got 24111.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13100: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 24236u, 24348u, 72u): expected 4294967295, got 24236.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13106: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 24515u, 24900u, 83u): expected 4294967295, got 24515.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13109: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 24900u, 25136u, 95u): expected 4294967295, got 24900.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13112: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 25136u, 25182u, 85u): expected 4294967295, got 25136.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13115: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 25182u, 25426u, 68u): expected 4294967295, got 25182.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13118: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 25426u, 25613u, 89u): expected 4294967295, got 25426.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13121: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 25613u, 25830u, 96u): expected 4294967295, got 25613.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13124: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 25830u, 26446u, 100u): expected 4294967295, got 25830.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13127: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 26446u, 26517u, 10u): expected 4294967295, got 26446.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13130: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 26517u, 27468u, 92u): expected 4294967295, got 27405.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13133: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 27468u, 27503u, 95u): expected 4294967295, got 27468.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13136: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 27503u, 27573u, 77u): expected 4294967295, got 27503.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13139: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 27573u, 28245u, 92u): expected 4294967295, got 27573.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13142: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 28245u, 28280u, 95u): expected 4294967295, got 28245.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13145: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 28280u, 29502u, 77u): expected 4294967295, got 28280.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13148: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 29502u, 29629u, 42u): expected 4294967295, got 29502.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13151: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 29629u, 30387u, 83u): expected 4294967295, got 29888.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13154: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 30387u, 30646u, 77u): expected 4294967295, got 30387.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13157: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 30646u, 31066u, 92u): expected 4294967295, got 30646.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13160: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31066u, 31131u, 77u): expected 4294967295, got 31066.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13163: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31131u, 31322u, 42u): expected 4294967295, got 31131.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13166: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31322u, 31379u, 76u): expected 4294967295, got 31322.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13169: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31379u, 31403u, 57u): expected 4294967295, got 31379.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13172: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31403u, 31454u, 59u): expected 4294967295, got 31403.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13175: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31454u, 31463u, 77u): expected 4294967295, got 31454.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13178: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31463u, 31482u, 41u): expected 4294967295, got 31463.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13181: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31482u, 31649u, 83u): expected 4294967295, got 31482.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13184: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31649u, 31978u, 72u): expected 4294967295, got 31649.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13187: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 31978u, 32145u, 92u): expected 4294967295, got 31978.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13190: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 32145u, 32530u, 83u): expected 4294967295, got 32145.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13193: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 32530u, 32766u, 95u): expected 4294967295, got 32530.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13196: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 32766u, 32812u, 85u): expected 4294967295, got 32770.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13199: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 32812u, 33056u, 68u): expected 4294967295, got 32812.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13202: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 33056u, 33660u, 89u): expected 4294967295, got 33056.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13205: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 33660u, 33752u, 59u): expected 4294967295, got 33660.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13208: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 33752u, 33775u, 36u): expected 4294967295, got 33752.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13211: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 33775u, 33778u, 32u): expected 4294967295, got 33775.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13214: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 33778u, 34603u, 9u): expected 4294967295, got 33778.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13217: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 34603u, 35218u, 0u): expected 4294967295, got 34603.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13220: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 35218u, 35372u, 10u): expected 4294967295, got 35218.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13223: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 35372u, 35486u, 77u): expected 4294967295, got 35372.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13226: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 35486u, 35605u, 5u): expected 4294967295, got 35486.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13229: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 35605u, 35629u, 77u): expected 4294967295, got 35605.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13232: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 35629u, 35648u, 41u): expected 4294967295, got 35629.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13235: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 35648u, 36547u, 83u): expected 4294967295, got 35907.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13238: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 36547u, 36755u, 74u): expected 4294967295, got 36547.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13241: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 36755u, 36767u, 93u): expected 4294967295, got 36755.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13244: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 36767u, 36810u, 83u): expected 4294967295, got 36767.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13247: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 36810u, 36839u, 100u): expected 4294967295, got 36810.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13250: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 36839u, 37444u, 96u): expected 4294967295, got 36839.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13253: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 37444u, 38060u, 100u): expected 4294967295, got 37444.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13256: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 38060u, 38131u, 10u): expected 4294967295, got 38060.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13259: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 38131u, 39082u, 92u): expected 4294967295, got 39019.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13262: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 39082u, 39117u, 95u): expected 4294967295, got 39082.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13265: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 39117u, 39187u, 77u): expected 4294967295, got 39117.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13268: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 39187u, 39859u, 92u): expected 4294967295, got 39187.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13271: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 39859u, 39894u, 95u): expected 4294967295, got 39859.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13274: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 39894u, 40257u, 77u): expected 4294967295, got 39894.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13277: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 40257u, 40344u, 89u): expected 4294967295, got 40257.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13280: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 40344u, 40371u, 59u): expected 4294967295, got 40344.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13283: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 40371u, 40804u, 77u): expected 4294967295, got 40371.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13286: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 40804u, 40909u, 5u): expected 4294967295, got 40804.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13289: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 40909u, 42259u, 92u): expected 4294967295, got 40909.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13292: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 42259u, 42511u, 77u): expected 4294967295, got 42259.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13295: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 42511u, 42945u, 83u): expected 4294967295, got 42511.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13298: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 42945u, 43115u, 77u): expected 4294967295, got 42945.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13301: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 43115u, 43306u, 42u): expected 4294967295, got 43115.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13304: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 43306u, 43363u, 76u): expected 4294967295, got 43306.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13307: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 43363u, 43387u, 57u): expected 4294967295, got 43363.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13310: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 43387u, 43438u, 59u): expected 4294967295, got 43387.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13313: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 43438u, 43447u, 77u): expected 4294967295, got 43438.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13316: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 43447u, 43466u, 41u): expected 4294967295, got 43447.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13319: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 43466u, 44129u, 83u): expected 4294967295, got 43466.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13322: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 44129u, 44958u, 96u): expected 4294967295, got 44129.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13325: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 44958u, 45570u, 77u): expected 4294967295, got 45133.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13328: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 45570u, 45575u, 92u): expected 4294967295, got 45570.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13331: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 45575u, 45640u, 77u): expected 4294967295, got 45575.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13334: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 45640u, 45742u, 42u): expected 4294967295, got 45640.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13337: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 45742u, 45832u, 72u): expected 4294967295, got 45742.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13340: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 45832u, 45999u, 92u): expected 4294967295, got 45832.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13346: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 46384u, 46596u, 95u): expected 4294967295, got 46384.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13349: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 46596u, 46654u, 92u): expected 4294967295, got 46596.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13352: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 46654u, 47515u, 83u): expected 4294967295, got 46654.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13358: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 47620u, 47817u, 79u): expected 4294967295, got 47620.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13361: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 47817u, 47951u, 95u): expected 4294967295, got 47817.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13364: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 47951u, 48632u, 100u): expected 4294967295, got 47951.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13367: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 48632u, 48699u, 97u): expected 4294967295, got 48632.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13370: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 48699u, 48703u, 37u): expected 4294967295, got 48699.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13373: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 48703u, 49764u, 77u): expected 4294967295, got 48703.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13376: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 49764u, 49955u, 42u): expected 4294967295, got 49764.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13379: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 49955u, 50012u, 76u): expected 4294967295, got 49955.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13382: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 50012u, 50036u, 57u): expected 4294967295, got 50012.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13385: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 50036u, 50087u, 59u): expected 4294967295, got 50036.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13388: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 50087u, 50096u, 77u): expected 4294967295, got 50087.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13391: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 50096u, 50115u, 41u): expected 4294967295, got 50096.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13394: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 50115u, 50370u, 83u): expected 4294967295, got 50115.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13397: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 50370u, 51358u, 92u): expected 4294967295, got 50370.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13400: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 51358u, 51610u, 77u): expected 4294967295, got 51358.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13403: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 51610u, 51776u, 83u): expected 4294967295, got 51610.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13406: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 51776u, 51833u, 89u): expected 4294967295, got 51776.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13409: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 51833u, 52895u, 100u): expected 4294967295, got 51833.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13412: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 52895u, 53029u, 97u): expected 4294967295, got 52895.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13415: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 53029u, 53244u, 68u): expected 4294967295, got 53029.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13418: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 53244u, 54066u, 100u): expected 4294967295, got 53244.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13421: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 54066u, 54133u, 97u): expected 4294967295, got 54066.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13424: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 54133u, 54137u, 37u): expected 4294967295, got 54133.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13427: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 54137u, 55198u, 77u): expected 4294967295, got 54137.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13430: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 55198u, 55389u, 42u): expected 4294967295, got 55198.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13433: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 55389u, 55446u, 76u): expected 4294967295, got 55389.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13436: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 55446u, 55470u, 57u): expected 4294967295, got 55446.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13439: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 55470u, 55521u, 59u): expected 4294967295, got 55470.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13445: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 55530u, 55549u, 41u): expected 4294967295, got 55530.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13448: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 55549u, 56212u, 83u): expected 4294967295, got 55549.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13451: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 56212u, 57048u, 96u): expected 4294967295, got 56212.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13454: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 57048u, 58183u, 77u): expected 4294967295, got 57048.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13457: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 58183u, 58202u, 41u): expected 4294967295, got 58183.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13460: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 58202u, 58516u, 83u): expected 4294967295, got 58202.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13463: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 58516u, 58835u, 95u): expected 4294967295, got 58516.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13469: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 58855u, 59089u, 95u): expected 4294967295, got 58855.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13472: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 59089u, 59145u, 77u): expected 4294967295, got 59089.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13475: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 59145u, 59677u, 99u): expected 4294967295, got 59145.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13478: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 59677u, 60134u, 0u): expected 4294967295, got 59677.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13481: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60134u, 60502u, 89u): expected 4294967295, got 60134.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13484: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60502u, 60594u, 59u): expected 4294967295, got 60502.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13487: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60594u, 60617u, 36u): expected 4294967295, got 60594.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13490: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60617u, 60618u, 32u): expected 4294967295, got 60617.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13493: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60618u, 60777u, 42u): expected 4294967295, got 60618.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13496: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60777u, 60834u, 76u): expected 4294967295, got 60777.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13499: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60834u, 60858u, 57u): expected 4294967295, got 60834.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13502: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60858u, 60909u, 59u): expected 4294967295, got 60858.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13505: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60909u, 60918u, 77u): expected 4294967295, got 60909.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13508: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60918u, 60937u, 41u): expected 4294967295, got 60918.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13511: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 60937u, 61600u, 83u): expected 4294967295, got 60937.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13514: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 61600u, 62436u, 96u): expected 4294967295, got 61600.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13517: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 62436u, 63307u, 77u): expected 4294967295, got 62436.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13520: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63307u, 63397u, 100u): expected 4294967295, got 63307.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13523: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63397u, 63501u, 74u): expected 4294967295, got 63397.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13526: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63501u, 63525u, 93u): expected 4294967295, got 63501.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13529: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63525u, 63605u, 74u): expected 4294967295, got 63525.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13532: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63605u, 63704u, 100u): expected 4294967295, got 63605.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13535: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63704u, 63771u, 97u): expected 4294967295, got 63704.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13538: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63771u, 63775u, 37u): expected 4294967295, got 63771.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13541: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 63775u, 64311u, 77u): expected 4294967295, got 63775.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13544: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 64311u, 64331u, 26u): expected 4294967295, got 64311.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13547: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 64331u, 64518u, 92u): expected 4294967295, got 64331.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13550: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 64518u, 64827u, 11u): expected 4294967295, got 64518.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13553: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 64827u, 64834u, 26u): expected 4294967295, got 64827.
+out/test/wasm2c/spec/memory_copy/memory_copy-main.c:13556: assertion failed: in Z_memory_copy_96_wasmZ_checkRange(&Z_memory_copy_96_wasm_instance, 64834u, 65536u, 0u): expected 4294967295, got 64834.
STDOUT MISMATCH:
--- expected
+++ actual
@@ -1 +1 @@
-4338/4338 tests passed.
+4083/4338 tests passed.
**** FAILED ******************************************************************
- test/wasm2c/spec/bulk.txt
/usr/bin/python3 /builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py out/test/wasm2c/spec/bulk.wast --bindir=redhat-linux-build --no-error-cmdline -o out/test/wasm2c/spec/bulk --cflags=-DWABT_BIG_ENDIAN=1
- test/wasm2c/spec/memory_fill.txt
/usr/bin/python3 /builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py out/test/wasm2c/spec/memory_fill.wast --bindir=redhat-linux-build --no-error-cmdline -o out/test/wasm2c/spec/memory_fill --cflags=-DWABT_BIG_ENDIAN=1
- test/wasm2c/spec/memory_init.txt
/usr/bin/python3 /builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py out/test/wasm2c/spec/memory_init.wast --bindir=redhat-linux-build --no-error-cmdline -o out/test/wasm2c/spec/memory_init --cflags=-DWABT_BIG_ENDIAN=1
- test/wasm2c/spec/memory_copy.txt
/usr/bin/python3 /builddir/build/BUILD/wabt-1.0.30/test/run-spec-wasm2c.py out/test/wasm2c/spec/memory_copy.wast --bindir=redhat-linux-build --no-error-cmdline -o out/test/wasm2c/spec/memory_copy --cflags=-DWABT_BIG_ENDIAN=1
```
|
test failures in 1.0.30 on s390x running Fedora (36)
|
https://api.github.com/repos/WebAssembly/wabt/issues/2070/comments
| 7 |
2022-11-16T11:05:00Z
|
2022-11-22T22:13:43Z
|
https://github.com/WebAssembly/wabt/issues/2070
| 1,451,379,752 | 2,070 |
[
"WebAssembly",
"wabt"
] |
I'm trying to track down an issue with a modified version of `wasm-interp.cc` I'm using. It's not clear whether it's a bug on my end, or a bug in interp, so I hope someone can point me to what's going wrong. I tried to strip down the interpreter to the minimal reproducing program.
I have the following WebAssembly program:
```wasm
(import "shell" "read" (func $shell_read (param i32 i32)))
(func $run (export "run")
(call $shell_read (i32.const 0x8) (i32.const 0x9)))
```
I try to run this using the following interpreter:
```c++
namespace wabti = wabt::interp;
wabt::Result run() {
static wabti::Store store;
static wabt::Features features;
static wabt::Errors errors;
wabti::ModuleDesc desc;
CHECK_RESULT(wabti::ReadBinaryInterp("input.wasm", input, sizeof(input),
wabt::ReadBinaryOptions(features, nullptr, true, true, true), &errors, &desc));
auto core = wabti::Module::New(store, desc);
// Bind import
wabti::RefVec imports;
auto import = core->desc().imports[0];
auto ft = *wabt::cast<wabti::FuncType>(import.type.type.get());
auto func = wabti::HostFunc::New(store, ft,
[](wabti::Thread &, const wabti::Values ¶ms, wabti::Values &, wabti::Trap::Ptr*) -> wabt::Result {
std::cout << "cb " << params.size() << " " << params[0].type << std::endl;
return wabt::Result::Ok;
});
imports.push_back(func.ref());
// Instantiate module
wabti::Trap::Ptr trap;
auto corei = wabti::Instance::Instantiate(store, core.ref(), imports, &trap);
assert(corei);
// Run
wabti::Values runParams;
wabti::Values runResults;
return store.UnsafeGet<wabti::Func>(corei->funcs()[1])->Call(store, runParams, runResults, &trap, nullptr);
}
int main(int argc, char *argv[]) {
run();
}
```
When I run this against a Debug build of libwabt, the program works fine, and this is the output:
cb 2 -1
However, when I run this against a Release build of libwabt, this is what I get:
cb 1 9
It seems that at least the params parameter is wrong (wrong length, and wrong contents).
I tried running an asan build. In my real program, I get asan errors during module instantiation, but in the minimal program above, I don't get anything.
|
interp: Value conditional struct field not present in release build
|
https://api.github.com/repos/WebAssembly/wabt/issues/2069/comments
| 3 |
2022-11-16T07:56:55Z
|
2022-11-16T18:47:59Z
|
https://github.com/WebAssembly/wabt/issues/2069
| 1,451,074,783 | 2,069 |
[
"WebAssembly",
"wabt"
] |
I have a small application that uses wabt::interp. It used to run fine against the binary release of 1.0.30, but no longer does against 1.0.31 (see below). I have the same problem with the macOS binary release and the linux binary release, so it doesn't seem to be platform-specific. When I build the 1.0.31 tag myself, it does work fine.
The problem happens when I call `Value.Get` on one of the parameters from within a callback. It asserts on the type.
However, it seems the `params` parameter of the callback is corrupt. The size of the vector does not correspond to the expected size, and the type of the first parameter is also strange (4096, but I've seen other strange values).
```
586 void CheckType(ValueType t) const {
587 // Sadly we must allow Any here, since locals may be uninitialized.
588 // Alternatively we could modify InterpAlloca to set the type.
-> 589 assert(t == type || type == ValueType::Any);
590 }
591 ValueType type;
592 #else
Target 0: (waforth) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
frame #0: 0x000000018720f224 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x0000000187245cec libsystem_pthread.dylib`pthread_kill + 288
frame #2: 0x000000018717f2c8 libsystem_c.dylib`abort + 180
frame #3: 0x000000018717e620 libsystem_c.dylib`__assert_rtn + 272
* frame #4: 0x000000010000793c waforth`wabt::interp::Value::CheckType(this=0x0000000100337050, t=(enum_ = I32, type_index_ = 4294967295)) const at interp.h:589:5
frame #5: 0x0000000100004038 waforth`int wabt::interp::Value::Get<int>(this=0x0000000100337050) const at interp-inl.h:451:66
frame #6: 0x0000000100004224 waforth`read_cb(thread=0x000000016fdfe668, params=size=0, results=size=0, trap=0x000000016fdfe960) at main.cpp:76:56
```
|
interp issues with 1.0.31 binary release
|
https://api.github.com/repos/WebAssembly/wabt/issues/2068/comments
| 1 |
2022-11-15T20:11:29Z
|
2022-11-15T20:17:20Z
|
https://github.com/WebAssembly/wabt/issues/2068
| 1,450,320,964 | 2,068 |
[
"WebAssembly",
"wabt"
] |
I'm interested in a new WABT build that includes the wasm2c reftypes and the CWriter in libwabt.
It's not super-urgent, but just so you know at least 1 person is waiting for a new tag ;)
|
Tag 1.0.31?
|
https://api.github.com/repos/WebAssembly/wabt/issues/2059/comments
| 3 |
2022-11-13T19:38:18Z
|
2022-11-15T21:58:30Z
|
https://github.com/WebAssembly/wabt/issues/2059
| 1,447,054,552 | 2,059 |
[
"WebAssembly",
"wabt"
] |
When using `wasm2c`, the `wasm-rt-*` files are necessary to compile/link the resulting program. The WABT binary release packages come with a compiled version of wasm-rt as a static library, but this may not match the target platform for which the `wasm2c` result is used.
I therefore propose to include the necessary wasm2c runtime files (`wasm-rt-impl.c`, `wasm-rt-impl.h`, and `wasm-rt.h`) in the binary package as source under a `src/wasm2c` subdir. This gives toolchains that use wasm2c the flexibility to compile the wasm2c output for any platform.
Note that the Debian binary package of `wabt` already packages the wasm-rt source files in the WABT package under `/usr/src/wasm2c` (see [the filelist](https://packages.debian.org/sid/amd64/wabt/filelist)).
|
Include wasm-rt* source files in binary release packages
|
https://api.github.com/repos/WebAssembly/wabt/issues/2057/comments
| 1 |
2022-11-12T16:43:03Z
|
2022-11-13T17:19:28Z
|
https://github.com/WebAssembly/wabt/issues/2057
| 1,446,519,774 | 2,057 |
[
"WebAssembly",
"wabt"
] |
wat2wasm: the description of this should name and call this "[web]assembler"
wasm2wat: and this as "[web]disassembler"
|
Naming
|
https://api.github.com/repos/WebAssembly/wabt/issues/2056/comments
| 2 |
2022-11-12T15:32:24Z
|
2022-11-15T21:59:04Z
|
https://github.com/WebAssembly/wabt/issues/2056
| 1,446,495,474 | 2,056 |
[
"WebAssembly",
"wabt"
] |
I have the following program that reads a WASM module and immediately tries to write it again:
wabt::Errors errors;
wabt::Features features;
wabt::Module mod;
auto result = ReadBinaryIr("in.wasm", in_data, sizeof(in_data), wabt::ReadBinaryOptions(features, NULL, true, true, true), &errors, &mod);
assert(Succeeded(result));
result = ValidateModule(&mod, &errors, wabt::ValidateOptions(features));
result |= GenerateNames(&mod);
assert(Succeeded(result));
result = ApplyNames(&mod);
assert(Succeeded(result));
wabt::FileStream out("out.wasm");
result = wabt::WriteBinaryModule(&out, &mod, wabt::WriteBinaryOptions(features, false, false, true));
assert(Succeeded(result));
`in_data` is a byte array with a WebAssembly module generated using `wat2wasm`.
When I compile this program against the Git version of WABT, and I run this program, I get the following output:
Assertion failed: (is_index()), function index, file ir.h, line 58.
Here is the backtrace
* frame #4: 0x000000010000ccbc reproducer`wabt::Var::index() const + 68
frame #5: 0x00000001000962a0 reproducer`wabt::(anonymous namespace)::BinaryWriter::GetLabelVarDepth(wabt::Var const*) + 28
frame #6: 0x0000000100093dc8 reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteExpr(wabt::Func const*, wabt::Expr const*) + 728
frame #7: 0x0000000100093994 reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteExprList(wabt::Func const*, wabt::intrusive_list<wabt::Expr> const&) + 140
frame #8: 0x0000000100094788 reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteExpr(wabt::Func const*, wabt::Expr const*) + 3224
frame #9: 0x0000000100093994 reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteExprList(wabt::Func const*, wabt::intrusive_list<wabt::Expr> const&) + 140
frame #10: 0x0000000100093cec reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteExpr(wabt::Func const*, wabt::Expr const*) + 508
frame #11: 0x0000000100093994 reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteExprList(wabt::Func const*, wabt::intrusive_list<wabt::Expr> const&) + 140
frame #12: 0x000000010008b47c reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteFunc(wabt::Func const*) + 64
frame #13: 0x000000010008780c reproducer`wabt::(anonymous namespace)::BinaryWriter::WriteModule() + 5444
frame #14: 0x0000000100086260 reproducer`wabt::WriteBinaryModule(wabt::Stream*, wabt::Module const*, wabt::WriteBinaryOptions const&) + 60
frame #15: 0x0000000100002738 reproducer`main(argc=1, argv=0x000000016fdff118) at reproducer.cpp:29:12
Do you have any clue what could be going wrong? Is there anything I can do to get to the bottom of what's going on?
Note that I also run the same module through `WriteC`, and this seems to work fine.
|
Assertion fails roundtripping reading/writing file
|
https://api.github.com/repos/WebAssembly/wabt/issues/2050/comments
| 1 |
2022-11-09T18:18:58Z
|
2022-11-09T19:36:19Z
|
https://github.com/WebAssembly/wabt/issues/2050
| 1,442,547,200 | 2,050 |
[
"WebAssembly",
"wabt"
] |
wasm2c has a number of globals and statics that assume that wasm instances are only embedded in a single threaded host.
However, when using wasm2c in complex hosts like Firefox, different host threads can spin up multiple sandbox instances concurrently, invoke function in their respective sandboxes and destroy sandboxes. In this use case, a number of these globals and statics can lead to exploitable race conditions --- hence in the fork of wasm2c used in Firefox, we have completely eliminated the use of such global state.
Some of the current uses of global state in order of potential security concern are
- [wasm_rt_jmp_buf](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L67) which is used in recovering from traps and if exceptions are enabled
- [wasm exception related state](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L69-L73) which is used if exceptions are enabled
- [wasm_rt_call_stack_depth/wasm_rt_saved_call_stack_depth](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L60-L61) which is used if stack depth counting is employed on the target platform
- [g_func_types/g_func_type_count](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L64-L65) which is used to give unique type indexes to Wasm indirection function types
- [s_tag_count](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L136) which is used to allocate tag numbers for exceptions
For the use in Firefox we plan to use wasm2c with macro flags such that none of this state is used, but I wanted to capture the information i had on this as I got part way into solving this (and am unlikely to come back to this for the moment)
**Possible solution**
From what I can tell, the above list contains two different types of state
- Module specific state
- Thread specific state
**Module specific state**
Module specific state from the above would be the [g_func_types/g_func_type_count](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L64-L65)
My attempt at solving this --- [See here](https://github.com/WebAssembly/wabt/compare/main...PLSysSec:wabt:remove-race-conditions-module)
The approach here is to create a new structure `struct wasm_rt_module_state` that is associated with the every wasm instance struct. This struct holds the func_types and is passed into [wasm_rt_register_func_type](https://github.com/WebAssembly/wabt/compare/main...PLSysSec:wabt:remove-race-conditions-module#diff-4f128b661d343d97ee188574413f9fefe659d761a04752fd2970eb9c437618a8R258) so that func_types of each module are isolated. This means each module can be initialized in parallel without any issues to this data
This solution assumes that different modules do not need the same type for indirect function calls
**Thread specific state**
Other variables like
[wasm_rt_jmp_buf](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L67) [wasm_rt_call_stack_depth/wasm_rt_saved_call_stack_depth](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L60-L61) [wasm exception related state](https://github.com/WebAssembly/wabt/blob/main/wasm2c/wasm-rt-impl.c#L69-L73) can be thought of as thread specific state that is part of the currently executing Wasm thread. We can thus create a new `struct wasm_rt_thread_state` for this data.
This struct is then passed in either
1. as an extra function parameter to wasm2c functions (similar to the instance struct as of today) [See here](https://github.com/WebAssembly/wabt/compare/main...PLSysSec:wabt:remove-race-conditions-threadparam). This approach is clean but likely has some performance hit due to passing around extra parameters in every function
2. stored in a thread local variable prior to execution [See here](https://github.com/WebAssembly/wabt/compare/main...PLSysSec:wabt:remove-race-conditions-tlsvar). This is probably more efficient, but the implementation must make sure to correctly set up the thread local variable prior to executing wasm2c functions, so it is more prone to error
|
wasm2c use of globals and statics introduce race conditions in concurrent environments
|
https://api.github.com/repos/WebAssembly/wabt/issues/2046/comments
| 9 |
2022-11-08T02:40:48Z
|
2023-12-04T02:23:05Z
|
https://github.com/WebAssembly/wabt/issues/2046
| 1,439,361,907 | 2,046 |
[
"WebAssembly",
"wabt"
] |
https://github.com/WebAssembly/wabt/blob/f25775cf7a627f3f15f00bf76dc0852e5ccf5df8/src/binary-reader-ir.cc#L1498
This can break wasm2c when running on a Wasm module with debug names (including the `throw.wast` test).
Tracking issue for regression test.
|
BinaryReaderIR::SetTagName puts tag names into bindings for globals
|
https://api.github.com/repos/WebAssembly/wabt/issues/2039/comments
| 0 |
2022-11-04T20:46:19Z
|
2022-11-04T21:16:00Z
|
https://github.com/WebAssembly/wabt/issues/2039
| 1,436,631,798 | 2,039 |
[
"WebAssembly",
"wabt"
] |
wasm2c seems to have trouble if the module has duplicate debug names. E.g. this module:
```wat
(module
(memory $x 0)
(table $x 0 funcref)
)
```
processed with:
```
$ wat2wasm --debug-names -o test.wasm test.wat
$ wasm2c -o test.c test.wasm
```
correctly produces unique-ified names when it declares the elements:
```c
typedef struct Z_test_instance_t {
wasm_rt_memory_t w2c_x;
wasm_rt_funcref_table_t w2c_x_0;
} Z_test_instance_t;
```
but doesn't use the right names when accessing them:
```c
static void init_memories(Z_test_instance_t* instance) {
wasm_rt_allocate_memory(&instance->w2c_x, 0, 65536);
}
static void init_tables(Z_test_instance_t* instance) {
wasm_rt_allocate_funcref_table(&instance->w2c_x, 0, 4294967295);
}
void Z_test_free(Z_test_instance_t* instance) {
wasm_rt_free_funcref_table(&instance->w2c_x);
wasm_rt_free_memory(&instance->w2c_x);
}
```
This can also happen even if the module doesn't have debug names (because NameGenerator uses "e" for both element segments and exceptions, which maybe we should also change, but I think this would be harmless if wasm2c could handle the duplicate names whether they're generated or come from the name section).
|
wasm2c doesn't handle duplicate debug names
|
https://api.github.com/repos/WebAssembly/wabt/issues/2034/comments
| 0 |
2022-11-02T05:17:15Z
|
2022-11-30T00:17:26Z
|
https://github.com/WebAssembly/wabt/issues/2034
| 1,432,513,427 | 2,034 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.