Segmentation fault, Error MSB3073

Hi there!

First of all, I’ve tried all possible solutions out there but none of them worked.

  • I don’t have any spaces in my username
  • I have added quotes to $(MGCBPath) parameter
  • If I build the files with mgcb-editor manually, it works absolutely fine
  • The project successfully builds if I remove ball.png file from Content.mgcb (which literally means any picture file)

What I use:

  • Void Linux, musl-based with gcompat for glibc compatibility
  • dotnet-cli for Alpine Linux (because of musl)

Output when I run dotnet publish -c Development -r linux-x64:

Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  /home/makkusu/Temporary/MyGame/Content/ball.png
  Segmentation fault
/home/makkusu/.nuget/packages/monogame.content.builder.task/3.8.0.1641/build
/MonoGame.Content.Builder.Task.targets(138,5): error MSB3073: The command 
"dotnet "/home/makkusu/.nuget/packages/monogame.content.builder.task/3.8.0.1641/build//../tools/netcoreapp3.1/any/mgcb.dll" 
/quiet /@:"/home/makkusu/Temporary/MyGame/Content/Content.mgcb" 
/platform:DesktopGL /outputDir:"/home/makkusu/Temporary/MyGame/Content/bin/DesktopGL/Content"
/intermediateDir:"/home/makkusu/Temporary/MyGame/Content/obj/DesktopGL/Content" 
/workingDir:"/home/makkusu/Temporary/MyGame/Content/"" exited with code 139. 
[/home/makkusu/Temporary/MyGame/MyGame.csproj]

MonoGame.Content.Builder.Task.targets configuration (the part where execution happens):

<Target Name="RunContentBuilder" DependsOnTargets="PrepareContentBuilder">

     <!-- Execute MGCB from the project directory so we use the correct manifest. -->
     <Exec
       Condition="'%(ContentReference.FullPath)' != ''"
       Command="$(DotnetCommand) &quot;$(MGCBPath)&quot; $(MonoGameMGCBAdditionalArguments) /@:&quot;%(ContentReference.FullPath)&quot; /platform:$(MonoGamePlatform) /outputDir:&quot;%(ContentReference.ContentOutputDir)&quot; /intermediateDir:&quot;%(ContentReference.ContentIntermediateOutputDir)&quot; /workingDir:&quot;%(ContentReference.FullDir)&quot;"
       WorkingDirectory="$(MSBuildProjectDirectory)" />

     <ItemGroup>
       <ExtraContent
         Condition="'%(ContentReference.ContentOutputDir)' != ''"
         Include="%(ContentReference.ContentOutputDir)\**\*.*">
         <ContentDir>%(ContentReference.ContentDir)</ContentDir>
       </ExtraContent>
     </ItemGroup>

   </Target>

I cannot really understand what the problem is…