Skip to content

Commit 02e8bf5

Browse files
committed
Disallow -sWASM_WORKERS with sanitizers
Back in emscripten-core#21701 I broke move the creation of wasmOffsetConvert and wasmOffset into runtime_pthread.js but I didn't update libwasm_worker.js which still uses the old name `wasmOffsetData` in its initial post message. When trying to update this just now I noticed that the offset converter (and santiizers in general) don't seem to work on WASM_WORKERS so this change simply disables them.
1 parent cadac51 commit 02e8bf5

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,6 @@ jobs:
546546
asan.test_dlfcn_basic
547547
asan.test_async_hello_jspi
548548
asan.test_cubescript
549-
asan.test_wasm_worker_hello
550549
asan.test_externref_emjs_dynlink
551550
asan.test_asyncify_longjmp
552551
asan.test_pthread_run_on_main_thread

src/lib/libwasm_worker.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,6 @@ if (ENVIRONMENT_IS_WASM_WORKER
204204
#endif
205205
'sb': stackLowestAddress, // sb = stack bottom (lowest stack address, SP points at this when stack is full)
206206
'sz': stackSize, // sz = stack size
207-
#if USE_OFFSET_CONVERTER
208-
'wasmOffsetData': wasmOffsetConverter,
209-
#endif
210-
#if LOAD_SOURCE_MAP
211-
'wasmSourceMapData': wasmSourceMap,
212-
#endif
213207
});
214208
worker.onmessage = _wasmWorkerRunPostMessage;
215209
#if ENVIRONMENT_MAY_BE_NODE

test/test_core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ def test_longjmp_standalone(self):
886886
def test_longjmp(self):
887887
self.do_core_test('test_longjmp.c')
888888

889+
@no_asan('ASan does not support WASM_WORKERS')
889890
def test_longjmp_wasm_workers(self):
890891
self.do_core_test('test_longjmp.c', emcc_args=['-sWASM_WORKERS'])
891892

@@ -9566,14 +9567,17 @@ def test_emscripten_async_load_script(self):
95669567
self.do_runf('test_emscripten_async_load_script.c', emcc_args=['-sFORCE_FILESYSTEM'])
95679568

95689569
@node_pthreads
9570+
@no_asan('ASan does not support WASM_WORKERS')
95699571
def test_wasm_worker_hello(self):
95709572
self.do_run_in_out_file_test('wasm_worker/hello_wasm_worker.c', emcc_args=['-sWASM_WORKERS'])
95719573

95729574
@node_pthreads
9575+
@no_asan('ASan does not support WASM_WORKERS')
95739576
def test_wasm_worker_malloc(self):
95749577
self.do_run_in_out_file_test('wasm_worker/malloc_wasm_worker.c', emcc_args=['-sWASM_WORKERS'])
95759578

95769579
@node_pthreads
9580+
@no_asan('ASan does not support WASM_WORKERS')
95779581
def test_wasm_worker_wait_async(self):
95789582
self.do_runf('atomic/test_wait_async.c', emcc_args=['-sWASM_WORKERS'])
95799583

tools/link.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,8 @@ def limit_incoming_module_api():
15561556
diagnostics.warning('emcc', 'output suffix .js requested, but wasm side modules are just wasm files; emitting only a .wasm, no .js')
15571557

15581558
if options.sanitize:
1559+
if settings.WASM_WORKERS:
1560+
exit_with_error('WASM_WORKERS is not currently compatible with `-fsanitize` tools')
15591561
settings.USE_OFFSET_CONVERTER = 1
15601562
# These symbols are needed by `withBuiltinMalloc` which used to implement
15611563
# the `__noleakcheck` attribute. However this dependency is not yet represented in the JS

0 commit comments

Comments
 (0)