Skip to content

[mimalloc] Error on mimalloc + ASan #23314

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

Merged
merged 5 commits into from
Jan 7, 2025
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
4 changes: 0 additions & 4 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8909,10 +8909,6 @@ def test_asan_no_error(self, name):
'vector': ('test_asan_vector.cpp', [
'AddressSanitizer: container-overflow on address'
]),
# some coverage for mimalloc as well
'use_after_free_c_mimalloc': ('test_asan_use_after_free.c', [
'AddressSanitizer: heap-use-after-free on address',
], ['-sMALLOC=mimalloc']),
})
def test_asan(self, name, expected_output, cflags=None):
if '-Oz' in self.emcc_args:
Expand Down
5 changes: 5 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -15214,6 +15214,11 @@ def test_wasm64_no_asan(self):
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sMEMORY64', '-fsanitize=address'])
self.assertContained('error: MEMORY64 does not yet work with ASAN', err)

def test_mimalloc_no_asan(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other mimalloc tests that this can be grouped with?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I grouped this with the other asan test right above, which it is parallel to?

# See https://github.com/emscripten-core/emscripten/issues/23288#issuecomment-2571648258
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sMALLOC=mimalloc', '-fsanitize=address'])
self.assertContained('error: mimalloc is not compatible with -fsanitize=address', err)

@crossplatform
def test_js_preprocess_pre_post(self):
create_file('pre.js', '''
Expand Down
3 changes: 3 additions & 0 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2369,6 +2369,9 @@ def add_sanitizer_libs():
add_library('libc')
if settings.MALLOC == 'mimalloc':
add_library('libmimalloc')
if settings.USE_ASAN:
# See https://github.com/emscripten-core/emscripten/issues/23288#issuecomment-2571648258
shared.exit_with_error('mimalloc is not compatible with -fsanitize=address')
elif settings.MALLOC != 'none':
add_library('libmalloc')
add_library('libcompiler_rt')
Expand Down
Loading