-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
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
- Clone the project @ https://github.com/budgetdevv/JITBugRepro
- Run
Program.cslocated in theBugReprofolder
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.ConcurrentDictionarybundled in referenced project -
Services.GetRequiredService<MemberDB>()calls into ctor, which calls ConnectionPool.CreateOrGetConnection("") which reads from a static readonlyNonBlocking.ConcurrentDictionaryfield -
Services.GetRequiredService<InvitesModule>().OnReady()contains a foreach loop that writes into aNonBlocking.ConcurrentDictionary. The write happens after anawait, which might also be responsible for the weird behavior -
This bug seems to be caused by tiered compilation ( GDB mentioned TC and threadpool thread )