Skip to content
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ jobs:
wasmfs.test_fs_llseek_rawfs
wasmfs.test_freetype
minimal0.test_utf
minimal0.test_stack_overflow
omitexports0.test_asyncify_longjmp
strict.test_no_declare_asm_module_exports
"
Expand Down
28 changes: 14 additions & 14 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2815,7 +2815,7 @@ def test_bsearch(self):

def test_stack_overflow(self):
self.set_setting('ASSERTIONS', 2)
self.do_runf('core/stack_overflow.c', 'Aborted(stack overflow', assert_returncode=NON_ZERO)
self.do_runf('core/stack_overflow.c', 'stack overflow', assert_returncode=NON_ZERO)

def test_stackAlloc(self):
self.do_core_test('test_stackAlloc.c')
Expand Down Expand Up @@ -7259,7 +7259,7 @@ def test(expected, args=None, assert_returncode=0):
test('ALLOC_STACK is not defined', args=['-DDIRECT'], assert_returncode=NON_ZERO)

# When assertions are enabled direct and indirect usage both abort with a useful error message.
not_exported = "Aborted('ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ))"
not_exported = "'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)"
not_included = "`ALLOC_STACK` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$ALLOC_STACK')"
self.set_setting('ASSERTIONS')
test(not_exported, assert_returncode=NON_ZERO)
Expand Down Expand Up @@ -8691,15 +8691,15 @@ def test_fs_dict_none(self):
def test_stack_overflow_check(self):
self.set_setting('STACK_SIZE', 1048576)
self.set_setting('STACK_OVERFLOW_CHECK', 2)
self.do_runf('stack_overflow.cpp', 'Aborted(stack overflow', assert_returncode=NON_ZERO)
self.do_runf('stack_overflow.cpp', 'stack overflow', assert_returncode=NON_ZERO)

self.cflags += ['-DONE_BIG_STRING']
self.do_runf('stack_overflow.cpp', 'Aborted(stack overflow', assert_returncode=NON_ZERO)
self.do_runf('stack_overflow.cpp', 'stack overflow', assert_returncode=NON_ZERO)

# ASSERTIONS=2 implies STACK_OVERFLOW_CHECK=2
self.clear_setting('STACK_OVERFLOW_CHECK')
self.set_setting('ASSERTIONS', 2)
self.do_runf('stack_overflow.cpp', 'Aborted(stack overflow', assert_returncode=NON_ZERO)
self.do_runf('stack_overflow.cpp', 'stack overflow', assert_returncode=NON_ZERO)

@node_pthreads
def test_binaryen_2170_emscripten_atomic_cas_u8(self):
Expand Down Expand Up @@ -9140,9 +9140,9 @@ def test_safe_stack(self):
self.set_setting('STACK_OVERFLOW_CHECK', 2)
self.set_setting('STACK_SIZE', 1024)
if self.is_optimizing():
expected = [r'Aborted\(stack overflow \(Attempt to set SP to 0x[0-9a-fA-F]+, with stack limits \[0x[0-9a-fA-F]+ - 0x[0-9a-fA-F]+\]\)']
expected = [r'stack overflow \(Attempt to set SP to 0x[0-9a-fA-F]+, with stack limits \[0x[0-9a-fA-F]+ - 0x[0-9a-fA-F]+\]\)']
else:
expected = [r'Aborted\(stack overflow \(Attempt to set SP to 0x[0-9a-fA-F]+, with stack limits \[0x[0-9a-fA-F]+ - 0x[0-9a-fA-F]+\]\)',
expected = [r'stack overflow \(Attempt to set SP to 0x[0-9a-fA-F]+, with stack limits \[0x[0-9a-fA-F]+ - 0x[0-9a-fA-F]+\]\)',
'__handle_stack_overflow']
self.do_runf('core/test_safe_stack.c',
expected_output=expected,
Expand All @@ -9157,9 +9157,9 @@ def test_safe_stack_pthread(self):
self.set_setting('PROXY_TO_PTHREAD')
self.cflags.append('-pthread')
if self.is_optimizing():
expected = ['Aborted(stack overflow']
expected = ['stack overflow']
else:
expected = ['Aborted(stack overflow', '__handle_stack_overflow']
expected = ['stack overflow', '__handle_stack_overflow']
self.do_runf('core/test_safe_stack.c',
expected_output=expected,
assert_returncode=NON_ZERO, assert_all=True)
Expand All @@ -9168,9 +9168,9 @@ def test_safe_stack_alloca(self):
self.set_setting('STACK_OVERFLOW_CHECK', 2)
self.set_setting('STACK_SIZE', 65536)
if self.is_optimizing():
expected = ['Aborted(stack overflow']
expected = ['stack overflow']
else:
expected = ['Aborted(stack overflow', '__handle_stack_overflow']
expected = ['stack overflow', '__handle_stack_overflow']
self.do_runf('core/test_safe_stack_alloca.c',
expected_output=expected,
assert_returncode=NON_ZERO, assert_all=True)
Expand Down Expand Up @@ -9201,7 +9201,7 @@ def test_safe_stack_dylink(self):
void sidey() {
f(NULL);
}
''', ['Aborted(stack overflow', '__handle_stack_overflow'], assert_returncode=NON_ZERO, force_c=True)
''', ['stack overflow', '__handle_stack_overflow'], assert_returncode=NON_ZERO, force_c=True)

def test_fpic_static(self):
self.cflags.append('-fPIC')
Expand Down Expand Up @@ -9450,7 +9450,7 @@ def test_pthread_dlsym(self):
@node_pthreads
def test_pthread_dylink_tls(self):
if '-O2' in self.cflags and self.get_setting('STACK_OVERFLOW_CHECK') == 2:
self.skipTest('https://github.com/emscripten-core/emscripten/issues/24964: fails with Aborted(stack overflow (Attempt to set SP to 0x000114d0, with stack limits [0x00000000 - 0x00000000])')
self.skipTest('https://github.com/emscripten-core/emscripten/issues/24964: fails with stack overflow (Attempt to set SP to 0x000114d0, with stack limits [0x00000000 - 0x00000000])')

self.cflags += ['-Wno-experimental', '-pthread']
main = test_file('core/pthread/test_pthread_dylink_tls.c')
Expand Down Expand Up @@ -9731,7 +9731,7 @@ def test_promise_await(self):

def test_promise_await_error(self):
# Check that the API is not available when ASYNCIFY is not set
self.do_runf('core/test_promise_await.c', 'Aborted(emscripten_promise_await is only available with ASYNCIFY)',
self.do_runf('core/test_promise_await.c', 'emscripten_promise_await is only available with ASYNCIFY',
assert_returncode=NON_ZERO)

@no_modularize_instance('uses Module object directly')
Expand Down