Skip to content

dotnet-install results in "Killed: 9" when updating a signed build on MacOs #232

Closed

Description

@ericstj

Using CP here

cp -R $override_switch "$root_path/$path" "$target"

Is overwriting dotnet.

When dotnet is a signed file, and has previously run, Mac OS is caching the signature. When that file is replaced "in place" as is done with cp it causes subsequent execution of dotnet to fail with Killed: 9

I've reported this to Apple, but the scripts should avoid this pattern if possible. I believe the MacOs installer first moves files out of the way, then deletes them, before copying a new file.

Activity

  1. changed the title [-]dotnet-install results in "Killed: 9[/-] [+]dotnet-install results in "Killed: 9" when updating a signed build on MacOs[/+] on Nov 19, 2021
  2. bekir-ozturk commented on Nov 25, 2021

    @bekir-ozturk
    Contributor

    Hi @ericstj,
    Does this happen in a specific scenario or would you say it's common? Any CI pipelines that you are aware of which are impacted by this?
    The scripts have an option SkipNonVersionedFiles which skips updating dotnet executable and just installs the new sdk/runtime. Would that help in this case? Since dotnet executable isn't updated, signature shouldn't be a problem.

  3. self-assigned this
    on Nov 25, 2021
  4. ericstj commented on Nov 30, 2021

    @ericstj
    MemberAuthor

    @joeloff looped me into this happening in the SDK repo where it looks like they weren't passing that flag.
    https://github.com/dotnet/sdk/blob/45e032c4d0f3625fb5bad6e50067a06b6b7fdc0a/eng/restore-toolset.sh#L22-L54

  5. joeloff commented on Nov 30, 2021

    @joeloff
    Member

    Good to know about that flag. I'll update the SDK PR

  6. bekir-ozturk commented on Nov 30, 2021

    @bekir-ozturk
    Contributor

    We have synced with @joeloff and it appears that SkipNonVersionedFiles switch helps in this case.
    I am closing this issue.

  7. ericstj commented on Nov 30, 2021

    @ericstj
    MemberAuthor

    External customers are also hitting this. IMO we shouldn't have an install script which by default overwrites and downgrades files. I don't suppose we could add version detection to the scripts? We have means for defining this on windows (filever) and unix (strings).

  8. bekir-ozturk commented on Dec 9, 2021

    @bekir-ozturk
    Contributor

    Since these files are considered "unversioned", shouldn't the difference between them negligible? Is there a noticeable difference between invoking dotnet.exe generated by SDK 3.1 vs SDK 7.0?
    I believe the only thing that the dotnet executable is doing today is to determine the sdk version to be used and redirect the command to the versioned dotnet.dll.

  9. rolfbjarne commented on Feb 17, 2025

    @rolfbjarne
    Member

    This started happening on most (all?) of our macOS 12.0 (Ventura) bots just after .NET 8.0.406 was released.

    We're simply doing this:

    - task: UseDotNet@2
      inputs:
        version: 8.x

    Running this on the bots fixed the problem:

    cp /Users/builder/azdo/_work/_tool/dotnet/dotnet /Users/builder/azdo/_work/_tool/dotnet/dotnet2
    mv /Users/builder/azdo/_work/_tool/dotnet/dotnet2 /Users/builder/azdo/_work/_tool/dotnet/dotnet 
    

    FWIW this didn't happen on our macOS 13.0-15.0 bots, so this may have been fixed by Apple in macOS 13.0+.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions