Skip to content

[Regression] SIGSEGV on linux-arm64 self-contained trimmed single-file .NET 9 app #108327

@JustArchi

Description

@JustArchi

Description

Hey, I'm currently updating my ASF project to .NET 9 (rc1), during testing it seems that linux-arm64 build results in SIGSEGV during running.

It's important to note that self-contained publish, trimmed publish as well as single-file publish all work fine. It's a combination of single-file trimmed publish for linux-arm64 that triggers this.

Reproduction Steps

If you want to just run the resulting app, https://github.com/JustArchiNET/ArchiSteamFarm/actions/runs/11056649514/artifacts/1983547331, unzip then ./ArchiSteamFarm.

If you want to build and reproduce from source, which is probably what you're after:

git clone https://github.com/JustArchiNET/ArchiSteamFarm --recursive --depth 1000 --branch net9
cd ArchiSteamFarm
git checkout 093521880df3281fa2f768c6ddfead4895a66006 # Faulty commit just in case
dotnet publish ArchiSteamFarm -c Release -o out -r linux-arm64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained
./out/ArchiSteamFarm # Should crash with Segmentation fault, not produce any other console output

Expected behavior

Program should run like expected - starting, not crashing, printing stuff on the console.

Actual behavior

Process crashes with SIGSEGV before it manages to do anything productive. I've tried gdb but I'm not an expert in this matter, attaching the results anyway below.

Starting program: /tmp/asftest/ArchiSteamFarm 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff79fefa0 (LWP 74416)]
[New Thread 0x7ffff71eefa0 (LWP 74417)]
[New Thread 0x7ffff69cefa0 (LWP 74418)]
[New Thread 0x7ffff61befa0 (LWP 74419)]
[New Thread 0x7ffff5876fa0 (LWP 74420)]
[New Thread 0x7ffff497afa0 (LWP 74421)]

Thread 1 "ArchiSteamFarm" received signal SIGSEGV, Segmentation fault.
0x00005555559a6c30 in ?? ()
(gdb) bt
#0  0x00005555559a6c30 in ?? ()
#1  0x000055555592c98c in ?? ()
#2  0x0000555555d27f14 in ?? ()
#3  0x0000555555d320f4 in ?? ()
#4  0x0000555555d34434 in ?? ()
#5  0x0000555555d097f0 in ?? ()
#6  0x0000555555e6c30c in ?? ()
#7  0x0000555555cc90bc in ?? ()
#8  0x0000555555ccbb4c in ?? ()
#9  0x0000555555ccb224 in ?? ()
#10 0x0000555555ccc5cc in ?? ()
#11 0x0000555555cc2cdc in ?? ()
#12 0x0000555555940db8 in ?? ()
#13 0x0000555555940f58 in ?? ()
#14 0x0000555555941914 in ?? ()
#15 0x0000555555979860 in ?? ()
#16 0x000055555597924c in ?? ()
#17 0x0000555555978904 in ?? ()
#18 0x0000555555978460 in ?? ()
#19 0x00005555558ef254 in ?? ()
#20 0x000055555597cd78 in ?? ()
#21 0x000055555597c8b8 in ?? ()
#22 0x0000555555b6bdf4 in ?? ()
#23 0x000055554d6e43c8 in ?? ()
#24 0x00007fbfe28026b0 in ?? ()
#25 0x00005555559a4e68 in ?? ()
#26 0x00005555560e50f0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Regression?

Yes, .NET 8 worked fine in this scenario. Other .NET 9 variants work fine as well in the same settings, which heavily suggest that this is isolated linux-arm64 runtime regression.

Known Workarounds

None, using other variants such as linux-x64 works fine though.

Using only trimming, only single file publishing or nothing at all works as well.

Configuration

NET SDK:
 Version:           9.0.100-rc.1.24452.12
 Commit:            81a714c6d3
 Workload version:  9.0.100-manifests.67cd1eb6
 MSBuild version:   17.12.0-preview-24422-09+d17ec720d

Runtime Environment:
 OS Name:     debian
 OS Version:  
 OS Platform: Linux
 RID:         linux-arm64
 Base Path:   /usr/share/dotnet/sdk/9.0.100-rc.1.24452.12/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
  Version:      9.0.0-rc.1.24431.7
  Architecture: arm64
  Commit:       static

.NET SDKs installed:
  9.0.100-rc.1.24452.12 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Like above, you need linux-arm64 trimmed single-file build. I've reproduced it on Raspberry Pi 5 running standard Raspberry Pi OS (lite) updated to current Debian testing sources. I doubt it's linked with some specific hardware though, so any other linux-arm64 machine should be sufficient as well.

Other information

Discovered while working on JustArchiNET/ArchiSteamFarm#3244 (comment)

Let me know if there is any more information I can provide.

Metadata

Metadata

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions