runtime icon indicating copy to clipboard operation
runtime copied to clipboard

NRE in System.Text.RegularExpresssions on ARM64

Open anmalkov opened this issue 4 years ago • 21 comments

Steps to reproduce

  1. Create a new app in VS from template "ASP.NET Core with React.js"
  2. Name a project and solution as "testspa"
  3. Select .NET 7
  4. Create Dockerfile in the solution file directory:
FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy-arm64v8 AS base
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1-mesa-glx
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy-arm64v8 AS build
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1-mesa-glx
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
WORKDIR /src
COPY ["testspa/testspa.csproj", "testspa/"]
RUN dotnet restore "testspa/testspa.csproj"
COPY . .
WORKDIR "/src/testspa"
RUN dotnet build "testspa.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "testspa.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "testspa.dll"]
  1. Open terminal and go to solution directory
  2. Build an image:
docker build -t testspa .

Expected result:

A solution should be built and container image should be created

Actual result:

dotnet restore command fails with:

------
 > [build  9/12] RUN dotnet restore "testspa/testspa.csproj":
dotnet/msbuild#21 15.85 MSBUILD : error : This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled. [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :     System.NullReferenceException: Object reference not set to an instance of an object. [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Regex1_Scan(RegexRunner, ReadOnlySpan`1) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.ScanInternal(RegexRunnerMode mode, Boolean reuseMatchObject, String input, Int32 beginning, RegexRunner runner, ReadOnlySpan`1 span, Boolean returnNullIfReuseMatchObject) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String inputString, ReadOnlySpan`1 inputSpan, Int32 startat, TState& state, MatchCallback`1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String input, Int32 startat, TState& state, MatchCallback`1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Expander`2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation, LoggingContext loggingContext) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemDefinitionElement(ProjectItemDefinitionElement itemDefinitionElement) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemDefinitionGroupElement(ProjectItemDefinitionGroupElement itemDefinitionGroupElement) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate() [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary`2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable`1 projectLoadSettings, EvaluationContext evaluationContext) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Execution.ProjectInstance..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable`1 projectLoadSettings) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.BuildRequestConfiguration.<>c__DisplayClass60_0.<LoadProjectIntoConfiguration>b__0() [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(BuildParameters buildParameters, Func`1 loadProjectFromFile) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport() [/src/testspa/testspa.csproj]
------

Debian

If you try to do the same but with the base image with tag 7.0-bullseye-slim-arm64v8 which is based on Debian, the dotnet restore command also fails with:

------
 > [build  9/12] RUN dotnet restore "testspa/testspa.csproj":
dotnet/msbuild#22 17.28 /usr/share/dotnet/sdk/7.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(55,5): error MSB4184: The expression "[MSBuild]::GetTargetFrameworkVersion(net7.0, 2)" cannot be evaluated. Exception has been thrown by the target of an invocation. [/src/testspa/testspa.csproj]
------

.NET 7 on Linux amd64

Everything works well if I use the base images with the tag "7.0" which is targeted amd64. So, it is an ARM issue.

.NET 6 on ARM

If you run the same on .NET6 everything works perfectly with Ubuntu and Debian base images for ARM64v8.

anmalkov avatar Nov 11 '22 19:11 anmalkov

@anmalkov is the host machine you're running on ARM64, or are you using Docker's built in qemu ARM64 emulation?

The expression "[MSBuild]::GetTargetFrameworkVersion(net7.0, 2)" cannot be evaluated. Exception has been thrown by the target of an invocation.

This one is tracked by NuGet/Home#12227.

rainersigwald avatar Nov 14 '22 20:11 rainersigwald

I don't see anything in the MSBuild-layer calls to RegularExpression.Replace that look fishy (or have been touched in a couple years)

https://github.com/dotnet/msbuild/blob/d14b74d6f08ab7f2e17706359a38f8c22b569cb5/src/Build/Evaluation/Expander.cs#L901-L957

So I'm going to rename + reroute this to the regex folks in dotnet/runtime.

rainersigwald avatar Nov 14 '22 20:11 rainersigwald

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

ghost avatar Nov 14 '22 20:11 ghost

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

Issue Details

Steps to reproduce

  1. Create a new app in VS from template "ASP.NET Core with React.js"
  2. Name a project and solution as "testspa"
  3. Select .NET 7
  4. Create Dockerfile in the solution file directory:
FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy-arm64v8 AS base
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1-mesa-glx
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy-arm64v8 AS build
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1-mesa-glx
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
WORKDIR /src
COPY ["testspa/testspa.csproj", "testspa/"]
RUN dotnet restore "testspa/testspa.csproj"
COPY . .
WORKDIR "/src/testspa"
RUN dotnet build "testspa.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "testspa.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "testspa.dll"]
  1. Open terminal and go to solution directory
  2. Build an image:
docker build -t testspa .

Expected result:

A solution should be built and container image should be created

Actual result:

dotnet restore command fails with:

------
 > [build  9/12] RUN dotnet restore "testspa/testspa.csproj":
dotnet/msbuild#21 15.85 MSBUILD : error : This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled. [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :     System.NullReferenceException: Object reference not set to an instance of an object. [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Regex1_Scan(RegexRunner, ReadOnlySpan`1) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.ScanInternal(RegexRunnerMode mode, Boolean reuseMatchObject, String input, Int32 beginning, RegexRunner runner, ReadOnlySpan`1 span, Boolean returnNullIfReuseMatchObject) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String inputString, ReadOnlySpan`1 inputSpan, Int32 startat, TState& state, MatchCallback`1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String input, Int32 startat, TState& state, MatchCallback`1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at System.Text.RegularExpressions.Regex.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Expander`2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation, LoggingContext loggingContext) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemDefinitionElement(ProjectItemDefinitionElement itemDefinitionElement) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemDefinitionGroupElement(ProjectItemDefinitionGroupElement itemDefinitionGroupElement) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate() [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary`2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable`1 projectLoadSettings, EvaluationContext evaluationContext) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.Execution.ProjectInstance..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable`1 projectLoadSettings) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.BuildRequestConfiguration.<>c__DisplayClass60_0.<LoadProjectIntoConfiguration>b__0() [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(BuildParameters buildParameters, Func`1 loadProjectFromFile) [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() [/src/testspa/testspa.csproj]
dotnet/msbuild#21 15.85 MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport() [/src/testspa/testspa.csproj]
------

Debian

If you try to do the same but with the base image with tag 7.0-bullseye-slim-arm64v8 which is based on Debian, the dotnet restore command also fails with:

------
 > [build  9/12] RUN dotnet restore "testspa/testspa.csproj":
dotnet/msbuild#22 17.28 /usr/share/dotnet/sdk/7.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(55,5): error MSB4184: The expression "[MSBuild]::GetTargetFrameworkVersion(net7.0, 2)" cannot be evaluated. Exception has been thrown by the target of an invocation. [/src/testspa/testspa.csproj]
------

.NET 7 on Linux amd64

Everything works well if I use the base images with the tag "7.0" which is targeted amd64. So, it is an ARM issue.

.NET 6 on ARM

If you run the same on .NET6 everything works perfectly with Ubuntu and Debian base images for ARM64v8.

Author: anmalkov
Assignees: -
Labels:

area-System.Text.RegularExpressions, untriaged

Milestone: -

ghost avatar Nov 15 '22 16:11 ghost

@anmalkov is the host machine you're running on ARM64, or are you using Docker's built in qemu ARM64 emulation?

I'm building the image on Windows 11, so, on emulation. However, I want to run the container on ARM64

anmalkov avatar Nov 17 '22 12:11 anmalkov

So 7.x will not be usable on arm64 devices and we need to wait for 8.0?!

omanikhi avatar Apr 12 '23 16:04 omanikhi

We run a bazillion regex tests on ARM64, and to my knowledge we've never seen such an NRE. It's far from "not usable".

Do you have a standalone repro with just regex that shows the problem you're hitting?

stephentoub avatar Apr 12 '23 17:04 stephentoub

We run a bazillion regex tests on ARM64, and to my knowledge we've never seen such an NRE. It's far from "not usable".

Do you have a standalone repro with just regex that shows the problem you're hitting?

You're absolutely right about it being far from "not usable", perhaps I was a bit overdramatic in my choice of words.

It actually doesn't happen directly on ARM64 but rather under QEMU emulation of ARM64 (on Ubuntu over x64 in our case) which should be a common production build practice building the project on a non-ARM64 CI server.

I don't have a standalone example that reproduces it but I can certainly try to get one together if it helps.

omanikhi avatar Apr 12 '23 18:04 omanikhi

Thanks.

