Search Issue Tracker
By Design
Votes
1
Found in
2018.4
2019.3.0f3
2020.2
Issue ID
1216172
Regression
No
NativeArray safety checks within the Job System are incorrectly carried over into a job using GCHandle to access the same data
Reproduction steps:
1. Open the attached project ("case_1216172-JobSystemSafetyCheckBugReport.zip")
2. Open the repro scene ("SampleScene")
3. Enter Play Mode
4. Inspect Console
Expected result: No errors are thrown
Actual result: "InvalidOperationException: The NativeArray<Int32> UNKNOWN_JOB_FIELD has been declared as [ReadOnly] in the job UNKNOWN_JOB, but you are writing to it." error is thrown
Reproducible with: 2018.4.18f1, 2019.3.5f1, 2020.1.0b1, 2020.2.a2
Couldn't test with 2017.4 (some methods were not supported yet)
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
- Sprites are not generated when using Fallback Sprite Assets
- Spot light with high Outer Spot Angle produces artefacts/clipping when using the Forward+ Rendering Path
- NullReferenceException is thrown when selecting a Diffusion Profile
- Colliders of GameObject with Rigidbody component fail to collide with another GameObject when Rigidbody becomes Kinematic
- Shader cache uploads occur when the "Upload" parameter is disabled in the Cache Server settings
Resolution Note:
The jobs safety system does not support passing GCHandles to NativeArray data; it can't (and won't) correctly track accesses through the GCHandle.