Segfault on `SteamNetworkingMessage_t.Release()`
See original GitHub issueHi there,
I’m running the latest (giturl) install of Steamworks.NET and am sending and receiving messages just fine it seems.
However when I call the recommended Release
method on a SteamNetworkingMessage_t
, I get a segfault.
My code is here:
try
{
SteamNetworkingMessage_t netMessage = Marshal.PtrToStructure<SteamNetworkingMessage_t>(receiveBuffers[0]);
byte[] message = new byte[netMessage.m_cbSize];
Marshal.Copy(netMessage.m_pData, message, 0, message.Length);
payload = new ArraySegment<byte>(message);
clientId = netMessage.m_identityPeer.GetSteamID64();
Debug.Log($"PollEvent(); // message received at {receiveTime} from {clientId}");
netMessage.Release(); // <----- Commenting this line prevents segfault
}
finally
{
Marshal.DestroyStructure<SteamNetworkingMessage_t>(receiveBuffers[0]);
}
Any ideas? Happy to share more code if needed.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Segmentation fault occurs only under release configuration
For some odd reason, my application likes to break on me when I switch to release and run it outside of my debugger....
Read more >Identify what's causing segmentation faults (segfaults)
A segmentation fault (aka segfault) is a common condition that causes ... calling memset() as shown below would cause a program to segfault:...
Read more >rpc.mountd is segfaulting immediately on launch
Horrible-ish workaround: rm /etc/mtab; cat /proc/mounts > /etc/mtab. Caveat emptor: This may randomly break things that expect /etc/mtab to ...
Read more >Segmentation fault
Segmentation faults are a common class of error in programs written in languages like C that provide low-level memory access and few to...
Read more >lxrandr fails to launch and throws Segmentation fault
Troubleshooting. As an act of desperation I tried debugging with gdb however I did not manage to get anything useful from that:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can wrangle NativeMethods in this way to expose the underlying method (internal to public) and call it through the API.
I use some extension methods to do it.
@AG4W This worked as advertised, thanks for the help!