Skip to content

Concurrent Execution of Single Executable on Linux Fails #4644

@mockjv

Description

@mockjv

Execution of a single executable (e.g., /p:PublishSingleFile=true) by multiple users on Linux results in an extraction failure.

General

I first came across this while testing my build against CentOS 7, but I suspect this isn't limited to just CentOS 7. Upon first execution, it appears the application files are extracted to /var/tmp/.net//

The permissions of the /var/tmp/.net directory are 0700 and owned by the first user that ran it. As a result, if an additional user runs the same executable the extraction fails due to the permissions of /var/tmp/.net:

[test@localhost ~]$ /opt/myapp/myapp
Failure processing application bundle.
Failed to create directory [/var/tmp/.net/myapp/] for extracting bundled files
A fatal error was encountered. Could not extract contents of the bundle

The executable was built using .NET Core SDK 3.1.201.

This is easily reproducible by building the following as a single executable, and then trying to run it from multiple user accounts:

using System;
using System.Threading.Tasks;

namespace testApp
{
    class Program
    {
        async static Task Main(string[] args)
        {
            await Task.Delay(1000000);
        }
    }
}

Upon reading the "Single-File" design in 3.0 vs. 5.0, I do see that the goal is to no longer use the extraction based approach, so I suspect we wouldn't see that with 5.0p2. That said, I doubt this is a desired behavior in 3.1 (LTS).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions