Search Issue Tracker
By Design
By Design in 1.7.X
Votes
0
Found in [Package]
1.7.3
Issue ID
BUR-2020
Regression
Yes
"Unable to find internal function `System.Buffer::InternalMemcpy`" error is thrown when entering Play Mode
How to reproduce:
1. Open the attached project “IN_14611”
2. Open the SampleScene in Scenes
3. Enter Play Mode
4. Observe the Console
Expected result: the error does not occur upon entering Play Mode
Actual result: the error appears when entering Play Mode for the first time after the BurstCache was created
Reproducible with: 1.7.3 (2021.3.4f1, 2021.3.10f1)
Not reproducible with: 1.7.3 (2020.3.39f1)
Couldn’t test with: 1.7.3 (2021.3.3f1, 2022.1.16f1, 2022.2.0b5, 2023.1.0a10 (due to compiler errors))
Reproducible on Windows 10 Pro
Notes:
- After deleting Burst Cache in ProjectRoot → Library issue appears again
- Not reproducible in Player
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
- Placeholder asset is not loaded with Advertisement Legacy sample when using the latest version of the package
- Addressables content build fails but the Player build is successful when building a development build
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
Resolution Note:
The problem is the calls to Marshal.ReadInt16() and Marshal.ReadInt32() inside the TestSystem.CopyDataFormat1 method. In some versions of Unity, those two calls end up calling System.Buffer.InternalMemcpy, which is unavailable to Burst. The fix is to replace Marshal.ReadInt16() and Marshal.ReadInt32() with custom implementations of those two methods.
The error message "unable to find internal function..." is admittedly unhelpful, since it doesn't point to the code that caused the problem and thus isn't actionable. We have this in our backlog as something we want to improve.
Resolution Note (1.7.X):
The problem is the calls to Marshal.ReadInt16() and Marshal.ReadInt32() inside the TestSystem.CopyDataFormat1 method. In some versions of Unity, those two calls end up calling System.Buffer.InternalMemcpy, which is unavailable to Burst. The fix is to replace Marshal.ReadInt16() and Marshal.ReadInt32() with custom implementations of those two methods.
The error message "unable to find internal function..." is admittedly unhelpful, since it doesn't point to the code that caused the problem and thus isn't actionable. We have this in our backlog as something we want to improve.