-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Segfault on SteamGameServerNetworkingSockets.SendMessages
#421
Comments
Is this an issue with my C# code, or I misunderstand the Steamworks documentation, or an issue with Steamworks itself? |
I suspect it is both, this looks extremely tricky. The immediate point of suspicion is that Then, and I might be reading the method signatures wrong here, but It also looks like you're not setting some of the fields on Lastly, since the data is not pinned or in any way retained for the native Steamworks components, the .NET memory manager is free to move the data around in memory and garbage-collect it while Steam is still trying to use it, which is bound to crash eventually. |
The free function is managed by Steamworks itself if I specify amount of bytes in |
I'm copying the data to the buffer Steam allocated and does manage and will free on its own with Marshal.Copy (at least that's what I think it should do), means .NET should not free the data that is.. not even managed, it's Steamworks allocated memory, unmanaged. I just copy my data to a pointer Steamworks gives me. |
But PtrToStructure might be why, I'll look into it. What should I use instead? Just casting the pointer to the needed type? That clearly didn't work, lol |
@rlabrecque and I do agree that it looks weird that the Steamworks documentation requires pointers, but we are passing an array of structs. |
I’m not sure if your game engine supports it or not, but Unsafe.AsRef is probably more correct here than PtrToStructure. Unless you want to copy it back with StructureToPtr? |
Alright, used Unsafe.AsRef, but don't think it helped still. Might consider passing array of pointers with custom Steamworks.NET build to see if it works. |
This may help you, I can't quite take a look at this deeper yet though |
So far NOT calling |
Hmm can you check this one out too: #388 |
This is due to Release indeed. Can we have it fixed so that it passes what it actually should, or make it accept an argument? |
Also please expose |
When calling
SteamGameServerNetworkingSockets.SendMessages
the Segmentation fault occurs in the following code:What could go wrong, what am I doing wrong? Same happens when I use
SteamGameServerNetworkingSockets.SendMessageToConnection
.The text was updated successfully, but these errors were encountered: