dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.07k stars 4.69k forks source link

Arm32: System.Threading.Tasks.Dataflow.Tests failing with NRE #80857

Closed jkotas closed 1 year ago

jkotas commented 1 year ago

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=140623 Build error leg or test failing: System.Threading.Tasks.Dataflow.Tests.WorkItemExecution Pull request: https://github.com/dotnet/runtime/pull/80323

Error Message

Fill the error message using known issues guidance.

{
  "ErrorMessage": "System.Threading.Tasks.ConcurrentExclusiveSchedulerPair.ProcessConcurrentTasks",
  "BuildRetry": false
}

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
ghost commented 1 year ago

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

Issue Details
## Build Information Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=140623 Build error leg or test failing: System.Threading.Tasks.Dataflow.Tests.WorkItemExecution Pull request: https://github.com/dotnet/runtime/pull/80323 ## Error Message Fill the error message using [known issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/KnownIssues.md#how-to-fill-out-a-known-issue-error-message-section). ```json { "ErrorMessage": "System.Threading.Tasks.ConcurrentExclusiveSchedulerPair.ProcessConcurrentTasks", "BuildRetry": false } ```
Author: jkotas
Assignees: -
Labels: `arch-arm32`, `area-System.Threading.Tasks`, `blocking-clean-ci`, `untriaged`, `Known Build Error`
Milestone: -
stephentoub commented 1 year ago

According to the stack trace, the NRE is occurring here: https://github.com/dotnet/runtime/blob/31e4f404c218eae7ba999c4df5346d30f971451c/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs#L422-L441 on the line:

if (!concurrentTask.IsFaulted) m_concurrentTaskScheduler.ExecuteTask(concurrentTask); 

The only state being read here are readonly fields initialized in the ctor or the concurrentTask that's read from the queue. The queue is either a ConcurrentQueue<T> or a: https://github.com/dotnet/runtime/blob/main/src/libraries/Common/src/System/Collections/Concurrent/SingleProducerSingleConsumerQueue.cs It's not clear from the stack trace what exact test is failing and thus which queue is in use, but my money is on there either being a bug around the use (or lack thereof) of volatile accesses in the SPSCQ or a codegen bug on arm32, resulting in the concurrentTask dequeued from the queue being read as null.

VSadov commented 1 year ago

failed in https://github.com/dotnet/runtime/pull/84151

ericstj commented 1 year ago

codegen bug on arm32, resulting in the concurrentTask dequeued from the queue being read as null.

Given we have zero recent hits of this I'm leaning towards this as the cause. Closing this as no-repo. Reactivate if the failures show up again.