bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.92k stars 624 forks source link

Data race, fast interpreter, parallel gzip #3085

Open g0djan opened 9 months ago

g0djan commented 9 months ago

Hi, I cloned yesterday https://github.com/bytecodealliance/wasm-parallel-gzip/tree/main, updated WAMR version to latest main

and changed NUM_THREADS in Makefile from 1 to 2

godjan@ud6d5de19674f5f:~/github/wasm-parallel-gzip$ make benchmark.wamr 
time wasm-micro-runtime/src/build/iwasm --max-threads=3 --dir=. pigz/pigz.wasm -p 2 /random.bin
==================
WARNING: ThreadSanitizer: data race (pid=1681412)
  Write of size 4 at 0x7f5d1942821c by main thread (mutexes: write M1):
    #0 STORE_U32 /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 (iwasm+0x47a4c)
    #1 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:3506 (iwasm+0x47a4c)
    #2 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:4046 (iwasm+0x4a72c)
    #3 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164a8)
    #4 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170a4)
    #5 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x115f1)
    #6 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3cd)
    #7 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3cd)
    #8 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7c1)
    #9 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7c1)

  Previous read of size 4 at 0x7f5d1942821c by thread T1:
    #0 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:1665 (iwasm+0x458f8)
    #1 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:4046 (iwasm+0x4a72c)
    #2 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164a8)
    #3 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170a4)
    #4 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x115f1)
    #5 thread_start /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:60 (iwasm+0x629db)
    #6 thread_manager_start_routine /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:639 (iwasm+0x27621)
    #7 os_thread_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:46 (iwasm+0xdd52)

  Mutex M1 (0x55be5cd91880) created at:
    #0 pthread_mutex_init ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1227 (libtsan.so.0+0x4bee1)
    #1 os_mutex_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:113 (iwasm+0xd1f0)
    #2 wasm_shared_memory_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_shared_memory.c:58 (iwasm+0x15782)
    #3 wasm_runtime_env_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:447 (iwasm+0x13897)
    #4 wasm_runtime_env_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:427 (iwasm+0x13897)
    #5 wasm_runtime_full_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:680 (iwasm+0x13897)
    #6 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:840 (iwasm+0xafb3)

  Thread T1 (tid=1681414, running) created by main thread at:
    #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
    #1 os_thread_create_with_prio /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:86 (iwasm+0xd0b8)
    #2 os_thread_create /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:100 (iwasm+0xd188)
    #3 wasm_cluster_create_thread /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:744 (iwasm+0x27a16)
    #4 thread_spawn_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:122 (iwasm+0x62878)
    #5 <null> <null> (iwasm+0x16105)
    #6 wasm_interp_call_func_native /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:973 (iwasm+0x40ab1)
    #7 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:3849 (iwasm+0x43f15)
    #8 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:4046 (iwasm+0x4a72c)
    #9 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164a8)
    #10 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170a4)
    #11 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x115f1)
    #12 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3cd)
    #13 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3cd)
    #14 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7c1)
    #15 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7c1)

SUMMARY: ThreadSanitizer: data race /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 in STORE_U32
==================
==================
WARNING: ThreadSanitizer: data race (pid=1681412)
  Read of size 4 at 0x7f5d19428074 by main thread:
    #0 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:1665 (iwasm+0x458f8)
    #1 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:4046 (iwasm+0x4a72c)
    #2 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164a8)
    #3 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170a4)
    #4 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x115f1)
    #5 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3cd)
    #6 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3cd)
    #7 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7c1)
    #8 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7c1)

  Previous write of size 4 at 0x7f5d19428074 by thread T2:
    #0 STORE_U32 /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 (iwasm+0x45201)
    #1 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:1813 (iwasm+0x45201)
    #2 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:4046 (iwasm+0x4a72c)
    #3 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164a8)
    #4 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170a4)
    #5 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x115f1)
    #6 thread_start /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:60 (iwasm+0x629db)
    #7 thread_manager_start_routine /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:639 (iwasm+0x27621)
    #8 os_thread_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:46 (iwasm+0xdd52)

  Thread T2 (tid=1681415, running) created by main thread at:
    #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
    #1 os_thread_create_with_prio /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:86 (iwasm+0xd0b8)
    #2 os_thread_create /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:100 (iwasm+0xd188)
    #3 wasm_cluster_create_thread /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:744 (iwasm+0x27a16)
    #4 thread_spawn_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:122 (iwasm+0x62878)
    #5 <null> <null> (iwasm+0x16105)
    #6 wasm_interp_call_func_native /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:973 (iwasm+0x40ab1)
    #7 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:3849 (iwasm+0x43f15)
    #8 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:4046 (iwasm+0x4a72c)
    #9 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164a8)
    #10 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170a4)
    #11 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x115f1)
    #12 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3cd)
    #13 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3cd)
    #14 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7c1)
    #15 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7c1)

SUMMARY: ThreadSanitizer: data race /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_fast.c:1665 in wasm_interp_call_func_bytecode
==================
g0djan commented 9 months ago

also classic interpreter

time wasm-micro-runtime/src/build/iwasm --max-threads=3 --dir=. pigz/pigz.wasm -p 2 /random.bin
==================
WARNING: ThreadSanitizer: data race (pid=2216070)
  Write of size 4 at 0x7fca1e828074 by thread T1:
    #0 STORE_U32 /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 (iwasm+0x40a25)
    #1 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:2049 (iwasm+0x40a25)
    #2 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #3 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #4 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #5 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #6 thread_start /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:60 (iwasm+0x5914b)
    #7 thread_manager_start_routine /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:639 (iwasm+0x27641)
    #8 os_thread_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:46 (iwasm+0xdd32)

  Previous read of size 4 at 0x7fca1e828074 by main thread:
    #0 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:1876 (iwasm+0x40b42)
    #1 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #2 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #3 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #4 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #5 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3ad)
    #6 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3ad)
    #7 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7a1)
    #8 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7a1)

  Thread T1 (tid=2216074, running) created by main thread at:
    #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
    #1 os_thread_create_with_prio /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:86 (iwasm+0xd098)
    #2 os_thread_create /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:100 (iwasm+0xd168)
    #3 wasm_cluster_create_thread /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:744 (iwasm+0x27a36)
    #4 thread_spawn_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:122 (iwasm+0x58fe8)
    #5 <null> <null> (iwasm+0x16145)
    #6 wasm_interp_call_func_native /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:938 (iwasm+0x402cc)
    #7 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:3913 (iwasm+0x441d2)
    #8 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #9 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #10 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #11 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #12 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3ad)
    #13 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3ad)
    #14 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7a1)
    #15 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7a1)

SUMMARY: ThreadSanitizer: data race /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 in STORE_U32
==================
==================
WARNING: ThreadSanitizer: data race (pid=2216070)
  Write of size 4 at 0x7fca1e82821c by thread T1 (mutexes: write M1):
    #0 STORE_U32 /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 (iwasm+0x46e9b)
    #1 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:3668 (iwasm+0x46e9b)
    #2 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #3 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #4 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #5 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #6 thread_start /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:60 (iwasm+0x5914b)
    #7 thread_manager_start_routine /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:639 (iwasm+0x27641)
    #8 os_thread_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:46 (iwasm+0xdd32)

  Previous read of size 4 at 0x7fca1e82821c by main thread:
    #0 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:1876 (iwasm+0x40b42)
    #1 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #2 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #3 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #4 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #5 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3ad)
    #6 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3ad)
    #7 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7a1)
    #8 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7a1)

  Mutex M1 (0x55c717e18080) created at:
    #0 pthread_mutex_init ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1227 (libtsan.so.0+0x4bee1)
    #1 os_mutex_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:113 (iwasm+0xd1d0)
    #2 wasm_shared_memory_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_shared_memory.c:58 (iwasm+0x157c2)
    #3 wasm_runtime_env_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:447 (iwasm+0x138d7)
    #4 wasm_runtime_env_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:427 (iwasm+0x138d7)
    #5 wasm_runtime_full_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:680 (iwasm+0x138d7)
    #6 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:840 (iwasm+0xaf93)

  Thread T1 (tid=2216074, running) created by main thread at:
    #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
    #1 os_thread_create_with_prio /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:86 (iwasm+0xd098)
    #2 os_thread_create /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:100 (iwasm+0xd168)
    #3 wasm_cluster_create_thread /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:744 (iwasm+0x27a36)
    #4 thread_spawn_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:122 (iwasm+0x58fe8)
    #5 <null> <null> (iwasm+0x16145)
    #6 wasm_interp_call_func_native /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:938 (iwasm+0x402cc)
    #7 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:3913 (iwasm+0x441d2)
    #8 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #9 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #10 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #11 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #12 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3ad)
    #13 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3ad)
    #14 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7a1)
    #15 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7a1)

SUMMARY: ThreadSanitizer: data race /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 in STORE_U32
==================
==================
WARNING: ThreadSanitizer: data race (pid=2216070)
  Write of size 4 at 0x7fca1e838c04 by thread T3 (mutexes: write M1):
    #0 STORE_U32 /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 (iwasm+0x49b23)
    #1 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:3720 (iwasm+0x49b23)
    #2 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #3 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #4 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #5 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #6 thread_start /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:60 (iwasm+0x5914b)
    #7 thread_manager_start_routine /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:639 (iwasm+0x27641)
    #8 os_thread_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:46 (iwasm+0xdd32)

  Previous read of size 4 at 0x7fca1e838c04 by main thread:
    #0 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:1876 (iwasm+0x40b42)
    #1 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #2 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #3 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #4 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #5 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3ad)
    #6 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3ad)
    #7 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7a1)
    #8 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7a1)

  Mutex M1 (0x55c717e18080) created at:
    #0 pthread_mutex_init ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:1227 (libtsan.so.0+0x4bee1)
    #1 os_mutex_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:113 (iwasm+0xd1d0)
    #2 wasm_shared_memory_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_shared_memory.c:58 (iwasm+0x157c2)
    #3 wasm_runtime_env_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:447 (iwasm+0x138d7)
    #4 wasm_runtime_env_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:427 (iwasm+0x138d7)
    #5 wasm_runtime_full_init /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:680 (iwasm+0x138d7)
    #6 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:840 (iwasm+0xaf93)

  Thread T3 (tid=2216076, running) created by main thread at:
    #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8)
    #1 os_thread_create_with_prio /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:86 (iwasm+0xd098)
    #2 os_thread_create /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/shared/platform/common/posix/posix_thread.c:100 (iwasm+0xd168)
    #3 wasm_cluster_create_thread /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/thread-mgr/thread_manager.c:744 (iwasm+0x27a36)
    #4 thread_spawn_wrapper /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/libraries/lib-wasi-threads/lib_wasi_threads_wrapper.c:122 (iwasm+0x58fe8)
    #5 <null> <null> (iwasm+0x16145)
    #6 wasm_interp_call_func_native /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:938 (iwasm+0x402cc)
    #7 wasm_interp_call_func_bytecode /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:3913 (iwasm+0x441d2)
    #8 wasm_interp_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_interp_classic.c:4353 (iwasm+0x4a760)
    #9 call_wasm_with_hw_bound_check /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2319 (iwasm+0x164e8)
    #10 wasm_call_function /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/wasm_runtime.c:2391 (iwasm+0x170e4)
    #11 wasm_runtime_call_wasm /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_runtime_common.c:2083 (iwasm+0x11631)
    #12 execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:112 (iwasm+0xe3ad)
    #13 wasm_application_execute_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/common/wasm_application.c:238 (iwasm+0xe3ad)
    #14 app_instance_main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:115 (iwasm+0xb7a1)
    #15 main /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/product-mini/platforms/linux/../posix/main.c:955 (iwasm+0xb7a1)

SUMMARY: ThreadSanitizer: data race /home/ANT.AMAZON.COM/godjan/github/wasm-parallel-gzip/wasm-micro-runtime/src/core/iwasm/interpreter/../common/wasm_runtime_common.h:50 in STORE_U32
==================