Author Topic: MONO - Program crashes on Linux  (Read 11351 times)

Mainclain

  • Not-a-newbie
  • *
  • Posts: 14
  • Karma: 0
    • View Profile
MONO - Program crashes on Linux
« on: September 28, 2012, 08:31:42 AM »
Hello I have a little problem.

I edit the RaknetSWIG.dll so it writes the Float into an Array and use WriteAlignBytes.

And It works, but after some time it crashes always at the same Position:

Code: [Select]
public void Write(float inTemplateVar) {
    //RakNetPINVOKE.BitStream_Write__SWIG_15(swigCPtr, inTemplateVar);
      WriteAlignedBytes(BitConverter.GetBytes(inTemplateVar), 32);
  }

Code: [Select]

Stacktrace:

  at (wrapper managed-to-native) RakNet.RakNetPINVOKE.BitStream_WriteAlignedBytes (System.Runtime.InteropServices.HandleRef,byte[],uint) <0x00012>
  at (wrapper managed-to-native) RakNet.RakNetPINVOKE.BitStream_WriteAlignedBytes (System.Runtime.InteropServices.HandleRef,byte[],uint) <0xffffffff>
  at RakNet.BitStream.WriteAlignedBytes (byte[],uint) <0x000c6>
  at RakNet.BitStream.Write (single) <0x0003a>
  at GMP_Server.Net.Message.PlayerStatusMessage.Read (RakNet.BitStream,RakNet.Packet,GMP_Server.Net.Server) <0x00239>
  at GMP_Server.Net.Server.Update () <0x00785>
  at GMP_Server.Program.Main (string[]) <0x00783>
  at (wrapper runtime-invoke) GMP_Server.Program.runtime_invoke_void_string[] (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono [0x51bc07]
        mono [0x43dacd]
        /lib/libpthread.so.0 [0x7ff8b31f17d0]
        /lib/libc.so.6(memcpy+0xdd) [0x7ff8b2c7d03d]
        /usr/lib/RakNet(_ZN6RakNet9BitStream5WriteEPKcj+0x6e) [0x7ff8b0d37b08]
        /usr/lib/RakNet(_ZN6RakNet9BitStream17WriteAlignedBytesEPKhj+0x35) [0x7ff8b0d381a7]
        /usr/lib/RakNet(CSharp_BitStream_WriteAlignedBytes+0x4f) [0x7ff8b0e1fb3e]
        [0x400b6b2a]

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: MONO - Program crashes on Linux
« Reply #1 on: September 28, 2012, 10:49:31 AM »
What do you mean you are editing the DLL? You changed the binary?

Mainclain

  • Not-a-newbie
  • *
  • Posts: 14
  • Karma: 0
    • View Profile
Re: MONO - Program crashes on Linux
« Reply #2 on: September 28, 2012, 01:31:56 PM »
I changed the source of the Swig-Part.
http://www.jenkinssoftware.com/forum/index.php?topic=4929.0
Because of this Problem.
The comment was the original Part of the dll gernerated by Swig. (BitStream.cs)
I didn't changed the C++ Raknet.dll (perhabs it's a mono Problem but I couldn't found a solution for that)

Code: [Select]
public void Write(float inTemplateVar) {
    //RakNetPINVOKE.BitStream_Write__SWIG_15(swigCPtr, inTemplateVar);
      WriteAlignedBytes(BitConverter.GetBytes(inTemplateVar), 32);
  }

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: MONO - Program crashes on Linux
« Reply #3 on: September 29, 2012, 11:56:02 PM »
Can you attach the changed file so I can look at it?

Mainclain

  • Not-a-newbie
  • *
  • Posts: 14
  • Karma: 0
    • View Profile
Re: MONO - Program crashes on Linux
« Reply #4 on: October 01, 2012, 02:09:17 PM »
Here: (.txt because I can't upload .cs files).