Search Issue Tracker
Under Consideration for 2022.2.X, 2023.1.X, 2023.2.X
IL2CPP Player crashes when there aren't enough Thread Static Slots
There are currently no reproduction steps
Reproducible with: 2022.2.12f1
Reproducible on: Windows 10
1. What happened:
I've been debugging a crash issue for our game that occurs on IL2CPP on Windows and to cut a long winding road short I've discovered that the solution to the problem is to double the size of `kMaxThreadStaticSlots` in `Thread.cpp` from 2048 to 4096. This seems to allow our game to successfully run.
2. How can we reproduce it using the example you attached:
I spoke to Joshua Peterson and he requested I submit a bug report. The project is too big to submit here. Contact us if you require the project to repro, but it is an accepted short-coming if not a bug.
Joshua Peterson wrote:
Thanks for raising this issue! The problem here is that the libil2cpp runtime can hold thread static data for a limited number of types, currently 2048. So far this is the first case we know of where this limitation is a problem. We certainly could look to grow that limitation as necessary, but that comes with some performance costs (hence the hard-coded limitation).
I'm curious about the conditions under which this happens in your case. You mentioned full generic sharing in the subject of this message, does that setting impact this problem?
Regarding a solution, you can locally modify the code to increase this value to 4096. The result will be an increase in memory usage, but that will only be the additional 2048 entries times the size of a pointer, so 2048 * 8 bytes on 64-bit architectures. You can make this change in the code that ships with the Unity editor. Is that something you can scale across your developers, so they all have access to it, at least temporarily?
Longer term, we need to either increase this limit or come up with a solution to grow it that has good performance characteristics. For this, can you submit a bug report? That will be the best way for us to track the issue and provide feedback to you about it.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Android] TouchScreenKeyboard.active triggers an error when set to false in the Player
- [Android] Auto-correct suggestions show up over the "hidden zone" when typing text with TouchScreenKeyboard
- [Android] Clicks on the "hidden zone" remain blocked when TouchScreenKeyboard is active
- [URP][DX12] Black Game View window when URP Dynamic Resolution is enabled
- VideoPlayer.Time is not updated when seeking is completed
Mar 29, 2023 02:18
Heavily gifted Ghanaian rapper and singer Jay Bahd, unveils a brand new single on basenaija.com named "Yaa Baby". Jay Bahd’s new delivery serves as a sequel to his previous delivery named "Anadwo"
Mar 29, 2023 02:16
Please anybody has a fix to this?