Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in CI config and suppress STORE_U8 in TSAN #2802

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nightly_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ jobs:

- name: run tests
timeout-minutes: 40
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }} -T %{{matrix.sanitizer}}
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }} -T "${{ matrix.sanitizer }}"
working-directory: ./tests/wamr-test-suites

#only install x32 support libraries when to run x86_32 cases
Expand Down
13 changes: 13 additions & 0 deletions core/iwasm/common/wasm_runtime_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ STORE_U16(void *addr, uint16_t value)
{
*(uint16_t *)(addr) = (uint16_t)(value);
}
static inline void
STORE_U8(void *addr, uint8_t value)
{
*(uint8 *)addr = value;
}

/* For LOAD opcodes */
#define LOAD_I64(addr) (*(int64 *)(addr))
#define LOAD_F64(addr) (*(float64 *)(addr))
Expand Down Expand Up @@ -173,6 +179,13 @@ STORE_U32(void *addr, uint32_t value)
}
}
}

static inline void
STORE_U8(void *addr, uint8_t value)
{
*(uint8 *)addr = value;
}

static inline void
STORE_U16(void *addr, uint16_t value)
{
Expand Down
4 changes: 2 additions & 2 deletions core/iwasm/interpreter/wasm_interp_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
frame_ip += 2;
addr_ret = GET_OFFSET();
CHECK_MEMORY_OVERFLOW(1);
frame_lp[addr_ret] = (uint32)(*(uint8 *)maddr);
frame_lp[addr_ret] = (uint32)(*(uint8 *)(maddr));
HANDLE_OP_END();
}

Expand Down Expand Up @@ -1817,7 +1817,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
addr = GET_OPERAND(uint32, I32, 2);
frame_ip += 4;
CHECK_MEMORY_OVERFLOW(1);
*(uint8 *)maddr = (uint8)sval;
STORE_U8(maddr, (uint8_t)sval);
wenyongh marked this conversation as resolved.
Show resolved Hide resolved
HANDLE_OP_END();
}

Expand Down
1 change: 1 addition & 0 deletions tests/wamr-test-suites/tsan_suppressions.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Proposing to accept this risk for now. It might be wasi-libc related.
# https://github.com/bytecodealliance/wasm-micro-runtime/pull/1963#issuecomment-1455342931
race:STORE_U32
race:STORE_U8

# Suppressing signal-unsafe inside of a signal for AOT mode
# see https://github.com/bytecodealliance/wasm-micro-runtime/issues/2248#issuecomment-1630189656
Expand Down
Loading