The destroy_callback_list variable in thread_manager_destroy is not cleared.
When wamr is started as a task, after exiting and restarting, it will loop
endlessly in traverse_list.
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
Enable ref types feature and bulk memory feature by default for wamrc
and provide "--disable-ref-types", "--disable-bulk-memory" to disable
them.
And remove the ref_type_flag option in wasm_loader.c which is used to
control whether to enable ref types or not when ENABLE_REF_TYPES
macro is enabled in wamrc. As the wasm binary format with ref types
is compatible with the binary format before, we can remove the option.
Also update the spec test scripts.
Applied on the nuttx platform, some memory configurations are added,
and aot and interp can be completely closed or opened, thereby reducing
the flash size.
Fix some potential pointer overflows in aot applying relocations and
several other places.
And add sanitizer compiler flags to wamrc CMakeLists.txt to detect
such issues.
Enable LLVM link time optimization for AOT and enable it by default,
and provide "wamrc --disable-llvm-lto" option to disable it.
And modify the spec test script, disable it by default when testing
spec cases.
Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This patch enables huge page support for posix platforms for performance
reason, if the request size to mmap is larger than 2MB, then we use madvise
to set some pages to huge page.
And add macro control to enable tracing the mmap/munmap.
Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
Fix fail to get builtin functions in indirect call (XIP) mode, e.g.
function aot_alloc_frame, aot_memory_init, aot_table_init and so on.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Port spec-test-script/all.sh to spec-test-script/all.py and enable to run
spec cases with multiple threads parallelly:
- It reduces spec_test.yml from ~14min to ~9min and reduces
compilation_on_sgx.yml from ~18min to ~12min
- run `./test_wamr.sh` will keep the same experience likes before by default
- run `./test_wamr.sh -P` will enable parallelism mode
- in parallelism mode, all.py will be in a less-output mode. It only outputs
the last words of failed cases and will not output logs for those passed
Currently the string in the wasm/aot file will be duplicated and stored
into const string list/set in interpreter/aot loader, which leads to extra
unnecessary memory consumption if the file buffer can be referred to
after loading. We refine the string storage by:
- if the file buffer can be referred to after loading and it is writable, we
reuse the file buffer to store the string but not store it into the const
string set: move string backward and append '\0'
- emit string with '\0' only for XIP mode in which the AOT file is readonly
- if the file buffer cannot be referred to, e.g. in app manager, keep the
same behavior as before
Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
Enhance workflows by caching llvm directories directly instead of
caching the llvm-xxx.tar.gz packages, so as to reduce the time
consumption of unpacking the cached LLVM packages.
For cmake based project, there are default values in .cmake,
but for other build system, may these symbols were not defined in their
build system and warnings (XXX is not defined) were generated while building.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Enable emitting custom name section to aot file when adding
`--enable-dump-call-stack` or `--enable-dump-call-stack` to
wamrc and there is custom name section in wasm file, which
can be generated by wasi-sdk/emcc "-g" option. So aot runtime
can also get the function name from the custom name section
instead of export section, to which developer should use
`--export-all` for wasi-sdk/emcc to generate export function
names.
Avoid hardcoding the path of wasi-sdk in wamr_toolchain.cmake,
allow passing -w [wasi-sdk path] to build_sdk.sh,
allow passing OUT_DIR to app-sdk and runtime-sdk,
and optimize message information.
Apply clang-format for C source files in folder core/app-mgr,
core/app-framework, and test-tools.
And rename folder component_test to component-test, update
zephyr build document.
Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
The size used to apply "size = align_uint(size, 4)" may be different
when calculating total size (in get_object_data_sections_size) and
emitting actual data (in aot_emit_object_data_section_info) for the
object data section.
This patch fixes the "Error: emit object data section info failed".
Zephyr can apply board specific .conf and .overlay automatically,
move .conf to boards to make it easy to support different board without
addition command parameters.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Apply clang-format for core/iwasm/compilation and core/iwasm/libraries files.
Add wasm-c-api empty_imports sample to workflow test.
And enable triggering workflow when core/config.h changes.
Allow empty import array (but not NULL) for wasm-c-api wasm_instance_new,
which makes the code more robust, especially in use cases where imports
might be constructed dynamically.
And add a test case in samples/wasm-c-api/src/empty_imports.c to test it.
- fix data race issue between debug control thread and main thread
- fix possible memory leaks in breakpoints list
- fix memory uninitialized issues
- remove unused data structures
- add more checks when handling packet and args
- fix mini-loader issues
- fix config_common.cmake fast interp prompt issue
Apply clang-format for core/iwasm/include, core/iwasm/common and
core/iwasm/aot files.
Update spec cases test script:
- Checkout latest commit of https://github.com/WebAssembly/spec
- Checkout main branch but not master of https://github.com/WebAssembly/threads
- Update wabt to latest version
And update source debugging document.
Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>