Skip to content

Commit 96a832c

Browse files
authored
Fix lsan false positive in emscripten_malloc_wasm_worker. NFC (#19520)
This function never frees is memory so we don't want to consider the memory allocated here a memory leak. This fixes a failure of the `asan.test_wasm_worker_hello` test which started failing after the recent compiler-rt update in #19506.
1 parent 2a30ef6 commit 96a832c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ jobs:
469469
asan.test_dlfcn_basic
470470
asan.test_async_hello_stack_switching
471471
asan.test_cubescript
472+
asan.test_wasm_worker_hello
472473
lsan.test_stdio_locking
473474
lsan.test_dlfcn_basic
474475
lsan.test_pthread_create"

system/lib/wasm_worker/library_wasm_worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ emscripten_wasm_worker_t emscripten_malloc_wasm_worker(size_t stackSize)
5757
// Add the TLS size to the provided stackSize so that the allocation
5858
// will always be large enough to hold the worker TLS data.
5959
stackSize += ROUND_UP(__builtin_wasm_tls_size(), 16);
60-
return emscripten_create_wasm_worker(memalign(16, stackSize), stackSize);
60+
return emscripten_create_wasm_worker(emscripten_builtin_memalign(16, stackSize), stackSize);
6161
}
6262

6363
void emscripten_wasm_worker_sleep(int64_t nsecs)

0 commit comments

Comments
 (0)