Search Issue Tracker
Fixed in 2022.3.8f1
Fixed in 2022.2.X, 2022.3.X, 2023.1.X, future release
Votes
0
Found in
2022.2.12f1
Issue ID
UUM-31808
Regression
No
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
Original report:
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.
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
agboephraim20
Mar 29, 2023 02:16
Please anybody has a fix to this?