This affects me too: Ubuntu 26.04, amd64, dotnet-runtime-10.0
10.0.15-0ubuntu1~26.04.1, libunwind8 1.8.3-0ubuntu1.

A long-running .NET 10 service aborted with Fatal error. Internal CLR
error. (0x80131506) eight times, each in the same step of its test
suite, where a freshly started instance aborts about 150 stalled
requests together — so its first exceptions are thrown on many threads
at once. The four crashes that kept a crash report all show a thread-
pool worker crashed with its runtime frames identical to the offset,
named here against dotnet-runtime-10.0-dbgsym 10.0.15-0ubuntu1~26.04.1:

IL_Throw                              (jithelpers.cpp:793)
SoftwareExceptionFrame::InitAndLink   (excep.cpp:11455)
SoftwareExceptionFrame::Init          (excep.cpp:11434)  -- PAL_VirtualUnwind 
returned false
EEPolicy::HandleFatalError            (eepolicy.cpp:861)

This package's libcoreclr.so needs libunwind.so.8 and
libunwind-x86_64.so.8 (readelf -d). In libunwind 1.8.3, _write_validate
in libunwind's src/mi/Gaddress_validator.c validates each address
through one process-global pipe, with nothing serialising it across
threads. Upstream libunwind/libunwind#993, merged 2026-04-24, makes that
pipe per-thread; no libunwind release carries it yet, and libunwind8's
changelog shows no backport. dotnet/runtime#130577 reports the same
stack on Ubuntu's .NET 10 packages and was closed as an external issue,
its maintainers saying that Microsoft's builds use their own copy of
libunwind.

A minimal reproducer with no dependencies — 64 threads each throwing and
catching 500 exceptions — killed 11 of 100 fresh processes on this
machine with the same error, exit 134, in about 14 seconds; armed for
crash reports, the reports carry the runtime frames above, identical to
the offset. The window is the first use: with one exception thrown and
caught on the main thread before the threads start, 0 of 100 died. That
fits what the 1.8.3 source shows — _write_validate sets
_unw_address_validator_initialized before _open_pipe() has filled
_mem_validate_pipe, so threads validating at the same first moment read
descriptor -1, take the "re-open closed pipe" path, and close and re-
create the pipe under each other:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <AssemblyName>repro688</AssemblyName>
  </PropertyGroup>
</Project>

using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;

var threads = int.Parse(args[0]);
var throwsEach = int.Parse(args[1]);
var go = new ManualResetEventSlim(false);
var all = new Thread[threads];
for (var i = 0; i < threads; i++)
{
    all[i] = new Thread(() =>
    {
        go.Wait();
        for (var j = 0; j < throwsEach; j++)
        {
            try { Thrower(j); } catch (IOException) { }
        }
    });
    all[i].Start();
}
Thread.Sleep(50);
go.Set();
foreach (var t in all) t.Join();
Console.WriteLine("ok");

[MethodImpl(MethodImplOptions.NoInlining)]
static void Thrower(int j) => throw new IOException("planted " + j);


Could libunwind be added to this bug, and libunwind#993 backported to 
libunwind8 for 26.04 — or dotnet10 built against its bundled libunwind?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2163034

Title:
  dotnet crashed with SIGABRT — fatal CLR error 0x80131506 in
  SoftwareExceptionFrame::Init (PAL_VirtualUnwind failure) during dotnet
  test

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dotnet10/+bug/2163034/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to