I’m encountering a hard crash when using IL2CPP in the player.
Read from location 0000000000000070 caused an access violation.
The stack trace usually points to somewhere like this:
Stack Trace of Crashed Thread 36920:
0x00007FF9F2F50356 (GameAssembly) [<build\il2cppOutput\cpp\Generics104.cpp:18587]
Generics104.cpp is part of the IL2CPP output. The last bit of my code in the stack is this:
private void OpenRoomChannel([NotNull] string room, [NotNull] ChannelProperties config)
{
if (room == null) throw new ArgumentNullException("room");
if (config == null) throw new ArgumentNullException("config");
using (var delta = _deltas.Lock())
delta.Value.Add(new ChannelDelta(true, ChannelType.Room, config, room.ToRoomId(), room));
}
Going by the name in the IL2CPP generated file, I assume the problem is related to generics. The only generic type in this code is the “_deltas” field, which is an instance of "
ReadonlyLockedValue<List>" (i.e. a generic type, which a type parameter which is itself generic).
Has anyone else encountered a miscompile by IL2CPP like this? And more importantly does anyone have a suggested workaround?
Nb. I have reported this bug to Unity, but they’re not responding quickly so a workaround is really quite important!
Do you have a dump file or a full call stack from the crash? We will investigate the bug report, but with a call stack we might be able to help find a work around.