wasm-micro-runtime
wasm-micro-runtime copied to clipboard
Android mult-thread pthread_exit crash
I am debugging the casehello_world.wasm.zip on Android.
I instantiated the wasm module. I called the function _start
. It will create 10 threads.
After wasm_func_call
executed successfully,pthread_exit
crashed.
what is the value of maximum number of threads?
12
I run it ok on MacOS and iOS.
In that case, I would suggest setting max_thread_num
of RuntimeInitArgs
to a larger number, like 12 or 15, then using wasm_runtime_full_init()
to start everything.
In that case, I would suggest setting
max_thread_num
ofRuntimeInitArgs
to a larger number, like 12 or 15, then usingwasm_runtime_full_init()
to start everything.
I had set CLUSTER_MAX_THREAD_NUM
to 12. And MacOS and iOS is rightly. Are there other points?
iwasm works well with the hello_world.wasm on my local environment. Could u try it, with iwasm, on MacOS?
$ ./iwasm --max-threads=20 ./hello_world.wasm
in thread 4
in thread 7
in thread 6
in thread 2
in thread 3
in thread 9
in thread 5
in thread 0
in thread 8
in thread 1
iwasm works well with the hello_world.wasm on my local environment. Could u try it, with iwasm, on MacOS?
$ ./iwasm --max-threads=20 ./hello_world.wasm in thread 4 in thread 7 in thread 6 in thread 2 in thread 3 in thread 9 in thread 5 in thread 0 in thread 8 in thread 1
I had set
CLUSTER_MAX_THREAD_NUM
to 12. And MacOS and iOS is rightly. Are there other points?
I had try it on MacOS, it is OK. It only happen on Android. And it must happen.
I had try it on MacOS, it is OK. It only happen on Android. And it must happen.
When reproduce it on Android, using iwasm or your local, self compiled, wamr library?
I had try it on MacOS, it is OK. It only happen on Android. And it must happen.
When reproduce it on Android, using iwasm or your local, self compiled, wamr library?
Compile locally to .so
with cmake
Since I can't reproduce it locally, here are some BKMs of the team, hope useful:
- Don't mix using
WAMR_BUILD_LIB_PTHREAD
andWAMR_BUILD_LIB_PTHREAD
together - With the help of valgrind and sanitizers(
WAMR_BUILD_SANITIZER
) - Shrink the problem by break something. For example:
- try variant thread numbers
- try variant compilation options, like BOUND_CHECK
- comment
wasm_deinstantiate()
- comment
wasm_unload()
- ...
Since I can't reproduce it locally, here are some BKMs of the team, hope useful:
Get it. Thanks!