Search Issue Tracker
By Design
Votes
0
Found in
2022.3.60f1
6000.0.44f1
6000.1.0b11
6000.2.0a7
Issue ID
UUM-100750
Regression
No
[Linux] Crash on System.Runtime.InteropServices.Marshal:copy_from_unmanaged_fixed when accessing shared memory
Reproduction steps:
1. Open the attached “IN-97299” project
2. Enter the Play Mode
OR
2. Build and run the project (File > Build And Run)
3. Observe the Player
Expected result: Editor or Player runs without issues
Actual result: Editor and Player crashes
Reproducible with: 2022.3.60f1, 6000.0.44f1, 6000.1.0b11, 6000.2.0a7
Reproducible on: Ubuntu 24.04
Not reproducible on: No other environment tested
First lines of the stack trace:
#2 0x007f100120ca80 in __memmove_avx_unaligned_erms
#3 0x007f0ee11ee69e in (Unknown)
#4 0x007f0ee11d5806 in (Unknown)
#5 0x000000405fbc61 in (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:copy_from_unmanaged_fixed (intptr,int,System.Array,int,void*)
#6 0x00000040637817 in System.Runtime.InteropServices.Marshal:Copy (intptr,byte[],int,int)
#7 0x00000041a57df3 in FrameReceiver:Update ()
#8 0x00000040f22e85 in (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
The sample provided is calling Marshal.Copy with -1 as the source pointer.
Reading through the log files provided with the bug repo it appears that the call to shmat is failing to map the memory and sharedMemory is set to -1. In the Update call the if check does not account for the -1 case, only 0, and allows the call to proceed to copy. This is raising the crash.