Bug 45107 - Opening many sockets on OSX gives hard crash with message: poll_event_wait: mono_poll () failed, error (22) Invalid argument
Summary: Opening many sockets on OSX gives hard crash with message: poll_event_wait: m...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer (show other bugs)
Version: 4.6.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-06 12:06 UTC by Kenneth
Modified: 2017-06-30 10:47 UTC (History)
4 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Output from running the sample program tester against a local HTTP server (1.20 KB, text/plain)
2016-10-06 12:06 UTC, Kenneth
Details

Description Kenneth 2016-10-06 12:06:26 UTC
Created attachment 17903 [details]
Output from running the sample program tester against a local HTTP server

When writing a basic HTTP load tester, I discovered this bug.
I can reproduce consistently on OSX (10.11.6) with Mono 4.6.1.

The crash log is below, and a sample program to trigger the error is included as an attachment.
The program will hard-crash on OSX, even if there is nothing listening on localhost:8900.

I also tested the same code on Ubuntu 14.04.4 with Mono 4.4.0, which does not have the problem, suggesting that it is an OSX/macOS specific issue.

My best guess is that the process runs out of available sockets to monitor, and the counter overflows.
The crash happens if COUNT is set to 1800 or more in the attached script.

uname- a reports 4864 open files, so it should not be directly related to open file descriptiors, but rather the non-blocking socket access.


Output/crash-log:

Loaded assembly: /Users/username/Udvikler/HttpLoadTester/bin/Debug/HttpLoadTester.exe
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/4.6.1/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll [External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/4.6.1/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll [External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/4.6.1/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll [External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/4.6.1/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll [External]
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/4.6.1/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll [External]
Thread started: <Thread Pool> #2
Thread started: <Thread Pool> #3
Thread started: <Thread Pool> #4
Thread started: <Thread Pool> #5
Thread started: <Thread Pool> #6
Thread started: <Thread Pool> #7
Thread started: <Thread Pool> #8
Thread started: <Thread Pool> #9
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started:  #13
Thread started: <Thread Pool> #14
poll_event_wait: mono_poll () failed, error (22) Invalid argument
Stacktrace:


Native stacktrace:

  0   mono32                              0x00151e46 mono_handle_native_sigsegv + 342
  1   mono32                              0x001a5091 sigabrt_signal_handler + 145
  2   libsystem_platform.dylib            0x9ca8d79b _sigtramp + 43
  3   ???                                 0xffffffff 0x0 + 4294967295
  4   libsystem_c.dylib                   0x94c76c38 abort + 156
  5   mono32                              0x0031bc11 monoeg_log_default_handler + 129
  6   mono32                              0x0031bc8a monoeg_g_log + 106
  7   mono32                              0x00251104 poll_event_wait + 500
  8   mono32                              0x0024fcf7 selector_thread + 1351
  9   mono32                              0x0024a6af start_wrapper + 575
  10  mono32                              0x003140ca inner_start_thread + 474
  11  libsystem_pthread.dylib             0x9dc42780 _pthread_body + 138
  12  libsystem_pthread.dylib             0x9dc426f6 _pthread_body + 0
  13  libsystem_pthread.dylib             0x9dc3ff7a thread_start + 34

Debug info from gdb:

(lldb) command source -s 0 '/tmp/mono-gdb-commands.4LtjbA'
Executing commands in '/tmp/mono-gdb-commands.4LtjbA'.
(lldb) process attach --pid 713
Process 713 stopped
* thread #1: tid = 0x5a6c70, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_50b', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
libsystem_kernel.dylib`__psynch_cvwait:
->  0x9ae073ea <+10>: jae    0x9ae073fa                ; <+26>
    0x9ae073ec <+12>: calll  0x9ae073f1                ; <+17>
    0x9ae073f1 <+17>: popl   %edx
    0x9ae073f2 <+18>: movl   0x92f0c2f(%edx), %edx

Executable module set to "/Library/Frameworks/Mono.framework/Versions/4.6.1/bin/mono32".
Architecture set to: i386-apple-macosx.
(lldb) thread list
Process 713 stopped
* thread #1: tid = 0x5a6c70, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_50b', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  thread #2: tid = 0x5a6c71, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
  thread #3: tid = 0x5a6c73, 0x9ae004d6 libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
  thread #4: tid = 0x5a6c74, 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #5: tid = 0x5a6c75, 0x9ae087fa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
  thread #6: tid = 0x5a6c76, 0x9ae07646 libsystem_kernel.dylib`__recvfrom + 10, name = 'Debugger agent'
  thread #7: tid = 0x5a6c7a, 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #8: tid = 0x5a6c7b, 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #9: tid = 0x5a6c7c, 0x9ae07cee libsystem_kernel.dylib`__wait4 + 10, name = 'tid_2507'
  thread #10: tid = 0x5a6c7f, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_2a0b'
  thread #11: tid = 0x5a6c80, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #12: tid = 0x5a6c82, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #13: tid = 0x5a6c84, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #14: tid = 0x5a6c85, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #15: tid = 0x5a6c86, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #16: tid = 0x5a6c87, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #17: tid = 0x5a6c88, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #18: tid = 0x5a6c89, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #19: tid = 0x5a6c8a, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
  thread #20: tid = 0x5a6c90, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Timer-Scheduler'
  thread #21: tid = 0x5a6c93, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
(lldb) thread backtrace all
* thread #1: tid = 0x5a6c70, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_50b', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc45276 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
    frame #3: 0x0024f132 mono32`ves_icall_System_IOSelector_Add [inlined] mono_os_cond_wait + 12 at mono-os-mutex.h:107 [opt]
    frame #4: 0x0024f126 mono32`ves_icall_System_IOSelector_Add [inlined] mono_coop_cond_wait + 22 at mono-coop-mutex.h:93 [opt]
    frame #5: 0x0024f110 mono32`ves_icall_System_IOSelector_Add [inlined] update_get_new + 43 at threadpool-ms-io.c:446 [opt]
    frame #6: 0x0024f0e5 mono32`ves_icall_System_IOSelector_Add(handle=<unavailable>, job=<unavailable>) + 1029 at threadpool-ms-io.c:582 [opt]
    frame #7: 0x02465bbc
    frame #8: 0x024645b8
    frame #9: 0x02463a4c
    frame #10: 0x02463744
    frame #11: 0x0246083c
    frame #12: 0x024605e4
    frame #13: 0x0245f7df
    frame #14: 0x0245f248
    frame #15: 0x0245f19c
    frame #16: 0x0245f080
    frame #17: 0x007e2854
    frame #18: 0x007e2150
    frame #19: 0x007e056c
    frame #20: 0x007e0108
    frame #21: 0x007dfd44
    frame #22: 0x007df978
    frame #23: 0x006e558c
    frame #24: 0x006e5823
    frame #25: 0x00094317 mono32`mono_jit_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=<unavailable>, error=<unavailable>) + 1527 at mini-runtime.c:2547 [opt]
    frame #26: 0x002785e0 mono32`do_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=<unavailable>, exc=<unavailable>, error=<unavailable>) + 96 at object.c:2949 [opt]
    frame #27: 0x0027ae2d mono32`mono_runtime_exec_main [inlined] mono_runtime_invoke_checked(method=<unavailable>, params=0x008002b0, error=0x00000000) + 1005 at object.c:3107 [opt]
    frame #28: 0x0027addd mono32`mono_runtime_exec_main(method=0x7c8f2ac0, args=<unavailable>, exc=0x00278592) + 925 at object.c:4724 [opt]
    frame #29: 0x0027a95f mono32`mono_runtime_run_main(method=0x7c8f2ac0, argc=<unavailable>, argv=<unavailable>, exc=0x00000000) + 895 at object.c:4274 [opt]
    frame #30: 0x00116719 mono32`mono_jit_exec(domain=<unavailable>, assembly=<unavailable>, argc=<unavailable>, argv=<unavailable>) + 265 at driver.g.c:1048 [opt]
    frame #31: 0x00118dc2 mono32`mono_main [inlined] main_thread_handler + 8850 at driver.g.c:1108 [opt]
    frame #32: 0x00118d84 mono32`mono_main(argc=<unavailable>, argv=<unavailable>) + 8788 at driver.g.c:2186 [opt]
    frame #33: 0x000840f1 mono32`main [inlined] mono_main_with_options(argc=4, argc=4, argc=4, argv=0xbff7e8b0, argv=0xbff7e8b0, argv=0xbff7e8b0) + 33 at main.c:28 [opt]
    frame #34: 0x000840d0 mono32`main(argc=4, argv=0xbff7e8b0) + 1184 at main.c:177 [opt]
    frame #35: 0x00083c25 mono32`start + 53

  thread #2: tid = 0x5a6c71, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc45276 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
    frame #3: 0x002e4065 mono32`thread_func [inlined] mono_os_cond_wait(mutex=0xb00810b0) + 18 at mono-os-mutex.h:107 [opt]
    frame #4: 0x002e4053 mono32`thread_func(thread_data=<unavailable>) + 195 at sgen-thread-pool.c:110 [opt]
    frame #5: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #6: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #7: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #3: tid = 0x5a6c73, 0x9ae004d6 libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
    frame #0: 0x9ae004d6 libsystem_kernel.dylib`semaphore_wait_trap + 10
    frame #1: 0x00271a97 mono32`finalizer_thread [inlined] mono_os_sem_wait(flags=MONO_SEM_FLAGS_ALERTABLE) + 14 at mono-os-semaphore.h:72 [opt]
    frame #2: 0x00271a89 mono32`finalizer_thread [inlined] mono_coop_sem_wait(flags=MONO_SEM_FLAGS_ALERTABLE) + 10 at mono-coop-semaphore.h:40 [opt]
    frame #3: 0x00271a7f mono32`finalizer_thread(unused=0x00000000) + 191 at gc.c:761 [opt]
    frame #4: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #5: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #6: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #7: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #8: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #9: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #4: tid = 0x5a6c74, 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x9dc4234b libsystem_pthread.dylib`_pthread_wqthread + 1289
    frame #2: 0x9dc3ff56 libsystem_pthread.dylib`start_wqthread + 34

  thread #5: tid = 0x5a6c75, 0x9ae087fa libsystem_kernel.dylib`kevent_qos + 10, queue = 'com.apple.libdispatch-manager'
    frame #0: 0x9ae087fa libsystem_kernel.dylib`kevent_qos + 10
    frame #1: 0x947137ea libdispatch.dylib`_dispatch_mgr_invoke + 234
    frame #2: 0x947133be libdispatch.dylib`_dispatch_mgr_thread + 52

  thread #6: tid = 0x5a6c76, 0x9ae07646 libsystem_kernel.dylib`__recvfrom + 10, name = 'Debugger agent'
    frame #0: 0x9ae07646 libsystem_kernel.dylib`__recvfrom + 10
    frame #1: 0x94c969e3 libsystem_c.dylib`recv$UNIX2003 + 55
    frame #2: 0x0018a268 mono32`socket_transport_recv(buf=<unavailable>, len=<unavailable>) + 184 at debugger-agent.c:1130 [opt]
    frame #3: 0x0017ab37 mono32`debugger_thread [inlined] transport_recv(len=11) + 25 at debugger-agent.c:1536 [opt]
    frame #4: 0x0017ab1e mono32`debugger_thread(arg=0x00000000) + 1582 at debugger-agent.c:9847 [opt]
    frame #5: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #6: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #7: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #8: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #7: tid = 0x5a6c7a, 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x9dc4234b libsystem_pthread.dylib`_pthread_wqthread + 1289
    frame #2: 0x9dc3ff56 libsystem_pthread.dylib`start_wqthread + 34

  thread #8: tid = 0x5a6c7b, 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x9ae07d5e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x9dc4234b libsystem_pthread.dylib`_pthread_wqthread + 1289
    frame #2: 0x9dc3ff56 libsystem_pthread.dylib`start_wqthread + 34

  thread #9: tid = 0x5a6c7c, 0x9ae07cee libsystem_kernel.dylib`__wait4 + 10, name = 'tid_2507'
    frame #0: 0x9ae07cee libsystem_kernel.dylib`__wait4 + 10
    frame #1: 0x94c967e0 libsystem_c.dylib`waitpid$UNIX2003 + 48
    frame #2: 0x00151f0d mono32`mono_handle_native_sigsegv(signal=6, ctx=0xb043ecec, info=0xb043ecac) + 541 at mini-exceptions.c:2427 [opt]
    frame #3: 0x001a5091 mono32`sigabrt_signal_handler(_dummy=<unavailable>, _info=<unavailable>, context=<unavailable>) + 145 at mini-posix.c:227 [opt]
    frame #4: 0x9ca8d79b libsystem_platform.dylib`_sigtramp + 43

  thread #10: tid = 0x5a6c7f, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'tid_2a0b'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x00311bbb mono32`mono_thread_info_sleep [inlined] mono_os_cond_timedwait(cond=0x003e1214, mutex=0x003e11e8) + 104 at mono-os-mutex.h:136 [opt]
    frame #4: 0x00311b53 mono32`mono_thread_info_sleep [inlined] mono_coop_cond_timedwait(cond=0x003e1214, mutex=0x003e11e8) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x00311b53 mono32`mono_thread_info_sleep [inlined] sleep_interruptable(ms=<unavailable>, alerted=0xa44278d0) + 445 at mono-threads.c:1213 [opt]
    frame #6: 0x00311996 mono32`mono_thread_info_sleep(ms=<unavailable>, alerted=0xa44278d0) + 278 at mono-threads.c:1245 [opt]
    frame #7: 0x0024e476 mono32`monitor_thread + 742 at threadpool-ms.c:905 [opt]
    frame #8: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #9: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #10: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #11: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #12: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #13: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #11: tid = 0x5a6c80, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #12: tid = 0x5a6c82, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #13: tid = 0x5a6c84, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #14: tid = 0x5a6c85, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #15: tid = 0x5a6c86, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #16: tid = 0x5a6c87, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #17: tid = 0x5a6c88, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #18: tid = 0x5a6c89, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #19: tid = 0x5a6c8a, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #20: tid = 0x5a6c90, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Timer-Scheduler'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x002ea917 mono32`mono_os_cond_timedwait(cond=<unavailable>, mutex=<unavailable>, timeout_ms=<unavailable>) + 135 at mono-os-mutex.h:136 [opt]
    frame #4: 0x002ea6cb mono32`_wapi_handle_timedwait_signal_handle(handle=0x00000d1e, timeout=<unavailable>, alertable=<unavailable>, poll=<unavailable>, alerted=0x4d5ebef0) + 507 at handles.c:1555 [opt]
    frame #5: 0x002fdb1b mono32`wapi_WaitForSingleObjectEx(handle=<unavailable>, timeout=<unavailable>, alertable=<unavailable>) + 731 at wait.c:189 [opt]
    frame #6: 0x00244c9e mono32`mono_wait_uninterrupted(thread=<unavailable>, numhandles=<unavailable>, handles=<unavailable>, waitall=<unavailable>, ms=<unavailable>, error=<unavailable>) + 110 at threads.c:1595 [opt]
    frame #7: 0x00244efb mono32`ves_icall_System_Threading_WaitHandle_WaitOne_internal(handle=0x00000d1e, ms=4996) + 107 at threads.c:1731 [opt]
    frame #8: 0x02510fac
    frame #9: 0x02510e54
    frame #10: 0x02510cd4
    frame #11: 0x02510bd0
    frame #12: 0x02510b30
    frame #13: 0x02510a2a
    frame #14: 0x0250dbfb
    frame #15: 0x02502d98
    frame #16: 0x024d5c32
    frame #17: 0x024d548c
    frame #18: 0x02500210
    frame #19: 0x024ff918
    frame #20: 0x01ae9ae5
    frame #21: 0x00094317 mono32`mono_jit_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=<unavailable>, error=<unavailable>) + 1527 at mini-runtime.c:2547 [opt]
    frame #22: 0x002785e0 mono32`do_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=<unavailable>, exc=<unavailable>, error=<unavailable>) + 96 at object.c:2949 [opt]
    frame #23: 0x0027a1b9 mono32`mono_runtime_delegate_try_invoke [inlined] mono_runtime_invoke_checked(method=<unavailable>, params=<unavailable>, error=<unavailable>) + 329 at object.c:3107 [opt]
    frame #24: 0x0027a168 mono32`mono_runtime_delegate_try_invoke(delegate=<unavailable>, params=<unavailable>, exc=<unavailable>, error=<unavailable>) + 248 at object.c:4052 [opt]
    frame #25: 0x0027a222 mono32`mono_runtime_delegate_invoke_checked(delegate=0x0087b7a0, params=0xb0e74ef8, error=0xb0e74f00) + 50 at object.c:4073 [opt]
    frame #26: 0x0024a734 mono32`start_wrapper [inlined] start_wrapper_internal + 679 at threads.c:746 [opt]
    frame #27: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #28: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #29: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #30: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #31: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34

  thread #21: tid = 0x5a6c93, 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Threadpool worker'
    frame #0: 0x9ae073ea libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9dc43538 libsystem_pthread.dylib`_pthread_cond_wait + 757
    frame #2: 0x9dc46d0b libsystem_pthread.dylib`pthread_cond_timedwait$UNIX2003 + 71
    frame #3: 0x0024d860 mono32`worker_thread [inlined] mono_os_cond_timedwait(cond=<unavailable>, mutex=0x7ae5737c, timeout_ms=<unavailable>) + 152 at mono-os-mutex.h:136 [opt]
    frame #4: 0x0024d7c8 mono32`worker_thread [inlined] mono_coop_cond_timedwait(timeout_ms=<unavailable>) at mono-coop-mutex.h:107 [opt]
    frame #5: 0x0024d7c8 mono32`worker_thread [inlined] worker_park + 388 at threadpool-ms.c:532 [opt]
    frame #6: 0x0024d644 mono32`worker_thread(data=0x00000000) + 932 at threadpool-ms.c:624 [opt]
    frame #7: 0x0024a6af mono32`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #8: 0x0024a48d mono32`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #9: 0x003140ca mono32`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #10: 0x9dc42780 libsystem_pthread.dylib`_pthread_body + 138
    frame #11: 0x9dc426f6 libsystem_pthread.dylib`_pthread_start + 155
    frame #12: 0x9dc3ff7a libsystem_pthread.dylib`thread_start + 34
(lldb) detach
Process 713 detached
(lldb) Thread started: <Thread Pool> #15
Thread started: <Thread Pool> #16
Thread started: <Thread Pool> #17
Thread started: <Thread Pool> #18
Thread started: <Thread Pool> #19
Thread started: <Thread Pool> #20
Thread started: <Thread Pool> #21
Thread started: <Thread Pool> #22
Thread started: <Thread Pool> #23
Thread started: <Thread Pool> #24
Thread started: <Thread Pool> #25
Thread started: <Thread Pool> #26
Thread started: <Thread Pool> #27
Thread started: <Thread Pool> #28
Thread started: <Thread Pool> #29
Thread started: <Thread Pool> #30
Thread started: <Thread Pool> #31
Thread started: <Thread Pool> #32
Thread started: <Thread Pool> #33
(lldb) quit
Thread started: <Thread Pool> #34

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Alex 2017-01-11 22:16:58 UTC
We have the same problem too. Any resolution or updates?
Comment 2 Mikhail Filippov 2017-06-30 10:47:44 UTC
Problem looks like resolved in Mono 5.0.1.1

Note You need to log in before you can comment on or make changes to this bug.