Random crashes

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

trianglehead
Posts: 90
Joined: 13 Aug 2016, 04:28

Random crashes

Postby trianglehead » 26 Jun 2019, 15:16

Hi I'm getting random crashes in my game and I have the call stack that references smartfox. Hopefully you can give some insight into this! Thanks!

Call Stack for Thread 30924:
0x00007FFB60BF3074 (ntdll) NtWaitForAlertByThreadId
0x00007FFB60BC47A2 (ntdll) RtlSleepConditionVariableCS
0x00007FFB5D8ECBA9 (KERNELBASE) SleepConditionVariableCS
0x00007FFAE0DB11CC (mono-2.0-bdwgc) mono_threads_attach_tools_thread
0x00007FFAE0E66353 (mono-2.0-bdwgc) mono_threads_set_shutting_down
0x0000000066FEB217 (mscorlib) System.Threading.Thread.SleepInternal()
0x0000000066FEB0F3 (mscorlib) System.Threading.Thread.Sleep()
0x000000006B8BFF83 (SmartFox2X) Sfs2X.Core.ThreadManager.Sleep()
0x000000006B8BF9CB (SmartFox2X) Sfs2X.Core.ThreadManager.OutThread()
0x000000005BCE65FF (mscorlib) System.Threading.ThreadHelper.ThreadStart_Context()
0x000000005BCE4981 (mscorlib) System.Threading.ExecutionContext.RunInternal()
0x000000005BCE405B (mscorlib) System.Threading.ExecutionContext.Run()
0x000000005BCE3E93 (mscorlib) System.Threading.ExecutionContext.Run()
0x000000005BCE3BBB (mscorlib) System.Threading.ThreadHelper.ThreadStart()
0x000000005A3FCE10 (mscorlib) System.Object.runtime_invoke_void__this__()
0x00007FFAE0EBBE7B (mono-2.0-bdwgc) mono_get_runtime_build_info
0x00007FFAE0E41E32 (mono-2.0-bdwgc) mono_perfcounters_init
0x00007FFAE0E4B012 (mono-2.0-bdwgc) mono_runtime_invoke_array
0x00007FFAE0E6549F (mono-2.0-bdwgc) mono_threads_set_shutting_down
0x00007FFAE0E651E6 (mono-2.0-bdwgc) mono_threads_set_shutting_down
0x00007FFB5FED7974 (KERNEL32) BaseThreadInitThunk
0x00007FFB60BBA271 (ntdll) RtlUserThreadStart


Call Stack for Thread 31976:
0x00007FFB60BF02B4 (ntdll) ZwWaitForMultipleObjects
0x00007FFB5D8CC7CE (KERNELBASE) WaitForMultipleObjectsEx
0x00007FFAE0DB5E0C (mono-2.0-bdwgc) mono_conc_hashtable_remove
0x00007FFAE0EAA58D (mono-2.0-bdwgc) mono_object_is_alive
0x00007FFAE0EAAC0E (mono-2.0-bdwgc) mono_object_is_alive
0x00007FFAE0E5167B (mono-2.0-bdwgc) mono_opcode_value
0x0000000066F9DD3A (System) System.Net.Sockets.Socket.Receive_internal()
0x0000000066F9D9F3 (System) System.Net.Sockets.Socket.Receive_internal()
0x000000006B8F1BBB (System) System.Net.Sockets.Socket.Receive()
0x000000006B8F185B (System) System.Net.Sockets.Socket.Receive()
0x000000006B8F139B (System) System.Net.Sockets.NetworkStream.Read()
0x000000006B8F0938 (SmartFox2X) Sfs2X.Core.Sockets.TCPSocketLayer.Read()
0x000000005BCE65FF (mscorlib) System.Threading.ThreadHelper.ThreadStart_Context()
0x000000005BCE4981 (mscorlib) System.Threading.ExecutionContext.RunInternal()
0x000000005BCE405B (mscorlib) System.Threading.ExecutionContext.Run()
0x000000005BCE3E93 (mscorlib) System.Threading.ExecutionContext.Run()
0x000000005BCE3BBB (mscorlib) System.Threading.ThreadHelper.ThreadStart()
0x000000005A3FCE10 (mscorlib) System.Object.runtime_invoke_void__this__()
0x00007FFAE0EBBE7B (mono-2.0-bdwgc) mono_get_runtime_build_info
0x00007FFAE0E41E32 (mono-2.0-bdwgc) mono_perfcounters_init
0x00007FFAE0E4B012 (mono-2.0-bdwgc) mono_runtime_invoke_array
0x00007FFAE0E6549F (mono-2.0-bdwgc) mono_threads_set_shutting_down
0x00007FFAE0E651E6 (mono-2.0-bdwgc) mono_threads_set_shutting_down
0x00007FFB5FED7974 (KERNEL32) BaseThreadInitThunk
0x00007FFB60BBA271 (ntdll) RtlUserThreadStart


Call Stack for Thread 31928:
0x00007FFB60BEF7E4 (ntdll) ZwWaitForSingleObject
0x00007FFB5D8A83D3 (KERNELBASE) WaitForSingleObjectEx
ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00000001426AF042)
0x00000001426AF042 (Unity) (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 000000014257AB5F)
0x000000014257AB5F (Unity) (function-name not available)
0x00007FFB5FED7974 (KERNEL32) BaseThreadInitThunk
0x00007FFB60BBA271 (ntdll) RtlUserThreadStart


