Skip to content

[Big Sur] open() vs SA_RESTART #48663

@lambdageek

Description

@lambdageek

It appears that on MacOS Big Sur, open can sometimes return EINTR if it is interrupted by a signal even if the signal has a handler installed with SA_RESTART.

  • MonoVM thread suspend/resume sometimes (when using posix instead of Mach) will use suspend/resume signals with the SA_RESTART flags. (although this is not the default - we prefer to use Mach suspend/resume operations)
  • The System.Native PAL installs some signal handlers with SA_RESTART

We should make sure that all our calls to open handle EINTR.


To be clear, I haven't seen this cause a problem for .NET that can be clearly attributed to this issue. Until we catch it in a repro, this is just a placeholder issue - unless we want to be proactive about mitigating.


(This is affecting other software too. git, for example. It has affected some runtime engineers - git clone --progress https://github.com/dotnet/runtime will sometimes fail with interrupted system call errors and leave the working tree in an unusable state. The workaround is to call git clone --quiet (note that --progress is the default))


The issue seems to be exacerbated by some antivirus software, even if "real time protection" is turned off.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions