Skip to content

Missing null guards in FSharpAsync; exceptions in continuations #20613

Description

@bartelink

On FSharp.Core 10.1.303, I'm seeing NullReferenceExceptions from continuation threads with trampolining in the mix, specifically in AsyncPrimitives.Invoke

I note there are no null guards that I can see in StartAsTask and StartImmediateAsTask.

In addition to fixing both of those, a full audit should be done across the board (i.e. stuff that a return! is going to employ).

Steps to reproduce are to use FSharpAsync stuff from C# with Moq and other such grubby things

While this is second hand for me I have no doubt that this has caused issues for others so it seems like having basic null checks is worth doing even if ultimately it may not be possible to yield a useful call chain given threadpool hops are involved?

Workarounds are brute force bisect of a large test suite to determine which tests leave unawaited async work in flight

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions