Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV (139) on Linux .NET 8.0rc1 while Debug'ging #92176

Closed
vini-nu opened this issue Sep 16, 2023 · 4 comments
Closed

SIGSEGV (139) on Linux .NET 8.0rc1 while Debug'ging #92176

vini-nu opened this issue Sep 16, 2023 · 4 comments

Comments

@vini-nu
Copy link

vini-nu commented Sep 16, 2023

Description

Latest EndeavourOS Arch Linux with JetBrainsRider 2023.2.1#RD-232.9559.61
Linux_6.5.2-zen1-1-zen

$ dotnet --list-sdks
8.0.100-rc.1.23455.8 [/home/vini/dotnet/sdk]
$ dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/home/vini/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/home/vini/dotnet/shared/Microsoft.NETCore.App]

Project.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.11" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.11" />
  </ItemGroup>

</Project>

Program.cs

using System.Diagnostics;

var procStartInfo = new ProcessStartInfo()
{
    FileName = "/bin/bash",
    Arguments = "yes",
    UseShellExecute = false,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
};

using var proc = new Process() { StartInfo = procStartInfo,  };

try
{
    Console.WriteLine("ffs");
    proc.Start();
    Console.WriteLine("yeaaaaa");
}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}

Crash happens on Start() method invocation.

Works then I run it without debugger, it passes executes normally (outputs what it should in this case).

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 16, 2023
@ghost
Copy link

ghost commented Sep 16, 2023

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Latest EndeavourOS Arch Linux with JetBrainsRider 2023.2.1#RD-232.9559.61

$ dotnet --list-sdks
8.0.100-rc.1.23455.8 [/home/vini/dotnet/sdk]
$ dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/home/vini/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/home/vini/dotnet/shared/Microsoft.NETCore.App]

Project.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.11" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.11" />
  </ItemGroup>

</Project>

Program.cs

using System.Diagnostics;

var procStartInfo = new ProcessStartInfo()
{
    FileName = "/bin/bash",
    Arguments = "yes",
    UseShellExecute = false,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
};

using var proc = new Process() { StartInfo = procStartInfo,  };

try
{
    Console.WriteLine("ffs");
    proc.Start();
    Console.WriteLine("yeaaaaa");
}
catch (Exception e)
{
    Console.WriteLine(e.ToString());
}

Crash happens on Start() method invocation.

Works then I run it without debugger, it passes executes normally (outputs what it should in this case).

Reproduction Steps

.

Expected behavior

.

Actual behavior

.

Regression?

.

Known Workarounds

.

Configuration

.

Other information

.

Author: vini-nu
Assignees: -
Labels:

area-System.Diagnostics.Process

Milestone: -

@vini-nu
Copy link
Author

vini-nu commented Sep 16, 2023

https://www.nuget.org/packages/CliWrap

This library is affected by this issue as well, because it uses underlying System.Diagnostics.Process too.

        using System.Text;
        using CliWrap;

        var stdOutBuffer = new StringBuilder();
        var stdErrBuffer = new StringBuilder();

        await Cli.Wrap("date")
            .WithStandardOutputPipe(PipeTarget.ToStringBuilder(stdOutBuffer))
            .WithStandardErrorPipe(PipeTarget.ToStringBuilder(stdErrBuffer))
            .ExecuteAsync(ct);

        var stdOut = stdOutBuffer.ToString();
        var stdErr = stdErrBuffer.ToString();
        
        if(stdOut.Any())_l.LogInformation(stdOut);
        if(stdErr.Any())_l.LogError(stdErr);

@vini-nu
Copy link
Author

vini-nu commented Sep 16, 2023

Works when .NET is at older 7.0.11

@jkotas
Copy link
Member

jkotas commented Sep 16, 2023

Thank you for reporting this issue. This was fixed by #90826. The fix is included in .NET 8 RC2.

@jkotas jkotas closed this as completed Sep 16, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Sep 16, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants