Bug 51223 - F# MailboxProcessor gets a fatal error in the mono runtime
Summary: F# MailboxProcessor gets a fatal error in the mono runtime
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Interop ()
Version: 3.6.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-01-04 21:14 UTC by leolorenzoluis
Modified: 2017-06-22 12:40 UTC (History)
3 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description leolorenzoluis 2017-01-04 21:14:48 UTC
Not sure if it is a bug in Mono runtime.

Reference: https://github.com/fsharp/fsharp/issues/651#issuecomment-269867611

#### Repro steps

Provide the steps required to reproduce the problem

1. Create a simple fsx script with the following code:

```
open System
open System.Collections.Concurrent
open System.IO
open System.Net
open System.Text.RegularExpressions
 
module Helpers =
 
    type Message =
        | Url of string option
        | Done
        | Mailbox of MailboxProcessor<Message>
        | Stop
 
    // Gates the number of wrawling agents.
    [<Literal>]
    let Gate = 5
 
    // Extracts links from HTML.
    let extractLinks (html : string) =
        let pattern1 = "(?i)href\\s*=\\s*(\"|\')/?((?!#.*|/\B|mailto:|location\.|javascript:)[^\"\']+)(\"|\')"
        let pattern2 = "(?i)https?"
 
        let links =
            [
                for x in Regex(pattern1).Matches(html) do
                    yield x.Groups.[2].Value
            ]
            |> List.filter (fun x -> Regex(pattern2).IsMatch(x))
        links
    
    // Fetches a Web page.
    let fetch (url : string) =
        try
            let req = WebRequest.Create(url) :?> HttpWebRequest
            req.UserAgent <- "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)"
            req.Timeout <- 5000
            use resp = req.GetResponse()
            let content = resp.ContentType
            let isHtml = Regex("html").IsMatch(content)
            match isHtml with
            | true -> use stream = resp.GetResponseStream()
                      use reader = new StreamReader(stream)
                      let html = reader.ReadToEnd()
                      Some html
            | false -> None
        with
        | _ -> None
    
    let collectLinks (url : string) =
        let html = fetch url
        match html with
        | Some x -> extractLinks x
        | None -> []
 
open Helpers
 
let crawl (url : string) limit =
    // Concurrent queue for saving collected urls.
    let q = ConcurrentQueue<string>()
    
    // Holds crawled URLs.
    let set : Set<string> = Set.empty
    let t = true
    let f = false
 
    let supervisor =
        MailboxProcessor.Start(fun x ->
            let rec loop (set : Set<string>) (run : bool) =
                async {
                    let! msg = x.Receive()
                    match msg with
                    | Mailbox(mailbox) -> 
                        let count = set.Count
                        if count < limit - 1 && run then 
                            let url = q.TryDequeue()
                            match url with
                            | true, str -> if not (set.Contains str) then
                                                let set'= set.Add str
                                                mailbox.Post <| Url(Some str)
                                                return! loop set' run
                                            else
                                                mailbox.Post <| Url None
                                                return! loop set run
 
                            | _ -> mailbox.Post <| Url None
                                   return! loop set run
                        else
                            mailbox.Post Stop
                            return! loop set run
                    | Stop -> return! loop set f
                    | _ -> printfn "Supervisor is done."
                           (x :> IDisposable).Dispose()
                }
            loop set t)
 
    
    let urlCollector =
        MailboxProcessor.Start(fun y ->
            let rec loop count =
                async {
                    let! msg = y.TryReceive(6000)
                    match msg with
                    | Some message ->
                        match message with
                        | Url u ->
                            match u with
                            | Some url -> q.Enqueue url
                                          return! loop count
                            | None -> return! loop count
                        | _ ->
                            match count with
                            | Gate -> supervisor.Post Done
                                      (y :> IDisposable).Dispose()
                                      printfn "URL collector is done."
                            | _ -> return! loop (count + 1)
                    | None -> supervisor.Post Stop
                              return! loop count
                }
            loop 1)
    
    /// Initializes a crawling agent.
    let crawler id =
        MailboxProcessor.Start(fun inbox ->
            let rec loop() =
                async {
                    let! msg = inbox.Receive()
                    match msg with
                    | Url x ->
                        match x with
                        | Some url -> 
                                let links = collectLinks url
                                printfn "%s crawled by agent %d." url id
                                for link in links do
                                    urlCollector.Post <| Url (Some link)
                                supervisor.Post(Mailbox(inbox))
                                return! loop()
                        | None -> supervisor.Post(Mailbox(inbox))
                                  return! loop()
                    | _ -> urlCollector.Post Done
                           printfn "Agent %d is done." id
                           (inbox :> IDisposable).Dispose()
                    }
            loop())
 
    // Spawn the crawlers.
    let crawlers = 
        [
            for i in 1 .. Gate do
                yield crawler i
        ]
    
    // Post the first messages.
    crawlers.Head.Post <| Url (Some url)
    crawlers.Tail |> List.iter (fun ag -> ag.Post <| Url None)

crawl "http://news.google.com" 50
```

2. Run the script with FSI

```
http://news.google.com crawled by agent 1.
http://www.gstatic.com/news/img/favicon.ico crawled by agent 1.
http://news.google.com/news?pz=1&amp;cf=all&amp;ned=us&amp;hl=en&amp;topic=h&amp;num=3&amp;output=rss crawled by agent 4.
http://www.google.com/imghp?hl=en&tab=ni crawled by agent 2.
http://www.google.com/webhp?hl=en&tab=nw crawled by agent 5.
http://www.google.com/intl/en/options/ crawled by agent 5.
http://www.google.com/prdhp?hl=en&tab=nf crawled by agent 4.
```

Provide a description of the expected behaviour.

```
* Assertion at mini-generic-sharing.c:2351, condition `info' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at Microsoft.FSharp.Control.Queue`1<T_REF>..ctor () <0x00017>
  at Microsoft.FSharp.Control.Mailbox`1<TMsg_REF>..ctor () <0x0003b>
  at Microsoft.FSharp.Control.FSharpMailboxProcessor`1<TMsg_REF>..ctor (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Control.FSharpMailboxProcessor`1<TMsg_REF>, Microsoft.FSharp.Control.FSharpAsync`1<Microsoft.FSharp.Core.Unit>>,Microsoft.FSharp.Core.FSharpOption`1<System.Threading.CancellationToken>) <0x000c3>
  at Microsoft.FSharp.Control.FSharpMailboxProcessor`1<TMsg_REF>.Start (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Control.FSharpMailboxProcessor`1<TMsg_REF>, Microsoft.FSharp.Control.FSharpAsync`1<Microsoft.FSharp.Core.Unit>>,Microsoft.FSharp.Core.FSharpOption`1<System.Threading.CancellationToken>) <0x0003f>
  at FSI_0001.crawl (string,int) <0x000a7>
  at <StartupCode$FSI_0001>.$FSI_0001.main@ () <0x0001b>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0x00090>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0x00012>
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000a1>
  at System.RuntimeType.InvokeMember (string,System.Reflection.BindingFlags,System.Reflection.Binder,object,object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,string[]) <0x00e76>
  at System.Reflection.Emit.TypeBuilder.InvokeMember (string,System.Reflection.BindingFlags,System.Reflection.Binder,object,object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,string[]) <0x00066>
  at System.Type.InvokeMember (string,System.Reflection.BindingFlags,System.Reflection.Binder,object,object[],System.Globalization.CultureInfo) <0x0005a>
  at Microsoft.FSharp.Compiler.AbstractIL.ILRuntimeWriter/execEntryPtFun@2017-1.Invoke (Microsoft.FSharp.Core.Unit) <0x00083>
  at Microsoft.FSharp.Compiler.Interactive.Shell/clo@896-37.Invoke (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Core.FSharpOption`1<System.Exception>>) <0x00019>
  at Microsoft.FSharp.Primitives.Basics.List.iter<T_REF> (Microsoft.FSharp.Core.FSharpFunc`2<T_REF, Microsoft.FSharp.Core.Unit>,Microsoft.FSharp.Collections.FSharpList`1<T_REF>) <0x00038>
  at Microsoft.FSharp.Collections.ListModule.Iterate<T_REF> (Microsoft.FSharp.Core.FSharpFunc`2<T_REF, Microsoft.FSharp.Core.Unit>,Microsoft.FSharp.Collections.FSharpList`1<T_REF>) <0x00027>
  at Microsoft.FSharp.Compiler.Interactive.Shell.arg10@895 (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompiler,Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Core.FSharpOption`1<System.Exception>>>,Microsoft.FSharp.Core.Unit) <0x00057>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompiler.ProcessInputs (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Compiler.Ast/ParsedInput>,bool,bool,bool,Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Compiler.Ast/Ident>) <0x00697>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompiler.EvalParsedDefinitions (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,bool,bool,Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Compiler.Ast/SynModuleDecl>) <0x00213>
  at Microsoft.FSharp.Compiler.Interactive.Shell/clo@1646-45.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x01497>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.InteractiveCatch<a_REF> (Microsoft.FSharp.Core.FSharpFunc`2<a_REF, System.Tuple`2<a_REF, Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionStepStatus>>,a_REF) <0x00035>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.ExecInteraction (bool,Microsoft.FSharp.Compiler.CompileOps/TcConfig,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Compiler.Ast/ParsedFsiInteraction) <0x00067>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.ExecInteractions (bool,Microsoft.FSharp.Compiler.CompileOps/TcConfig,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Core.FSharpOption`1<Microsoft.FSharp.Compiler.Ast/ParsedFsiInteraction>) <0x0098f>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.MainThreadProcessParsedInteraction (bool,Microsoft.FSharp.Core.FSharpOption`1<Microsoft.FSharp.Compiler.Ast/ParsedFsiInteraction>,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x00127>
  at Microsoft.FSharp.Compiler.Interactive.Shell/res@1863.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x00033>
  at Microsoft.FSharp.Compiler.Interactive.Shell/run@1880-1.Invoke (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, System.Tuple`2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionStepStatus>>,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x00017>
  at Microsoft.FSharp.Core.OptimizedClosures/Invoke@3261<T2_REF, TResult_REF, T1_REF>.Invoke (T2_REF) <0x00024>
  at Microsoft.FSharp.Compiler.Interactive.Shell/ParseAndProcessAndEvalOneInteractionFromLexbuf@1852.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x00188>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.InteractiveCatch<a_REF> (Microsoft.FSharp.Core.FSharpFunc`2<a_REF, System.Tuple`2<a_REF, Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionStepStatus>>,a_REF) <0x00035>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.ParseAndProcessAndEvalOneInteractionFromLexbuf (bool,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, System.Tuple`2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionStepStatus>>, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, System.Tuple`2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionStepStatus>>>,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Compiler.LexFilter/LexFilter) <0x0013f>
  at Microsoft.FSharp.Compiler.Interactive.Shell.run@1879 (Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor,bool,Microsoft.FSharp.Compiler.LexFilter/LexFilter,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0004b>
  at Microsoft.FSharp.Compiler.Interactive.Shell/EvalIncludedScript@1875.Invoke (Microsoft.FSharp.Core.Unit) <0x00053>
  at Microsoft.FSharp.Compiler.Interactive.Shell.WithImplicitHome<a_REF> (Microsoft.FSharp.Compiler.CompileOps/TcConfigBuilder,string,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, a_REF>) <0x00046>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.EvalIncludedScript (bool,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,string,Microsoft.FSharp.Compiler.Range/range) <0x000bf>
  at Microsoft.FSharp.Compiler.Interactive.Shell/EvalIncludedScripts@1899.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0005b>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.InteractiveCatch<a_REF> (Microsoft.FSharp.Core.FSharpFunc`2<a_REF, System.Tuple`2<a_REF, Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionStepStatus>>,a_REF) <0x00035>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.EvalIncludedScripts (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,bool,Microsoft.FSharp.Collections.FSharpList`1<string>) <0x00083>
  at Microsoft.FSharp.Compiler.Interactive.Shell.consume@1909 (Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor,bool,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Collections.FSharpList`1<System.Tuple`2<string, bool>>) <0x000cb>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.LoadInitialFiles (bool,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0002b>
  at Microsoft.FSharp.Compiler.Interactive.Shell/FsiEvaluationSession.Run () <0x00c03>
  at Microsoft.FSharp.Compiler.Interactive.Shell.evaluateSession@2520 (string[],Microsoft.FSharp.Core.Unit) <0x0009b>
  at Microsoft.FSharp.Compiler.Interactive.Shell.MainMain (string[]) <0x00167>
  at Microsoft.FSharp.Compiler.Interactive.Main.FsiMain (string[]) <0x00013>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0x000c3>

Native stacktrace:

	0   mono                                0x00154e46 mono_handle_native_sigsegv + 342
	1   mono                                0x001a8091 sigabrt_signal_handler + 145
	2   libsystem_platform.dylib            0x9f795ebb _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libsystem_c.dylib                   0x9f61ea44 abort + 141
	5   mono                                0x0031ec11 monoeg_log_default_handler + 129
	6   mono                                0x0031ed0b monoeg_assertion_message + 107
	7   mono                                0x0015ef5c fill_runtime_generic_context + 732
	8   mono                                0x0015eb48 mono_class_fill_runtime_generic_context + 168
	9   mono                                0x001586e5 mono_rgctx_lazy_fetch_trampoline + 133
	10  ???                                 0x00467389 0x0 + 4617097

Debug info from gdb:

(lldb) command source -s 0 '/tmp/mono-gdb-commands.Jq7CWZ'
Executing commands in '/tmp/mono-gdb-commands.Jq7CWZ'.
(lldb) process attach --pid 87411
warning: (i386) /Library/Frameworks/Mono.framework/Versions/4.6.1/lib/mono/4.5/mscorlib.dll.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
Process 87411 stopped
* thread #1: tid = 0x2a15c0, 0x9f6bec4e libsystem_kernel.dylib`__wait4 + 10, name = 'tid_403', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x9f6bec4e libsystem_kernel.dylib`__wait4 + 10
libsystem_kernel.dylib`__wait4:
->  0x9f6bec4e <+10>: jae    0x9f6bec5e                ; <+26>
    0x9f6bec50 <+12>: calll  0x9f6bec55                ; <+17>
    0x9f6bec55 <+17>: popl   %edx
    0x9f6bec56 <+18>: movl   0x5a323d3(%edx), %edx

Executable module set to "/Library/Frameworks/Mono.framework/Versions/4.6.1/bin/mono".
Architecture set to: i386-apple-macosx.
(lldb) thread list
Process 87411 stopped
* thread #1: tid = 0x2a15c0, 0x9f6bec4e libsystem_kernel.dylib`__wait4 + 10, name = 'tid_403', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  thread #2: tid = 0x2a15c1, 0x9f6be312 libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
  thread #3: tid = 0x2a15c2, 0x9f6b695a libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
  thread #4: tid = 0x2a15c3, 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #5: tid = 0x2a15c4, 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #6: tid = 0x2a15c5, 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
(lldb) thread backtrace all
* thread #1: tid = 0x2a15c0, 0x9f6bec4e libsystem_kernel.dylib`__wait4 + 10, name = 'tid_403', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x9f6bec4e libsystem_kernel.dylib`__wait4 + 10
    frame #1: 0x9f63d2ff libsystem_c.dylib`waitpid$UNIX2003 + 32
    frame #2: 0x00154f0d mono`mono_handle_native_sigsegv(signal=6, ctx=0xbff79ddc, info=0xbff79d9c) + 541 at mini-exceptions.c:2427 [opt]
    frame #3: 0x001a8091 mono`sigabrt_signal_handler(_dummy=<unavailable>, _info=<unavailable>, context=<unavailable>) + 145 at mini-posix.c:227 [opt]

  thread #2: tid = 0x2a15c1, 0x9f6be312 libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker'
    frame #0: 0x9f6be312 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x9f79ff74 libsystem_pthread.dylib`_pthread_cond_wait + 647
    frame #2: 0x9f7a1aa4 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 51
    frame #3: 0x002e7065 mono`thread_func [inlined] mono_os_cond_wait(mutex=0x00000000) + 18 at mono-os-mutex.h:107 [opt]
    frame #4: 0x002e7053 mono`thread_func(thread_data=<unavailable>) + 195 at sgen-thread-pool.c:110 [opt]
    frame #5: 0x9f79f10b libsystem_pthread.dylib`_pthread_body + 184
    frame #6: 0x9f79f053 libsystem_pthread.dylib`_pthread_start + 243
    frame #7: 0x9f79e92e libsystem_pthread.dylib`thread_start + 34

  thread #3: tid = 0x2a15c2, 0x9f6b695a libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer'
    frame #0: 0x9f6b695a libsystem_kernel.dylib`semaphore_wait_trap + 10
    frame #1: 0x00274a97 mono`finalizer_thread [inlined] mono_os_sem_wait(flags=MONO_SEM_FLAGS_ALERTABLE) + 14 at mono-os-semaphore.h:72 [opt]
    frame #2: 0x00274a89 mono`finalizer_thread [inlined] mono_coop_sem_wait(flags=MONO_SEM_FLAGS_ALERTABLE) + 10 at mono-coop-semaphore.h:40 [opt]
    frame #3: 0x00274a7f mono`finalizer_thread(unused=0x00000000) + 191 at gc.c:761 [opt]
    frame #4: 0x0024d6af mono`start_wrapper [inlined] start_wrapper_internal + 546 at threads.c:740 [opt]
    frame #5: 0x0024d48d mono`start_wrapper(data=<unavailable>) + 29 at threads.c:788 [opt]
    frame #6: 0x003170ca mono`inner_start_thread(arg=<unavailable>) + 474 at mono-threads-posix.c:92 [opt]
    frame #7: 0x9f79f10b libsystem_pthread.dylib`_pthread_body + 184
    frame #8: 0x9f79f053 libsystem_pthread.dylib`_pthread_start + 243
    frame #9: 0x9f79e92e libsystem_pthread.dylib`thread_start + 34

  thread #4: tid = 0x2a15c3, 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x9f79edea libsystem_pthread.dylib`_pthread_wqthread + 1210
    frame #2: 0x9f79e90a libsystem_pthread.dylib`start_wqthread + 34

  thread #5: tid = 0x2a15c4, 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x9f79ec79 libsystem_pthread.dylib`_pthread_wqthread + 841
    frame #2: 0x9f79e90a libsystem_pthread.dylib`start_wqthread + 34

  thread #6: tid = 0x2a15c5, 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #0: 0x9f6becbe libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x9f79edea libsystem_pthread.dylib`_pthread_wqthread + 1210
    frame #2: 0x9f79e90a libsystem_pthread.dylib`start_wqthread + 34
(lldb) detach

=================================================================
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.
=================================================================

Process 87411 detached
(lldb) [1]    87411 abort      fsharpi crawler-with-agents.fsx
```

#### Known workarounds

N/A

#### Related information 

N/A

* Operating system : macOS
* Branch : mono-4.6.0-branch-c8sr0/ef43c15
* .NET Runtime, CoreCLR or Mono Version : Mono JIT compiler version 4.6.1 
* Editing Tools (e.g. Visual Studio Version) : VS Code
Comment 1 Jason Imison 2017-06-22 12:40:46 UTC
I just tested this with Mono 5.0.0.109 and 5.2.0.171

Both worked fine, so closing.