Commit Graph
97 Commits
Author SHA1 Message Date
Xu JunandGitHub e278861206 Avoid raising exception when debugging with VSCode (#1686) 2022-11-07 11:57:53 +08:00
Xu JunandGitHub f8af659caa minor fix in README (#1626) 2022-10-20 19:12:21 +08:00
Xu JunandGitHub b49fb8a668 add wamr blog link to readme (#1624) 2022-10-20 15:06:42 +08:00
Xu JunandGitHub a75295ec14 Minor fix in assembly script library (#1597)
And fix a code format issue introduced by last commit.
2022-10-14 12:54:25 +08:00
Xu JunandGitHub 826cf4f8e1 Fix threads spec test issues (#1586) 2022-10-13 13:53:09 +08:00
Xu JunandGitHub aaea27c987 Fix issue in assemblyscript lib (#1583)
Resolve #1581
2022-10-12 20:01:33 +08:00
Xu JunandGitHub 5722fcc40a Fix issue in multi-thread sample (#1458)
Set `WAMR_BUILD_LIB_PTHREAD_SEMAPHORE` for the sample,
and update document.
2022-09-07 12:56:50 +08:00
Xu JunandGitHub e0c2acd178 add language bindings in README (#1434)
* add language bindings in README

* minor update
2022-08-30 22:05:54 +08:00
Xu JunandGitHub 28d9fb60d2 Add missing symbols for arc aot relocation (#1408) 2022-08-23 17:38:55 +08:00
Xu JunandGitHub 3b641b17d8 Reserve one pointer size for fast-interp code_compiled_size (#1382)
Reserve one pointer size for fast-interp code_compiled_size: if the last opcode of
current function is to be dropped (e.g. OP_DROP), the peak memory usage will
be larger than the final code_compiled_size, we record the peak size to ensure
there won't be invalid memory access during the second traversing.
2022-08-15 11:33:20 +08:00
Xu JunandGitHub bc86674a45 Let iwasm return non-zero value when running failed (#1377)
Let iwasm return non-zero value when running failed
so that the caller (e.g. test framework) can check the
running status according to the return value.
2022-08-12 18:03:14 +08:00
Xu JunandGitHub 872cc51881 Fix mini-loader issue (#1383) 2022-08-12 16:35:57 +08:00
Xu JunandGitHub 4653de90d2 Fix a maybe-uninitialized use warning (#1370)
When `OS_ENABLE_HW_BOUND_CHECK` isn't defined and
`WASM_ENABLE_THREAD_MGR == 0`, the `exec_env` is used
without initialization.
2022-08-10 12:26:17 +08:00
Xu JunandGitHub 4b00432c1a Fix dump call stack issue in interpreter (#1358)
Fix dump call stack issue in interpreter introduced by hw bound check:
the call stack isn't dumped if the exception is thrown and caught by
signal handler.
And restore the wasm stack frame to the original status after calling a
wasm function.
2022-08-08 11:15:30 +08:00
Xu JunandGitHub 1c6d10095e add missing symbol for aot_reloc_arc.c (#1344) 2022-08-02 09:43:52 +08:00
Xu JunandGitHub db210fbc66 Remove unnecessary memset after mmap (#1273)
Remove unnecessary memset after mmap to decrease the number of
page faults, as reported in #1269.
2022-07-07 13:53:50 +08:00
Xu JunandGitHub 471cac4719 Enable dump call stack to a buffer (#1244)
Enable dump call stack to a buffer, use API
`wasm_runtime_get_call_stack_buf_size` to get the required buffer size
and use API
`wasm_runtime_dump_call_stack_to_buf` to dump call stack to a buffer
2022-06-25 21:38:43 +08:00
Xu JunandGitHub 53b775aa4b Support integrate 3rd-party toolchains into wamrc (#1237)
Support integrating 3rd-party toolchain llc compiler or asm compiler
into wamrc by setting environment variable WAMRC_LLC_COMPILER
or WAMRC_ASM_COMPILER, wamrc will use these tools to generate
object file from LLVM IR firstly, and then refactor the object file into
aot file.
2022-06-20 13:13:41 +08:00
Xu JunandGitHub d0676930dc Add arc compiler-rt functions and reloc type for mwdt (#1238)
Add arc compiler-rt functions and reloc type for arc MetaWare
Development Toolkit (mwdt), controlled by macro __CCAC__.
2022-06-20 09:03:31 +08:00
Xu JunandGitHub 4b38205023 Fix some issues reported by klocwork (#1233)
Change memcpy to bh_memcpy_s and add some asserts to
enhance the security.
2022-06-16 19:50:47 +08:00
Xu JunandGitHub 188d5e70e9 Fix typo in wasm_mini_loader.c (#1232) 2022-06-16 12:07:32 +08:00
Xu JunandGitHub b39f4c5c9b Fix drop opcode issue in fast interpreter (#1231)
Fix fast interpreter issue reported in #1230
2022-06-16 09:51:01 +08:00
Xu JunandGitHub e0a8aa09be Fix build error when enable custom section without interpreter (#1229) 2022-06-15 18:14:39 +08:00
Xu JunandGitHub 1705ae569b Update spec test script (#1227) 2022-06-15 11:07:39 +08:00
Xu JunandGitHub 77595c9560 Support emit specified custom sections into AoT file (#1207)
And add API to get the content of custom section with
section name for both wasm file and aot file.
2022-06-10 21:51:13 +08:00
Xu JunandGitHub 474f081f56 Fix return value not checked issue reported by Coverity (#1156)
Fix return value not checked issue in function init_wasm_timer,
reported by Coverity
2022-05-07 19:22:00 +08:00
Xu JunandGitHub a7f4c3c15c Fix app manager/framework issues reported by Coverity (#1155)
runtime_sensor.c: add return value check for os_mutex_init
                             fix find_sensor_client
sensor_mgr_ref.c: add return value check for init_sensor_framework
app_manager_host.c: add return value check for app_manager_host_init
module_wasm_app.c: add bh_assert for m_data
                                   fix mkdir potential issue
sample littlevgl/gui/simple: add return value check for init_sensor_framework
host_tool: add more check for g_conn_fd
2022-05-07 15:43:34 +08:00
Xu JunandGitHub 16cfd4764d Fix atomic wait not thread safe issue (#1146)
Add lock for acquire_wait_info and release_wait_info, and
remove release_wait_info in wasm_runtime_atomic_notify.
2022-05-06 12:52:17 +08:00
Xu JunandGitHub 98431225f2 Store import function pointer in module instance (#1130)
Fix the issue reported by #1118 , use this approach since it avoids copying
unnecessary static information into instance and reduces the footprint.
2022-04-27 20:21:51 +08:00
Xu JunandGitHub 5ab368dd00 Support va_args in libc-builtin (#1117)
Implement vprintf/sprintf/snprintf wrapper functions for libc-builtin.
2022-04-24 10:39:18 +08:00
Xu JunandGitHub 8589ed155d Fix %ld specifier issue in libc-builtin printf wrapper (#1088)
The format specifiers of %ld/%lu/%li/%lx/%lp/%lo (or %z* and %t* like) should
be treated as 32-bit integer in wasm.
And merge the handle of unsigned/signed for %u/%d and %llu/%lld specifier
when calling snprintf.
2022-04-14 14:02:19 +08:00
Xu JunandGitHub 87c67eb6f0 Enhance printf_wrapper in libc-builtin (#1074)
Use snprintf to format the string and then output it,
so as to support more formats and reduce the footprint.
2022-04-12 17:13:18 +08:00
Xu JunandGitHub fd9cce0eef Add fast interpreter offset overflow check (#1076)
* check fast interpreter offset overflow
2022-04-07 21:07:32 +08:00
Xu JunandGitHub 24afd4e7cb Preserve execution memory for debug instance (#1072)
During debugging, the debug client may request to malloc a memory space
to evaluate the user expressions. If we malloc memory from the linear memory,
it may fail when the thread is in stop status. We preserve a buffer during
creating debug instance, and use a simple bump pointer allocator to serve lldb's
memory request.
2022-04-04 08:23:55 +08:00
Xu JunandGitHub f0dc6a3015 Fix fast interpreter constant space overflow issue (#1071)
Fix the potential integer overflow of const index in const space of fast interpreter,
emit i32/i64.const opcode when the const index is larger than INT32_MAX.
And add check for the function local cell num.
2022-04-04 07:55:37 +08:00
Xu JunandGitHub 7a0ec1cd17 Use nanosecond for atomic wait (#1041)
Fix issue reported by #1038
2022-03-10 19:43:27 +08:00
Xu JunandGitHub 3fe191b0df [debugger enhance] don't block gdbserver thread while executing (#989)
Allow to set break point again when all break points are removed and
wasm app starts running.
2022-02-16 17:35:35 +08:00
Xu JunandGitHub 5f8c7655a7 Fix pthread_getspecific return value (#999)
Fix pthread_getspecific return value as mentioned in #995
2022-02-05 22:45:59 +08:00
Xu JunandGitHub 68fd6454c2 Fix debug thread not created issue (#983)
And fix a double free issue when starting debug server failed
2022-01-26 09:56:01 +08:00
Xu JunandGitHub 90a0057d33 Implement pthread_cond_broadcast wrapper for lib-pthread (#982)
Implement pthread_cond_broadcast wrapper for lib-pthread
- support pthread_cond_broadcast wrapper for posix/linux-sgx/windows
- update document for building multi-thread wasm app with emcc
2022-01-25 09:28:02 +08:00
Xu JunandGitHub ee97e30a1a Fix pointer unchecked issue in thread-mgr.c (#960)
And refine the code format of thread_manager.h
2022-01-14 17:57:59 +08:00
Xu JunandGitHub 2c3f284b85 Add extern "C" in libc-builtin-sysroot pthread.h (#933)
Add extern "C" in libc-builtin-sysroot pthread.h to fix mulit-thread
wasm app compiling error with C++ compiler
2022-01-04 20:37:01 +08:00
Xu JunandGitHub ac3f7dcc0e Enable source debugger CI on windows and darwin (#912) 2021-12-24 16:57:23 +08:00
Xu JunandGitHub ccb2de35d7 Enable source debugging feature for windows platform (#910)
- use platform independent data types in debug-engine library
- add os_socket APIs and provide windows and posix implementation
- avoid using platform related header files in non-platform layer
- use format specifiers macros for sprintf and sscanf
- change thread handle type from uint64 to korp_tid
- add lock when sending socket packet to avoid thread racing
2021-12-22 19:52:07 +08:00
Xu JunandGitHub 4258b24bcc add lldb patch to attribution (#900) 2021-12-15 18:38:27 +08:00
Xu JunandGitHub 45ace31d2b fix definition of int64_t in libc-builtin-sysroot (#898) 2021-12-15 03:32:29 -06:00
Xu JunandGitHub b9fd8f916b update IoT cloud demo (#876)
* update IoT APP store demo

* update IoT app store apps

* update IoT cloud demo document

* [Cloud demo] mount app store between two dockers

* [Cloud demo] update restart policy

* [Cloud demo] update help page

* [Cloud demo] update online demo address
2021-12-07 20:19:23 +08:00
Xu JunandGitHub a06ede0de1 update source debugging document (#872) 2021-12-06 20:15:19 +08:00
Xu JunandGitHub 2af5ae5abb [source debug] refine some code in source debugging (#856)
- move the wait_cond from exec_env to debug_instance, so the debug thread can be waken up by any threads
- process more general query message from debugger
- refine debug instance create/destroy mechanism
- avoid creating debug instance during module instantiating
- avoid blocking execution thread during creating debug instance
- update related documents
2021-12-06 10:25:38 +08:00
Xu JunandGitHub 9b0b33e4ae fix duplicated debug instance id in multiple native thread issue (#847)
The debug_instance_list is not protected by mutex, and the debug instance uses
the length of this list as its id. If several threads create debug instance at the
same time, they may get duplicated/same ids. This patch adds mutex to protect
this list.
2021-11-25 12:15:37 +08:00
Xu JunandGitHub 703e724c99 [source debug] process ModuleInfo query message (#815) 2021-11-02 12:09:15 +08:00
Xu JunandGitHub 83df8600f7 Support random debug port by assigning port = 0 (#807)
Support random debug port by assigning port = 0,
and update help and document.
2021-10-30 02:44:41 -05:00
Xu JunandGitHub 164c3bff69 Fix lldb wasm patch to enable source debugging for windows (#806) 2021-10-27 21:26:53 +08:00
Xu JunandGitHub 0be1f687af Fix source debugging issues (#776)
- 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
2021-10-09 15:56:58 +08:00
Xu JunandGitHub f637438e4e Spread module custom data to all threads, enable libc-builtin float print (#633) 2021-05-19 14:57:31 +08:00
Xu JunandGitHub 684d766e2b Refine aot call func procedure and fix zephyr timer overflow issue (#617)
1. Refine the aot call function procedure

2. fix timer integer overflow issue on zephyr platform

3. move wasm_exec_env_set_thread_info into lower layer
2021-04-19 21:06:56 +08:00
Xu JunandGitHub 09eb858a02 add realloc wrapper, fix pthread_join overwrite issue (#605) 2021-04-09 15:27:12 +08:00
Xu JunandGitHub 22bcfe204e fix aux stack overwritten issue when lib-pthread is enabled (#596) 2021-04-01 15:07:00 +08:00
Xu JunandGitHub 621231a48b Create CI script for android platform (#591) 2021-03-24 18:05:23 +08:00
fc50404115 add uvwasi implementation to support wasi on windows [experimental] (#534)
add uvwasi implementation to support wasi on windows [experimental] and update windows.yml

Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
2021-02-22 14:17:46 +08:00
Xu JunandGitHub 370cc83fbd Fix loader fail to lookup registered native symbol issue (#529) 2021-02-19 11:14:40 +08:00
Xu JunandGitHub 52f422dba0 fix pthread library issues: (#522)
1. pthread_join can't get return value from exited threads
2. pthread_cond_wait return success when timeout
2021-02-09 10:36:44 +08:00
Xu JunandGitHub 5947ea492d Update invokeNative_em64.asm (#511)
Fix the issue of WIN64 parameter passing
2021-02-04 08:50:15 +08:00
Xu JunandGitHub a84d51271c Support AssemblyScript's new/retain/release APIs (#460) 2020-12-07 16:37:49 +08:00
Xu JunandGitHub b929ee3f71 Update windows build step, add CI support for windows (#420) 2020-10-13 12:13:18 +08:00
Xu JunandGitHub c87f28eacd support tail-call in AoT (#419) 2020-10-13 08:34:31 +08:00
Xu JunandGitHub c13746c22c move memory_data out from MemoryInstance, add call stack (#408) 2020-09-28 18:38:15 +08:00
Xu JunandGitHub 4bfcbc2cab fix problem about local in fast-interp (#406) 2020-09-27 18:05:20 +08:00
Xu JunandGitHub dc4b8c4822 remove errno in wasm_application_execute_func (#396) 2020-09-23 11:50:37 +08:00
Xu JunandGitHub 21850aeb0a add more build option and samples in CI (#394)
* Update linux.yml

* Create mac.yml
2020-09-20 13:16:13 +08:00
Xu JunandGitHub 0226dbbb3d introduce WAMR memory profiling tool (experimental) (#390) 2020-09-18 18:04:56 +08:00
Xu JunandGitHub 547298d4e7 Add macro to exclude sgx wasi/pthread ocalls if not needed (#384) 2020-09-15 15:49:09 +08:00
Xu JunandGitHub 2499e1ec4b Fix issue and compilation warnings of new function call APIs (#383) 2020-09-14 15:30:42 +08:00
Xu JunandGitHub 2135badc54 fix problem in wasm_module_malloc (#374) 2020-09-07 17:32:00 +08:00
Xu JunandGitHub 2e0cef3ef1 fix exec_env not checked issue, export __heap_base and __data_end in sample to decrease memory usage (#371) 2020-09-05 14:48:08 +08:00
Xu JunandGitHub e113298d7f use llvm release 10.x (#365) 2020-09-01 16:00:15 +08:00
Xu JunandGitHub 6b5f376e79 fix issue in mini-loader (#353) 2020-08-14 19:58:19 +08:00
Xu JunandGitHub 1266ebb222 fix coding style for windows build patch (#350) 2020-08-13 16:40:19 +08:00
Xu JunandGitHub 21efe12505 add win64 support (#348) 2020-08-13 14:41:20 +08:00
Xu JunandGitHub 6aeefbebb2 implement atomics opcodes for interpreter (#344) 2020-08-10 19:43:58 +08:00
Xu JunandGitHub 2db335c6d4 add spawn thread API and sample (#333) 2020-08-04 17:40:45 +08:00
Xu JunandGitHub 29e45e1527 implement atomic opcode in AOT/JIT (#329) 2020-08-03 11:30:26 +08:00
Xu JunandGitHub 32b2943369 enable pthread for AoT && update AOT current version to 2 (#311) 2020-07-16 20:35:04 +08:00
Xu JunandGitHub e3c04e6684 support pthread_key related APIs (#288) 2020-06-18 11:37:31 +08:00
Xu JunandGitHub acb68c64c2 update doc for multi-thread (#284) 2020-06-16 15:01:35 +08:00
Xu JunandGitHub d98ab63e5c Enable shared memory && add pthread support (#282) 2020-06-15 19:04:04 +08:00
Xu JunandGitHub 5e196253f6 Fix function type not set issue of aot_call_indirect (#229)
Add registration of libc-wasi to 'wasi_snapshot_preview1' to support cargo-wasi
change zephyr build method from cmake to west
fix problem when preserve space for local vars
fix wasi authority problem
2020-04-07 11:04:46 +08:00
Xu JunandGitHub d9890d2ccb re-org ems mem allocator source codes, update prot_wamr.md (#217) 2020-03-30 11:06:39 +08:00
31feaa0a88 change printf to puts in assemblyscript to match the signature (#215)
Co-authored-by: Xu Jun <jun1.xu@intel.com>
2020-03-27 16:51:15 +08:00
75009a2421 fix sgx compile and link error, preserve space for locals before set/tee opcode (#214)
Co-authored-by: Xu Jun <jun1.xu@intel.com>
2020-03-27 09:28:30 +08:00
Xu JunandGitHub 8ae161b779 fix vprintf in android platform, avoid importing abort in assemblyscript (#210) 2020-03-23 22:30:28 +08:00
6523868a9a fix aot load import global bug && enhance dead code processing (#203)
Co-authored-by: Xu Jun <jun1.xu@intel.com>
2020-03-17 17:51:51 +08:00
f1a0e75ab7 re-org platform APIs, simplify porting process (#201)
Co-authored-by: Xu Jun <jun1.xu@intel.com>
2020-03-16 16:43:57 +08:00
Xu JunandGitHub 381859d530 fix unaligned 64bit access on MCU (#192) 2020-03-10 11:48:28 +08:00
057c849fc0 re-org bh_definition.c && introduce wamr fast interpreter (#189)
Co-authored-by: Xu Jun
2020-03-07 22:20:38 +08:00
Xu Jun ccdba48d30 update menuconfig.sh 2020-02-21 23:03:58 +08:00
Xu JunandGitHub 5a10651dd0 support app framework base library in assemblyscript (#164) 2020-02-13 15:51:22 +08:00