Skip to content

Project segfaults on Ubuntu ( ARM64 ) #76051

@budgetdevv

Description

@budgetdevv

Description

The project @ https://github.com/budgetdevv/JITBugRepro segfaults on my Ubuntu ( ARM64 ) machine when ran. However, it seems to run fine on my Windows x64 machine.

Reproduction Steps

  1. Clone the project @ https://github.com/budgetdevv/JITBugRepro
  2. Run Program.cs located in the BugRepro folder

Expected behavior

The program should run indefinitely, given that there is an await Task.Delay(Timeout.Infinite)

Actual behavior

The program segfaults. Interestingly, Services.GetRequiredService<InvitesModule>().OnReady() is ran to completion ( The program prints "Bleh" ) before segfaulting. When debugging with GDB, the program exited with Thread 7 ".NET Tiered Com" received signal SIGSEGV, Segmentation fault..

Both of which suggest to me that it is a JIT bug.

Regression?

No response

Known Workarounds

Use Windows :p

Configuration

Which version of .NET is the code running on?

  • .NET 7 RC 1

What OS and version, and what distro if applicable?

  • Ubuntu 20.04.3 LTS (GNU/Linux 5.15.0-1017-oracle aarch64)

What is the architecture (x64, x86, ARM, ARM64)?

  • ARM64

Do you know whether it is specific to that configuration

  • Seems to be the case, it works on my Windows x64 machine

Other information

Suspects

  • Executing project using NonBlocking.ConcurrentDictionary bundled in referenced project

  • Services.GetRequiredService<MemberDB>() calls into ctor, which calls ConnectionPool.CreateOrGetConnection("") which reads from a static readonly NonBlocking.ConcurrentDictionary field

  • Services.GetRequiredService<InvitesModule>().OnReady() contains a foreach loop that writes into a NonBlocking.ConcurrentDictionary. The write happens after an await, which might also be responsible for the weird behavior

  • This bug seems to be caused by tiered compilation ( GDB mentioned TC and threadpool thread )

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions