IL2CPP Error In Player Build

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.

1 Like

I’ve attached the full crash report folder which includes a dump and the log. Thanks :slight_smile:

7658290–955609–Crash_2021-11-15_141750198.zip (55.5 KB)

Thanks - can you share GameAssembly.pdb with me (privately, via a direct message) with me as well?

I’ve sent you that in a direct message :slight_smile:

1 Like

We are also experiencing this issue in all version of 2021.2 after b15 up until current version.

1 Like

If you can submit another bug report, please do so. The more examples we have, the easier it will be isolate the cause, I think.

1 Like

@JoshPeterson It is the same use case as @Nyarlathothep

1 Like

Ok then, we will investigate the existing bug report. Thanks!

1 Like

@JoshPeterson Thank you very much, it would be great to get this sorted out so that we can upgrade to latest Unity version :slight_smile:

1 Like

@Nyarlathothep I just tested in latest Unity 2021.2 version released today (via remote desktop), seems to work now - can you please confirm? Thanks!

I just tested it in 2021.2.3f1 and it seems to be fixed :smile:

2 Likes