.NET 10.0.14 regression on Linux ARM64: named System.Threading.Mutex fails for non-root user, works on 10.0.12
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 18/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- csharp, linux
调研方向
The failure is in System.Threading.Mutex.CreateMutexCore when a named mutex is created by a non-root user on Linux ARM64, and it only reproduces when System.Private.CoreLib.dll and libcoreclr.so are both from 10.0.14. Start by building the four-line repro from the issue against 10.0.12 and 10.0.14 as a non-root user, then trace which native call returns the error. Done means the named mutex is created for an unprivileged user on 10.0.14 and the change passes the existing named-mutex tests.
由索引模型根据 Issue 内容生成。
描述
Description
After upgrading a self-contained Linux ARM64 application from .NET 10.0.12 to .NET 10.0.14, creation of a named System.Threading.Mutex fails with an IOException.
The same code:
- works on .NET 10.0.12
- fails on .NET 10.0.14
- works as root
- fails as an unprivileged user
- works for unnamed mutexes
- fails only for named mutexes
This appears to be a runtime regression in the interaction between System.Private.CoreLib.dll and libcoreclr.so. Through binary replacement tests, I isolated the failure to the 10.0.14 versions of those runtime components.
Reproduction Steps
Compile the following with .NET 10.0.12 and 10.0.14:
using System;
using System.Threading;
Console.WriteLine("Unnamed mutex");
using (var m = new Mutex())
{
Console.WriteLine("Unnamed OK");
}
Console.WriteLine("Named mutex");
using (var m = new Mutex(false, "NamedMutexTest"))
{
Console.WriteLine("Named OK");
}
Expected behavior
.NET 10.0.12:
Unnamed mutex
Unnamed OK
Named mutex
Named OK
Actual behavior
.NET 10.0.14:
Unnamed mutex
Unnamed OK
Named mutex
Unhandled exception. System.IO.IOException: The system cannot open the device or file specified. : 'NamedMutexTest'.
at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, NamedWaitHandleOptionsInternal options, Boolean& createdNew)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
at Program.
Regression?
Yes, works with 10.0.12
Known Workarounds
No response
Configuration
OS: Embedded Linux
Kernel: Linux 6.6.52
Architecture: aarch64 (ARM64)
User:
root -> works
mgnt -> fails
Deployment:
Self-contained
linux-arm64
Runtime:
.NET 10.0.12 -> works
.NET 10.0.14 -> fails
Other information
Additional Investigation
/dev/shm
Exists and is writable by the failing user:
su mgnt -s /bin/ash -c 'touch /dev/shm/test-mgnt'
Result:
-rw-r--r-- 1 mgnt system 0 ...
Filesystem:
tmpfs on /dev/shm
size=64K
38% used
User Permission Tests
The same executable:
root -> works
mgnt -> fails
However:
touch /dev/shm/test-mgnt
works for mgnt, so the user has write access to /dev/shm.
Runtime Isolation
Two self-contained deployments were compared:
Working
{
"name": "Microsoft.NETCore.App",
"version": "10.0.12"
}
Failing
{
"name": "Microsoft.NETCore.App",
"version": "10.0.14"
}
Using the failing application binaries together with the 10.0.12 runtime files works correctly.
Further binary replacement testing showed:
Runtime File Replaced
Resultlibcoreclr.so only -> works
System.Private.CoreLib.dll only -> works
both together (10.0.14 versions) -> fails
This suggests the problematic code path requires both the 10.0.14 managed and native runtime components.
- 主要语言
- C#
- 星标
- 18.4k
- 派生
- 5.8k
- 平均合并
- 2 天 14 小时
- 30 天内合并 PR
- 585
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/runtime 的其他 Issue
-
.NET 10 single-file publishing silently produces empty executables above 2 GiB due to integer overflow in BinaryUtils.WriteToStream可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area-Host untriaged
难度 2/5 1-3 小时 新手友好度 68/100
dotnet/runtime#137187 · 3 条评论 ·
维护者通常 1 天内回复
-
ImmutableSortedSet<T>.Builder: enumerating through IEnumerable<T> doesn't throw on modification and can return wrong items可能已有人在做 @aw0lid 于 1 天前认领。 未关闭area-System.Collections
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#137167 · 1 条评论 ·
维护者通常 1 天内回复
-
DbTransaction.SupportsSavepoints docs say Release/ReleaseAsync are expected to throw, but they are no-ops by design可能已有人在做 @alaricd 于 5 天前认领。 未关闭area-System.Transactions untriaged
难度 2/5 1-3 小时 新手友好度 72/100
dotnet/runtime#137040 · 1 条评论 ·
维护者通常 1 天内回复
-
FileSystemGlobbing: Matcher throws ArgumentOutOfRangeException when the rootDir is the same value as the file可能已有人在做 @makazeu 于 5 天前认领。 未关闭area-Extensions-FileSystem
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#136989 · 1 条评论 ·
维护者通常 1 天内回复
-
Configuration binder source generator emits unqualified List<T> when binding arrays without implicit usings可能已有人在做 @makazeu 于 5 天前认领。 未关闭area-Extensions-Configuration bug source-generator
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#136972 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
SubtitleEdit/subtitleedit#16825 ·
维护者通常 1 天内回复
-
ci-flake kind:tests size:S type:bug
难度 1/5 1 小时以内 新手友好度 82/100
elsa-workflows/elsa-foundation#4058 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
games-on-whales/wolf-ui#23 ·
-
Skills未关闭wayfinder:grilling
难度 2/5 1-3 小时 新手友好度 64/100
DigiBanks99/lopen#37 ·