Commit Graph

2450 Commits

Author SHA1 Message Date
d298a66d38 bump AOT_CURRENT_VERSION for extended-const (#4511)
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4504
2025-07-27 14:39:35 +08:00
121232a995 Merge commit from fork
If `--addr-pool=1.2.3.4`, the runtime will return an error.
The value must be in the form of ADDRESS/MASK.
2025-07-27 14:38:56 +08:00
c080aa80d0 add a CL option to specify shared heap size 2025-07-22 05:01:14 +02:00
8ae3bf7080 build(deps): Bump github/codeql-action from 3.29.2 to 3.29.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.2 to 3.29.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.2...v3.29.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22 04:53:52 +02:00
a780ffdc43 lib-socket: make getaddrinfo return EAI_ values (#4498)
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4464
2025-07-21 09:21:31 +08:00
952b35d11d Add CI on Zephyr (#4336)
to run product-mini/platforms/zephyr/simple and
product-mini/platforms/zephyr/user-mode

Construct a T2 (star topology) for the current smoke test. This is not the
final topology, and we may modify it once we determine the optimal
configuration.
2025-07-21 09:21:01 +08:00
e4d2673a7c wasi-nn: add a comment on load_by_name_with_config (#4492)
this api has been introduced by
https://github.com/bytecodealliance/wasm-micro-runtime/pull/3709
in which i couldn't find any explanations.

this comment is my best guess.
2025-07-17 09:50:49 +08:00
248e10b79e nn-cli: add an option to use load_by_name (#4490)
by specifying a name for --load-graph.
for example,
```
--load-graph=name=foo
```
2025-07-17 09:47:20 +08:00
79408e59cc wamr-wasi-extensions: document (#4493) 2025-07-17 09:44:47 +08:00
34f5d13444 doc/socket_api.md: some historical notes (#4494) 2025-07-17 09:43:54 +08:00
704aa3e7e5 modify macro related to simde when WASM_OP_SELECT_128 (#4461)
* remove macro of fast interpreter when WASM_OP_SELECT_128
* Modified some macros related to SIMDE
2025-07-17 08:04:41 +08:00
46d4e248bb posix os_socket_accept: stop assuming socklen_t is unsigned int (#4488) 2025-07-17 08:04:13 +08:00
db942f3aaf wasi_socket_ext.c: fix error reporting
do not return __WASI_ERRNO_xxx error code where 0/-1 is more appropriate.

most of them were not harmful because the value of
__WASI_ERRNO_SUCCESS is 0.

the one with __WASI_ERRNO_NOPROTOOPT in socket() is
a user-visible bug.

tested with wamr-wasi-extensions/samples/socket-tcp-udp.

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4474
2025-07-15 09:23:46 +02:00
2a952b371a wasi_socket_ext.c: fix the number of getaddrinfo results (#4466)
the case of zero results was especially broken.
2025-07-14 13:12:32 +08:00
b3158e643c Fix typos (#4472)
* leave api name unchanged so don't break API
2025-07-14 13:12:08 +08:00
c8f7a7fc1a fix regression running_config.json (#4477) 2025-07-14 13:08:58 +08:00
2c4a660c4c posix os_socket_addr_resolve: relax compatibility check (#4469)
some getaddrinfo implementations sometimes return results with
ai_protocol=0.

cf. https://github.com/apache/nuttx/issues/16693

standard-wise, i couldn't find anything about ai_protocol in
susv4-2018 except the following text:

> The fields ai_family, ai_socktype, and ai_protocol shall be usable
> as the arguments to the socket() function to create a socket suitable
> for use with the returned address.

because ai_protocol is usually merely used to feed socket() and
socket() usually accepts 0, it's probably standard-wise ok for
getaddrinfo to return ai_protocol=0.
the major implementations of getaddrinfo (eg. kame) seem to return
specific values like ai_protocol=IPPROTO_TCP though.

anyway, for the purpose of this function, there is little point to
be strict on the host getaddrinfo behavior. this commit just relaxes
the check to be friendly to those getaddrinfo implementations.
2025-07-14 13:06:40 +08:00
53feadc2b0 lib-socket: implement getsockopt(SOL_SOCKET,SO_TYPE) (#4458)
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4456
2025-07-14 13:06:33 +08:00
5d48cfdbc0 introduce wasm_runtime_instantiate_ex2 (#4444)
* introduce wasm_runtime_instantiate_ex2

at this point, just a slightly inefficiant functionality
equivalent of wasm_runtime_instantiate_ex.
however, unlike wasm_runtime_instantiate_ex, this one is designed
to be extendable without breaking the user-visible ABI.
because the definition of InstantiationArgs2 is not exposed to
users, we can safely add new members to it.

this commit also makes wasm_runtime_instantiate_ex a wrapper
of wasm_runtime_instantiate_ex2.

if this goes well, maybe it's a good idea to apply a similar
pattern to RuntimeInitArgs, LoadArgs, SharedHeapInitArgs, etc.
i started with InstantiationArgs just because i happen to have
a need to extend it for wasi-nn.

cf.
https://github.com/bytecodealliance/wasm-micro-runtime/issues/4364
https://github.com/bytecodealliance/wasm-micro-runtime/issues/4331

* product-mini/platforms/posix: use wasm_runtime_instantiate_ex2
2025-07-14 13:06:23 +08:00
65d3ffa7a4 add validation for recursive type count in loader (#4440) 2025-07-14 13:06:08 +08:00
47c7c85ac2 Bump version to 2.4.0 (#4483) 2025-07-14 11:06:03 +08:00
17be90d8f0 posix os_socket_addr_resolve: return the consistent max_info_size (#4467)
return the same value for max_info_size regardless of addr_info_size.
2025-07-10 13:42:57 +08:00
9e92f5ebe1 fix a wamrc debug mode compile issue (#4470) 2025-07-10 08:29:31 +08:00
334b4f8cb5 Add readme for extended const (#4471) 2025-07-10 08:29:03 +08:00
56f87b7ee9 wasi-nn: do not pretend to support legacy abi in openvino and llamacpp (#4468)
as tested by core/iwasm/libraries/wasi-nn/test/test_tensorflow.c,
the legacy "wasi_nn" abi uses the number of fp32 for get_output.
because these backends don't implement the abi, bail out explicitly
in build time.

cf.
https://github.com/bytecodealliance/wasm-micro-runtime/issues/4376
2025-07-10 08:28:08 +08:00
933e49df18 appease a few compiler warnings (-Wstrict-prototypes) (#4465) 2025-07-10 08:28:00 +08:00
d6fc18e197 enable aux stack frame for aot compiler fuzz test (#4462) 2025-07-10 08:27:42 +08:00
cd4712d939 build(deps): Bump github/codeql-action from 3.29.1 to 3.29.2 (#4459)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.1 to 3.29.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.1...v3.29.2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 08:27:32 +08:00
903a5c1f8c improve logic of heap_type validation when ref.null (#4372)
* Follow-up to PR #4300: prevent potential overflow

PR #4300 introduced the rationale for validating heap_type.
This patch moves the validation before the computation of
type1 to prevent potential overflow.
2025-07-10 08:27:11 +08:00
fbd27e5e03 wasi_nn_llamacpp.c: explicitly reject unimplemented input index (#4446)
note: wasmedge seems to accept index 1 for metadata. we don't
implement it.
2025-07-09 10:35:46 +08:00
d3b0b5c066 Add security issue runbook (#4450)
This runbook provides step-by-step guidance on handling a security advisory
2025-07-08 09:26:45 +08:00
0eceed2ba9 wasi: avoid user-triggerable 0-sized allocations (#4452)
might fix https://github.com/bytecodealliance/wasm-micro-runtime/issues/4451
2025-07-08 09:25:50 +08:00
7d05dbc988 Support extended constant expressions (#4432)
* implement extended const expr (#4318)
* add a toggle to enable extended const on wamrc (#4412)
2025-07-07 13:34:02 +08:00
be33a40ba7 Fix socket shutdown (#12) (#4449) 2025-07-07 02:02:28 +08:00
8a55a1e7a1 Shared heap enhancements for Interpreter and AOT (#4400)
Propose two enhancements:

- Shared heap created from preallocated memory buffer: The user can create a shared heap from a pre-allocated buffer and see that memory region as one large chunk; there's no need to dynamically manage it(malloc/free). The user needs to make sure the native address and size of that memory region are valid.
- Introduce shared heap chain: The user can create a shared heap chain, from the wasm app point of view, it's still a continuous memory region in wasm app's point of view while in the native it can consist of multiple shared heaps (each of which is a continuous memory region). For example, one 500MB shared heap 1 and one 500 MB shared heap 2 form a chain, in Wasm's point of view, it's one 1GB shared heap.

After these enhancements, the data sharing between wasm apps, and between hosts can be more efficient and flexible. Admittedly shared heap management can be more complex for users, but it's similar to the zero-overhead principle. No overhead will be imposed for the users who don't use the shared heap enhancement or don't use the shared heap at all.
2025-07-04 10:44:51 +08:00
ee056d8076 wasi_nn_llamacpp.c: validate input tensor type/dimensions (#4442) 2025-07-03 10:17:19 +08:00
68d5ae10d4 docs: fix cmake variable typo (#4441) 2025-07-02 09:37:29 +08:00
d598c0d0d3 CI: add wamr_wasi_extensions to the release assets (#4425)
you can find an example of the release asset at:
https://github.com/yamt/wasm-micro-runtime/releases/download/WAMR-2.3.999/wamr-wasi-extensions-2.3.999.zip

note: this is a static library for wasm32-wasi. no need to provide
per host OS (macOS, ubuntu, etc) binaries.
2025-07-01 19:32:01 +08:00
da6019f749 wasi_nn_llamacpp.c: reject invalid graph and execution context (#4422)
* return valid graph and execution context instead of using stack garbage.
  (always 0 for now because we don't implement multiple graph/context
  for this backend.)

* validate user-given graph and execution context values. reject
  invalid ones.
2025-07-01 19:31:00 +08:00
ebf1404ad1 wasi_nn_openvino.c: avoid self-assignment warning (#4434) 2025-07-01 19:19:36 +08:00
c7148a6823 Fix potential integer overflow issues (#4429)
It is reported as "Multiplication result converted to larger type".
And "Multiplication result may overflow 'Type A' before it is
converted to 'Type B'." Type A is a larger type than Type B.

Since the conversion applies after the multiplication, arithmetic
overflow may still occur.

> The rule flags every multiplication of two non-constant integer expressions
> that is (explicitly or implicitly) converted to a larger integer type. The
> conversion is an indication that the expression would produce a result that
> would be too large to fit in the smaller integer type.
2025-07-01 13:39:30 +08:00
8949797c84 Improve run.py of regression (#4417)
* Improve run.py of regression
1. Fix script interruption on case failure
2. improve statistics logic
3. enable select specific issue ids
2025-07-01 10:44:53 +08:00
38fe056cc6 wasi-nn: reduce code duplication a bit (#4433) 2025-07-01 10:37:12 +08:00
430cc5e5ef Refactor AOTObjectData definition to use a forward declaration (#4428)
> core/iwasm/compilation/aot_emit_aot_file.c:85:3:
    error: redefinition of typedef 'AOTObjectData' is a C11 feature
2025-07-01 10:10:11 +08:00
cb233ec042 build(deps): Bump github/codeql-action from 3.29.0 to 3.29.1 (#4436)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.0 to 3.29.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.0...v3.29.1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 10:07:48 +08:00
4fbb372f15 CI: revert SGX retry attempts (#4421)
* Revert "Improve spec test execution by adding retry logic for transient errors (#4393)"

This reverts commit 64cafaff1e.

* Revert "Add error handling for sgx ci (#4222)"

This reverts commit 8ad47897d1.
2025-06-30 12:58:20 +08:00
0127eafbe5 loader: fix a potential overflow issue (#4427) 2025-06-30 12:57:57 +08:00
7a6a6a39e9 wasi_nn_openvino.c: fix a debug build (#4416)
after "wasi_nn_openvino.c: implement multiple models per instance" change.
(https://github.com/bytecodealliance/wasm-micro-runtime/pull/4380)
2025-06-30 12:57:44 +08:00
18d4227ab6 CI: build wamr-wasi-extensions (#4394)
* wamr-wasi-extensions: separate test scripts
also, allow to specify the prefix directory.
for the convenience of the CI.

* CI: build wamr-wasi-extensions
fragments are copied from compilation_on_macos.yml.
(thus intel copyright notice)
2025-06-27 12:28:46 +08:00
0641dd1506 Fix few shadow warnings (#4409)
- declaration of ‘memidx’ shadows a previous local
- declaration of ‘count’ shadows a previous local
2025-06-27 11:55:32 +08:00