This may ultimately be a support request rather than a bug report, but after investigating at my end, I feel your input would be valuable here. We are getting reports in our Unity multiplayer game of occassional crashes, involving lots of joining/leaving lobbies typically. We have been sent the crash dumps, and whilst the reproduction steps are often all very different, in every case the actual crash is identical (we've had about a dozen of these). The callstack is:
Microsoft.Xbox.Services.dll!Microsoft::Xbox::Services::Multiplayer::Manager::MultiplayerMember::DebugGamertag::[Microsoft::Xbox::Services::Multiplayer::Manager::__IMultiplayerMemberPublicNonVirtuals::DebugGamertag]::get() Line 32
Microsoft.Xbox.Services.dll!Microsoft::Xbox::Services::Multiplayer::Manager::MultiplayerMember::[Microsoft::Xbox::Services::Multiplayer::Manager::__IMultiplayerMemberPublicNonVirtuals]::__abi_Microsoft_Xbox_Services_Multiplayer_Manager___IMultiplayerMemberPublicNonVirtuals____abi_get_DebugGamertag(Platform::String ^ * __abi_returnValue)
Multiplayer.dll!MultiplayerSessionMember_MemberCustomConstantsJson(Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionMember ^ self) Line 50
MultiplayerImport.dll.native!00000103b3e95e11()
![image](https://user-images.githubusercontent.com/294599/29915331-7684b6a8-8e33-11e7-8920-0a6867ec28fb.png)
The bottom of the callstack is coming from the Unity provided Multiplayer managed (C#) code; I'm not actually sure how (or if) I can get any more information from this crashdump. The next level of the callstack is:
CREATE_HostName(CREATE_HostName_Entry)
![image](https://user-images.githubusercontent.com/294599/29915481-eb53140c-8e33-11e7-96b9-f9ceb907aecb.png)
The next level I don't have source code for, but from the disassembly you can see it is going through each field in MultiplayerMember, it gets to debug_gamertag and crashes:
![image](https://user-images.githubusercontent.com/294599/29915586-28025516-8e34-11e7-9b4c-90b3834b028c.png)
The top of the callstack is:
DEFINE_PTR_PROP_GET_STR_OBJ(DebugGamertag, debug_gamertag);
![image](https://user-images.githubusercontent.com/294599/29915620-43bb677a-8e34-11e7-8b7f-6f302d9c4556.png)
My main clue is the initial native callstack item is called MultiplayerSessionMember_MemberCustomConstantsJson the bit in particular that interests me is the Json bit - it looks like something is attempting to turn a structure to JSON. I am not sure if this is to put it into a HTTP packet, or whether it is for debugging purposes. The fact it has got through the first few items in MultiplayerMember makes me think it isn't the MultiplayerMember structure itself which is causing the problem, but more specifically the debug_gamertag/DebugGamertag member/property. I wondered whether this 'debug' field can sometimes be null, and the calling code can't handle this? I did wonder whether the DEFINE_PTR_PROP_GET_STR_OBJ macro should have some extra if checks in? Possibly something like:
return ref new Platform::String((this == nullptr || m_cppObj == nullptr) ? "" : m_cppObj->##cppX().c_str());
Do you have any thoughts?