mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-09-05 17:32:26 +00:00
Compare commits
6 Commits
2fed811d92
...
8d32f62f93
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8d32f62f93 | ||
![]() |
a606c8689d | ||
![]() |
6253bd1b52 | ||
![]() |
b36fac9bcd | ||
![]() |
d55852d992 | ||
![]() |
9295d52508 |
5
.github/ISSUE_TEMPLATE/blank_issue.md
vendored
5
.github/ISSUE_TEMPLATE/blank_issue.md
vendored
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
name: Blank Issue
|
||||
about: Create a blank issue.
|
||||
title: ''
|
||||
---
|
41
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "Add a placeholder for issue title. ex: [BUG]"
|
||||
labels: bug
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Is it a security vulnerability?**
|
||||
If it results in a crash or hang, please refer to [a quick checklist](../../doc/security_need_to_know.md#is-this-bug-considered-a-security-vulnerability) to determine if it is a security vulnerability. If you are still unsure, please report it through [a security advisor](https://github.com/bytecodealliance/wasm-micro-runtime/security/advisories) and allow the maintainer to make a decision. Thank you.
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Version**
|
||||
Information like tags, release version, commits.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. Compile iwasm with flags like '...'
|
||||
2. (Optional) Compile wamrc with flags like '....'
|
||||
3. (Optional) Run wamrc with CLI options like '...' to generate .aot
|
||||
4. Run iwasm with CLI options like '...'
|
||||
5. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Actual Result**
|
||||
What you've got.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
|
||||
- Arch [e.g. x86_64, arm64, 32bit]
|
||||
- Board [e.g. STM32F407]
|
||||
- OS [e.g. Linux, Windows, macOS, FreeRTOS]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
blank_issues_enabled: true
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: 'Add a placeholder for issue title. ex: [RFC]'
|
||||
labels: help wanted
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
28
.github/ISSUE_TEMPLATE/improvement.md
vendored
28
.github/ISSUE_TEMPLATE/improvement.md
vendored
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
name: Improvement
|
||||
about: A feature request or code improvement.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
Thanks for filing a feature request! Please fill out the TODOs below.
|
||||
|
||||
#### Feature
|
||||
|
||||
TODO: Brief description of the feature/improvement you'd like to see in WAMR
|
||||
|
||||
#### Benefit
|
||||
|
||||
TODO: What is the value of adding this in WAMR? What problems does it solve?
|
||||
|
||||
#### Implementation
|
||||
|
||||
TODO: Do you have an implementation plan, and/or ideas for data structures or
|
||||
algorithms to use?
|
||||
|
||||
#### Alternatives
|
||||
|
||||
TODO: What are the alternative implementation approaches or alternative ways to
|
||||
solve the problem that this feature would solve? How do these alternatives
|
||||
compare to this proposal?
|
36
.github/ISSUE_TEMPLATE/report_bug.md
vendored
36
.github/ISSUE_TEMPLATE/report_bug.md
vendored
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
name: WAMR bug or defect report
|
||||
about: Report a bug or defect in WAMR
|
||||
title: ''
|
||||
---
|
||||
|
||||
Thanks for filing a bug or defect report! Please fill out the TODOs below.
|
||||
|
||||
### Subject of the issue
|
||||
|
||||
Describe the bug or defect here.
|
||||
|
||||
### Test case
|
||||
|
||||
Upload the related wasm file, wast file or the source files if you can.
|
||||
|
||||
### Your environment
|
||||
|
||||
* Host OS
|
||||
* WAMR version, platform, cpu architecture, running mode, etc.
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
Tell us how to reproduce this bug or defect.
|
||||
|
||||
### Expected behavior
|
||||
|
||||
Tell us what should happen
|
||||
|
||||
### Actual behavior
|
||||
|
||||
Tell us what happens instead
|
||||
|
||||
### Extra Info
|
||||
|
||||
Anything else you'd like to add?
|
2
.github/workflows/compilation_on_zephyr.yml
vendored
2
.github/workflows/compilation_on_zephyr.yml
vendored
|
@ -11,6 +11,7 @@ on:
|
|||
- synchronize
|
||||
paths:
|
||||
- ".github/**"
|
||||
- "!.github/ISSUE_TEMPLATE/**"
|
||||
- "build-scripts/**"
|
||||
- "core/**"
|
||||
- "!core/deps/**"
|
||||
|
@ -27,6 +28,7 @@ on:
|
|||
- "dev/**"
|
||||
paths:
|
||||
- ".github/**"
|
||||
- "!.github/ISSUE_TEMPLATE/**"
|
||||
- "build-scripts/**"
|
||||
- "core/**"
|
||||
- "!core/deps/**"
|
||||
|
|
|
@ -4226,15 +4226,7 @@ create_module(char *name, char *error_buf, uint32 error_buf_size)
|
|||
#endif
|
||||
|
||||
#if WASM_ENABLE_LIBC_WASI != 0
|
||||
#if WASM_ENABLE_UVWASI == 0
|
||||
module->wasi_args.stdio[0] = os_invalid_raw_handle();
|
||||
module->wasi_args.stdio[1] = os_invalid_raw_handle();
|
||||
module->wasi_args.stdio[2] = os_invalid_raw_handle();
|
||||
#else
|
||||
module->wasi_args.stdio[0] = os_get_invalid_handle();
|
||||
module->wasi_args.stdio[1] = os_get_invalid_handle();
|
||||
module->wasi_args.stdio[2] = os_get_invalid_handle();
|
||||
#endif /* WASM_ENABLE_UVWASI == 0 */
|
||||
wasi_args_set_defaults(&module->wasi_args);
|
||||
#endif /* WASM_ENABLE_LIBC_WASI != 0 */
|
||||
|
||||
return module;
|
||||
|
|
|
@ -1026,14 +1026,14 @@ memory_instantiate(AOTModuleInstance *module_inst, AOTModuleInstance *parent,
|
|||
/* If only one page and at most one page, we just append
|
||||
the app heap to the end of linear memory, enlarge the
|
||||
num_bytes_per_page, and don't change the page count */
|
||||
heap_offset = num_bytes_per_page;
|
||||
num_bytes_per_page += heap_size;
|
||||
if (num_bytes_per_page < heap_size) {
|
||||
if (heap_size > UINT32_MAX - num_bytes_per_page) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"failed to insert app heap into linear memory, "
|
||||
"try using `--heap-size=0` option");
|
||||
return NULL;
|
||||
}
|
||||
heap_offset = num_bytes_per_page;
|
||||
num_bytes_per_page += heap_size;
|
||||
}
|
||||
else if (heap_size > 0) {
|
||||
if (init_page_count == max_page_count && init_page_count == 0) {
|
||||
|
|
|
@ -3438,6 +3438,21 @@ wasm_runtime_module_dup_data(WASMModuleInstanceCommon *module_inst,
|
|||
|
||||
#if WASM_ENABLE_LIBC_WASI != 0
|
||||
|
||||
void
|
||||
wasi_args_set_defaults(WASIArguments *args)
|
||||
{
|
||||
memset(args, 0, sizeof(*args));
|
||||
#if WASM_ENABLE_UVWASI == 0
|
||||
args->stdio[0] = os_invalid_raw_handle();
|
||||
args->stdio[1] = os_invalid_raw_handle();
|
||||
args->stdio[2] = os_invalid_raw_handle();
|
||||
#else
|
||||
args->stdio[0] = os_get_invalid_handle();
|
||||
args->stdio[1] = os_get_invalid_handle();
|
||||
args->stdio[2] = os_get_invalid_handle();
|
||||
#endif /* WASM_ENABLE_UVWASI == 0 */
|
||||
}
|
||||
|
||||
static WASIArguments *
|
||||
get_wasi_args_from_module(wasm_module_t module)
|
||||
{
|
||||
|
|
|
@ -1118,6 +1118,9 @@ wasm_runtime_lookup_wasi_start_function(WASMModuleInstanceCommon *module_inst);
|
|||
WASM_RUNTIME_API_EXTERN uint32_t
|
||||
wasm_runtime_get_wasi_exit_code(WASMModuleInstanceCommon *module_inst);
|
||||
|
||||
void
|
||||
wasi_args_set_defaults(WASIArguments *args);
|
||||
|
||||
bool
|
||||
wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
|
||||
const char *dir_list[], uint32 dir_count,
|
||||
|
|
|
@ -6712,15 +6712,7 @@ create_module(char *name, char *error_buf, uint32 error_buf_size)
|
|||
#endif
|
||||
|
||||
#if WASM_ENABLE_LIBC_WASI != 0
|
||||
#if WASM_ENABLE_UVWASI == 0
|
||||
module->wasi_args.stdio[0] = os_invalid_raw_handle();
|
||||
module->wasi_args.stdio[1] = os_invalid_raw_handle();
|
||||
module->wasi_args.stdio[2] = os_invalid_raw_handle();
|
||||
#else
|
||||
module->wasi_args.stdio[0] = os_get_invalid_handle();
|
||||
module->wasi_args.stdio[1] = os_get_invalid_handle();
|
||||
module->wasi_args.stdio[2] = os_get_invalid_handle();
|
||||
#endif /* WASM_ENABLE_UVWASI == 0 */
|
||||
wasi_args_set_defaults(&module->wasi_args);
|
||||
#endif /* WASM_ENABLE_LIBC_WASI != 0 */
|
||||
|
||||
(void)ret;
|
||||
|
|
|
@ -3316,15 +3316,7 @@ create_module(char *name, char *error_buf, uint32 error_buf_size)
|
|||
#endif
|
||||
|
||||
#if WASM_ENABLE_LIBC_WASI != 0
|
||||
#if WASM_ENABLE_LIBC_UVWASI == 0
|
||||
module->wasi_args.stdio[0] = os_invalid_raw_handle();
|
||||
module->wasi_args.stdio[1] = os_invalid_raw_handle();
|
||||
module->wasi_args.stdio[2] = os_invalid_raw_handle();
|
||||
#else
|
||||
module->wasi_args.stdio[0] = os_get_invalid_handle();
|
||||
module->wasi_args.stdio[1] = os_get_invalid_handle();
|
||||
module->wasi_args.stdio[2] = os_get_invalid_handle();
|
||||
#endif /* WASM_ENABLE_UVWASI == 0 */
|
||||
wasi_args_set_defaults(&module->wasi_args);
|
||||
#endif /* WASM_ENABLE_LIBC_WASI != 0 */
|
||||
|
||||
(void)ret;
|
||||
|
|
|
@ -335,14 +335,14 @@ memory_instantiate(WASMModuleInstance *module_inst, WASMModuleInstance *parent,
|
|||
/* If only one page and at most one page, we just append
|
||||
the app heap to the end of linear memory, enlarge the
|
||||
num_bytes_per_page, and don't change the page count */
|
||||
heap_offset = num_bytes_per_page;
|
||||
num_bytes_per_page += heap_size;
|
||||
if (num_bytes_per_page < heap_size) {
|
||||
if (heap_size > UINT32_MAX - num_bytes_per_page) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"failed to insert app heap into linear memory, "
|
||||
"try using `--heap-size=0` option");
|
||||
return NULL;
|
||||
}
|
||||
heap_offset = num_bytes_per_page;
|
||||
num_bytes_per_page += heap_size;
|
||||
}
|
||||
else if (heap_size > 0) {
|
||||
if (init_page_count == max_page_count && init_page_count == 0) {
|
||||
|
|
|
@ -343,7 +343,7 @@ And the wasm app can calls below APIs to allocate/free memory from/to the shared
|
|||
We can combine the configurations. For example, if we want to disable interpreter, enable AOT and WASI, we can run command:
|
||||
|
||||
``` Bash
|
||||
cmake .. -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_LIBC_WASI=0 -DWAMR_BUILD_PLATFORM=linux
|
||||
cmake .. -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_LIBC_WASI=1 -DWAMR_BUILD_PLATFORM=linux
|
||||
```
|
||||
|
||||
Or if we want to enable interpreter, disable AOT and WASI, and build as X86_32, we can run command:
|
||||
|
|
Loading…
Reference in New Issue
Block a user