Repository navigation
Description
Description
On iOS, a .NET app running on CoreCLR is terminated by the OS a few seconds after it is
backgrounded, with EXC_CRASH (SIGKILL), RUNNINGBOARD, code 0xdead10cc. RunningBoard names
the offending file: the app's own PDB, inside the app bundle.
RunningBoard terminated [app<com.example.app>:1710] because it was suspended
while holding a shared file lock:
/var/containers/Bundle/Application/<uuid>/MyApp.app/MyApp.pdb
File locks MUST be held in one of the following directories:
/var/mobile/Containers/Data/Application/<uuid>
/var/mobile/Containers/Data/Application/<uuid>/tmp
Debug builds only — a Release build ships no PDB and is unaffected. This is a regression from the
switch to CoreCLR as the iOS runtime in .NET 11 (Mono read symbols through a different path).
Analysis
-
StackTraceSymbols.TryOpenFileopens the PDB on the first stack trace that needs line numbers:// Open the file with read and delete FileShare flags. This matches what dll loading does return new FileStream(path!, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
-
On Unix, any
FileShareother thanNonemaps toflock(LOCK_SH)
(SafeFileHandle.Unix.cs,CanLockTheFile/LockOperations.LOCK_SH). -
The resulting
MetadataReaderProvideris cached in a
ConditionalWeakTable<Assembly, MetadataReaderProvider?>. The key is the assembly, which lives
for the whole process, so the lock is never released. -
At suspension, RunningBoard sees a file lock outside the app's data container and kills the app.
Setting System.IO.DisableFileLocking=true makes the termination disappear (verified on device,
iPad A16 / iOS 26.6.2), which confirms the chain — but it is a process-wide switch and disables
FileShare semantics everywhere, so it is not an acceptable general answer.
The comment's rationale does not hold on Unix: dlopen takes no advisory lock, so the shared
flock is not "what dll loading does" there.
Proposed fix
Open the PDB with FileShare.ReadWrite | FileShare.Delete, which takes no advisory lock on Unix.
Nothing is lost: the file is opened read-only for symbol reading, and FileShare.Delete already
allows it to be removed underneath the reader.
Repro
.NET 11 RC1 MAUI app, net11.0-ios, Debug, on a device (not the simulator — it is not suspended
the same way). Launch from the home screen, background it for 40 s (the kill happens at
suspension, not on entering the background), return. The app has been killed and cold-starts.
Objective check: sample the process id throughout, or read the RunningBoard log from a
sysdiagnose. Note that the crash report is not reliable as a signal — iOS throttles writing them
when the same app dies repeatedly.
I am happy to send the one-line PR if you would like it.
Activity
dotnet-policy-service commentedon Sep 11, 2026
Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.
Do not hold a file lock on the PDB read for stack trace symbols
dotnet-policy-service commentedon Sep 11, 2026
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Sep 14, 2026
Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Sep 14, 2026
Tagging subscribers to this area: @steveisok, @dotnet/area-system-diagnostics
See info in area-owners.md if you want to be subscribed.
Disable file locking by default on iOS and tvOS (#134060)
[release/11.0] Disable file locking by default on iOS and tvOS (#134331)