@richlander, @AndyAyersMS, do we support / test QEMU emulation of ARM64 on .NET 7?

I'm struggling at the moment to see how this could be an issue specific to regex.

stephentoub avatar Apr 12 '23 18:04 stephentoub

I don't believe running under QEMU is officially supported, but it would be nice if it worked. My guess is that this indicates a problem in QEMU.

IIRC there is some kind of verbose mode where QEMU can give you more details when it hits something it does not expect. @RobertHenry6bev ran into something like this (though he was emulating x64, not arm64) -- maybe he can suggest how to diagnose these cases.

AndyAyersMS avatar Apr 12 '23 19:04 AndyAyersMS

same issue: on WSL2 (ubuntu jammy x86_x64) when I run docker buildx bake -f docker-compose.yaml edit: for testing reason I also tried docker buildx build -t test --platform linux/arm64 . same result for ARM64 build used image: mcr.microsoft.com/dotnet/sdk:7.0-jammy-arm64v8

[build 5/6] RUN dotnet restore:
#0 7.385 MSBUILD : error : This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled. [/app/aspnetapp/proj.csproj]
#0 7.385 MSBUILD : error :     System.NullReferenceException: Object reference not set to an instance of an object. [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Regex1_Scan(RegexRunner, ReadOnlySpan`1) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at System.Text.RegularExpressions.Regex.ScanInternal(RegexRunnerMode mode, Boolean reuseMatchObject, String input, Int32 beginning, RegexRunner runner, ReadOnlySpan`1 span, Boolean returnNullIfReuseMatchObject) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String inputString, ReadOnlySpan`1 inputSpan, Int32 startat, TState& state, MatchCallback`1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String input, Int32 startat, TState& state, MatchCallback`1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at System.Text.RegularExpressions.Regex.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Evaluation.Expander`2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation, LoggingContext loggingContext) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemDefinitionElement(ProjectItemDefinitionElement itemDefinitionElement) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemDefinitionGroupElement(ProjectItemDefinitionGroupElement itemDefinitionGroupElement) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate() [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary`2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable`1 projectLoadSettings, EvaluationContext evaluationContext) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.Execution.ProjectInstance..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable`1 projectLoadSettings) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.BackEnd.BuildRequestConfiguration.<>c__DisplayClass61_0.<LoadProjectIntoConfiguration>b__0() [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(BuildParameters buildParameters, Func`1 loadProjectFromFile) [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() [/app/aspnetapp/proj.csproj]
#0 7.386 MSBUILD : error :    at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport() [/app/aspnetapp/proj.csproj]

moo-the-cow avatar Jun 05 '23 07:06 moo-the-cow

We are facing the same issue, too on Amazon Linux x86_x64

mhoeper avatar Jun 07 '23 08:06 mhoeper

So neither of you are using QEMU?

danmoseley avatar Jun 07 '23 12:06 danmoseley

Correct. The NullReferenceException happens as well locally, when I am building with Docker Desktop on Windows on my x86_x64 machine, using --platform linux/arm64 with FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

mhoeper avatar Jun 07 '23 14:06 mhoeper

So neither of you are using QEMU?

on my x86_x64 machine, using --platform linux/arm64

Targeting arm64 while running on x86/x64 hardware requires emulation. Is this ever happening without emulation?

stephentoub avatar Jun 07 '23 14:06 stephentoub

Looks like this issue is reproducible as reported from multiple persons and a Nullreference Exception in Regex1_Scan. This is a programming mistake in Msbuild as null check missing and should be easy to fix, right?

mhoeper avatar Jun 07 '23 19:06 mhoeper

Looks like this issue is reproducible as reported from multiple persons

All confirmed cases are using emulated arm64

This is a programming mistake in Msbuild as null check missing and should be easy to fix, right?

No.

stephentoub avatar Jun 07 '23 20:06 stephentoub

@RobertHenry6bev do you have any suggestions folks can try to gather more info here, per suggestion above?

danmoseley avatar Jun 07 '23 21:06 danmoseley

@jkotas what is the support status of .NET in QEMU -- and if not supported, how well is it known to work?

danmoseley avatar Jun 07 '23 23:06 danmoseley

Not supported. Documented here: https://github.com/dotnet/core/blob/main/release-notes/7.0/supported-os.md#qemu

It is known to be unusable for anything real.

jkotas avatar Jun 07 '23 23:06 jkotas