File tree Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,7 @@ LibraryManager.library = {
448
448
// TODO: There are currently two abort() functions that get imported to asm module scope: the built-in runtime function abort(),
449
449
// and this function _abort(). Remove one of these, importing two functions for the same purpose is wasteful.
450
450
abort__sig : 'v ',
451
+ abort__proxy : 'sync ',
451
452
abort : function ( ) {
452
453
#if MINIMAL_RUNTIME
453
454
// In MINIMAL_RUNTIME the module object does not exist, so its behavior to abort is to throw directly.
Original file line number Diff line number Diff line change @@ -595,7 +595,7 @@ function abort(what) {
595
595
#endif
596
596
597
597
#if USE_PTHREADS
598
- if ( ENVIRONMENT_IS_PTHREAD ) console . error ( 'Pthread aborting at ' + new Error ( ) . stack ) ;
598
+ assert ( ! ENVIRONMENT_IS_PTHREAD ) ;
599
599
#endif
600
600
what += '';
601
601
err ( what ) ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2021 The Emscripten Authors. All rights reserved.
2
+ // Emscripten is available under two separate licenses, the MIT license and the
3
+ // University of Illinois/NCSA Open Source License. Both these licenses can be
4
+ // found in the LICENSE file.
5
+
6
+ #include <stdio.h>
7
+ #include <stdlib.h>
8
+
9
+ int main () {
10
+ abort ();
11
+ __builtin_unreachable ();
12
+ }
Original file line number Diff line number Diff line change
1
+ onAbort called
Original file line number Diff line number Diff line change @@ -2338,6 +2338,12 @@ def test_pthread_setspecific_mainthread(self):
2338
2338
self .set_setting ('EXIT_RUNTIME' )
2339
2339
self .do_run_in_out_file_test ('pthread/test_pthread_setspecific_mainthread.c' )
2340
2340
2341
+ @node_pthreads
2342
+ def test_pthread_abort (self ):
2343
+ self .set_setting ('PROXY_TO_PTHREAD' )
2344
+ self .add_pre_run ("Module.onAbort = function() { console.log('onAbort called'); }" )
2345
+ self .do_run_in_out_file_test ('pthread/test_pthread_abort.c' , assert_returncode = NON_ZERO )
2346
+
2341
2347
def test_tcgetattr (self ):
2342
2348
self .do_runf (test_file ('termios/test_tcgetattr.c' ), 'success' )
2343
2349
You can’t perform that action at this time.
0 commit comments