Call Stack for Thread 32760:
0x00007FFB60BEF7E4 (ntdll) ZwWaitForSingleObject
0x00007FFB5D8A83D3 (KERNELBASE) WaitForSingleObjectEx
ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 0000000142183B26)
0x0000000142183B26 (Unity) (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 0000000140A75A90)
0x0000000140A75A90 (Unity) (function-name not available)
0x00007FFB5FED7974 (KERNEL32) BaseThreadInitThunk
0x00007FFB60BBA271 (ntdll) RtlUserThreadStart
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Random crashes

Postby Bax » 27 Jun 2019, 07:51

You should please provide more information on your setup.
Check this page please: https://www.smartfoxserver.com/support/info
No need to send your configuration for the time being, but please describe what you are doing in your code and the build target of your project.
Thank you.
Paolo Bax
The SmartFoxServer Team
trianglehead
Posts: 90
Joined: 13 Aug 2016, 04:28

Re: Random crashes

Postby trianglehead » 27 Jun 2019, 19:29

Thanks for the reply. Here's the missing info:

- Smartfox Server 2X v2.13.6 patch
- c# api 1.7.12
- server running on linux amazon-linux-ami/2018.03 instance type = c5.large
- client software on Unity Editor 2018.4.1f1(although it will crash even if deployed to android or ios, any version.)
- client hardware AMD 1950x, 64gig ram windows 10(will crash on any android device too)
- Any range of wifi or g4 will do
- no custom jvm settings
- The problem is I don't have a set way to reproduce it. As long as 35+ people are on at the same time it will crash. It only started doing since Unity 2018.2 and greater. But Unity has no clue, and pointed out the stack trace that references SmartFox, so here I am. The only thing I have that might be useful is the stack trace I posted.


Thanks.
-
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Random crashes

Postby Lapo » 28 Jun 2019, 08:39

Hi,
nepoez wrote:- The problem is I don't have a set way to reproduce it. As long as 35+ people are on at the same time it will crash. It only started doing since Unity 2018.2 and greater. But Unity has no clue, and pointed out the stack trace that references SmartFox, so here I am. The only thing I have that might be useful is the stack trace I posted.

Unfortunately the stack trace is not very useful.
Those errors:
ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00000001426AF042)

means that Unity's crash handler has a problem locating the code causing the error.
(See here for reference)

Also the error seems to be happening at a very low level in the mono runtime which makes it pretty difficult for us to guess what might be going on, as we have no idea what Mono does behind the scenes.

You mentioned it usually happens with 35+ users connected. What are these users doing? Are they all in the same Room?
What is the update rate between clients and server?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
trianglehead
Posts: 90
Joined: 13 Aug 2016, 04:28

Re: Random crashes

Postby trianglehead » 28 Jun 2019, 14:50

You mentioned it usually happens with 35+ users connected. What are these users doing? Are they all in the same Room?
What is the update rate between clients and server?

Yes all in the same room, I can't say what they are doing, the update rate is unknown when the crash happens. I just know that none of this mattered before Unity 2018.2.

Anyways, it seems like I don't have enough data for either Unity or Smartfox to find an answer. I'll try to find a way to consistently reproduce this and then go from there.

Thanks for your time.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Random crashes

Postby Lapo » 29 Jun 2019, 06:54

nepoez wrote:
You mentioned it usually happens with 35+ users connected. What are these users doing? Are they all in the same Room?
What is the update rate between clients and server?

Yes all in the same room, I can't say what they are doing, the update rate is unknown when the crash happens. I just know that none of this mattered before Unity 2018.2.

What I am asking is not to describe the packet rate or messages at the time of the problem, but rather just give us a clue of what you game does. Is it real time? turn based? What's the average packet rate? etc... Generic info on how the game works

Let us know. Maybe it will help finding the trigger(s) of the problem.
Lapo

--

gotoAndPlay()

...addicted to flash games
trianglehead
Posts: 90
Joined: 13 Aug 2016, 04:28

Re: Random crashes

Postby trianglehead » 29 Jun 2019, 09:13

Lapo wrote:
nepoez wrote:
You mentioned it usually happens with 35+ users connected. What are these users doing? Are they all in the same Room?
What is the update rate between clients and server?

Yes all in the same room, I can't say what they are doing, the update rate is unknown when the crash happens. I just know that none of this mattered before Unity 2018.2.

What I am asking is not to describe the packet rate or messages at the time of the problem, but rather just give us a clue of what you game does. Is it real time? turn based? What's the average packet rate? etc... Generic info on how the game works

Let us know. Maybe it will help finding the trigger(s) of the problem.


Hi. It is a real-time game. 3rd person MMORPG Melee game with chat, trading, buying and selling. And I took a sample from the SFS console with 12 players the avg data transfer rate is out: 62kb/s and in 26kb/s

Thanks you!
trianglehead
Posts: 90
Joined: 13 Aug 2016, 04:28

Re: Random crashes[Closed]

Postby trianglehead » 12 Jul 2019, 15:02

It is something with Unity in the end. It is solved now. Case Closed!

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 17 guests