Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crashes randomly (FCNPC 2.0.9, SA:MP 0.3.7 R2, Ubuntu 22.04). #317

Open
Sesomsoma opened this issue May 5, 2024 · 9 comments
Open

Comments

@Sesomsoma
Copy link

Sesomsoma commented May 5, 2024

Describe the bug
My server crashes randomly for no reason. CrashDetect doesn't say anything, I've already set other plugins. I'm starting to think it's FCNPC (it's also the only one that leaves logs).

To Reproduce
There is no way to reproduce it, it happens randomly

FCNPC Log

=========================== FCNPC Exception Handler ============================
Signal 11 (Segmentation fault), address is 58 from f3ee0e33

Backtrace:
  #0 in plugins/fcnpc-209.so(_ZN17CExceptionHandler24ExceptionHandlerCallbackEiP9siginfo_tPv+0x126) [0xf3c77ba6]
  #1 in linux-gate.so.1(__kernel_rt_sigreturn+0) [0xf47905a0]
  #2 in plugins/raknet.so(_ZN6Script10ExecPublicERKSt10shared_ptrIN3ptl6PublicEEihP9BitStream+0x23) [0xf3ee0e33]
  #3 in plugins/raknet.so(_ZNSt17_Function_handlerIFbRKSt10shared_ptrI6ScriptEEZN6Plugin7OnEventIL12PR_EventType4EEEbihP9BitStreamEUlS4_E_E9_M_invokeERKSt9_Any_dataS4_+0x38) [0xf3eeb2a8]
  #4 in plugins/raknet.so(_ZN14MessageHandler9OnReceiveEP16RakPeerInterfaceP6Packet+0x17c) [0xf3ee816c]
  #5 in ./samp03svr() [0x806f969]
  #6 in ./samp03svr() [0x8071d73]
  #7 in ./samp03svr() [0x807bc50]
  #8 in plugins/raknet.so(_ZN5Hooks18RakServer__ReceiveEPv+0xa2) [0xf3ee7442]
  #9 in ./samp03svr() [0x80aed3d]

Information:
  System: GNU/Linux
  SA-MP: 0.3.7 R2
  FCNPC: 2.0.9

Functions:
  FUNC_CPlayerPool__DeletePlayer: 0x80d0a90
  FUNC_CPlayer__Kill: 0x80cb220
  FUNC_CPlayer__EnterVehicle: 0x80cc1c0
  FUNC_CPlayer__ExitVehicle: 0x80cc340
  FUNC_CPlayer__SpawnForWorld: 0x80ccfc0
  FUNC_GetVehicleModelInfo: 0x80d5e00
  FUNC_CConsole__GetIntVariable: 0x80a0070
  FUNC_ClientJoin_RPC: 0x80b0030

Pointers:
  VAR_ServerAuthentication: 0x81ab8ec
  VAR_NetVersion: 0xfd9

Offsets:
  OFFSET_RemoteSystemManager: 0x334
  OFFSET_RemoteSystemSize: 0xc69
  OFFSET_RemoteSystem__ConnectMode: 0xc62
  OFFSET_RemoteSystem__Unknown: 0xc67
=========================== FCNPC Exception Handler ============================

Versions:

  • OS: Ubuntu 22.04
  • SA-MP version: 0.3.7 R2
  • FCNPC version: 2.0.9

A clear and concise description of what you expected to happen.

I'm dealing with this error for months now. From time to time my server goes down. I use the latest version of FCNPC and my plugins are:

discordconnector, gps, PawnRakNet, PawnCMD, streamer sscanf, bcrypt mysql

@ziggi
Copy link
Owner

ziggi commented May 6, 2024

Just look at the backtrace, it points to raknet.

@Sesomsoma
Copy link
Author

Sesomsoma commented Jun 5, 2024

Hello. The problem above did have to do with RakNet. Now, a few weeks ago, I'm dealing with random crashes that happen only if I have FCNPC connected. I have no way to reproduce this crash, it seems to appear randomly during the day.

I think it's a bug of the plugin (or bad practice of mine).

Maybe we can refresh our minds together, I publish the latest FCNPC log here (CrashDetect leaves no trace, if I disconnect CrashDetect FNPC points to streamer.so, if I disconnect streamer.so, the FCNPC log leads to the last plugin in the list “plugins ", whatever it is):

=========================== FCNPC Exception Handler ============================
Signal 11 (Segmentation fault), address is 0 from f7a85c01

Backtrace:
  #0 in plugins/fcnpc.so(_ZN17CExceptionHandler24ExceptionHandlerCallbackEiP9siginfo_tPv+0x126) [0xf776aba6]
  #1 in linux-gate.so.1(__kernel_rt_sigreturn+0) [0xf7f5a570]
  #2 in /lib/i386-linux-gnu/libc.so.6(+0xb5c01) [0xf7a85c01]
  #3 in ./samp03svr() [0x809e172]
  #4 in ./samp03svr() [0x80950e4]
  #5 in plugins/@CRASHDETECT.so(_ZN11CrashDetect10OnCallbackEiPiS0_+0x478) [0xf795e168]
  #6 in plugins/@CRASHDETECT.so(+0x202ab) [0xf79612ab]
  #7 in plugins/@PROFILER.so(_ZN15ProfilerHandler8CallbackEiPiS0_+0x74) [0xf7927214]
  #8 in plugins/@PROFILER.so(+0x12012) [0xf7926012]
  #9 in plugins/@CRASHDETECT.so(amx_Exec+0x1739) [0xf7965b59]

Information:
  System: GNU/Linux
  SA-MP: 0.3.7 R2
  FCNPC: 2.0.8

Functions:
  FUNC_CPlayerPool__DeletePlayer: 0x80d0a90
  FUNC_CPlayer__Kill: 0x80cb220
  FUNC_CPlayer__EnterVehicle: 0x80cc1c0
  FUNC_CPlayer__ExitVehicle: 0x80cc340
  FUNC_CPlayer__SpawnForWorld: 0x80ccfc0
  FUNC_GetVehicleModelInfo: 0x80d5d30
  FUNC_CConsole__GetIntVariable: 0x80a0070
  FUNC_ClientJoin_RPC: 0x80b0030

Pointers:
  VAR_ServerAuthentication: 0x81aa8a8
  VAR_NetVersion: 0xfd9

Offsets:
  OFFSET_RemoteSystemManager: 0x334
  OFFSET_RemoteSystemSize: 0xc69
  OFFSET_RemoteSystem__ConnectMode: 0xc62
  OFFSET_RemoteSystem__Unknown: 0xc67
=========================== FCNPC Exception Handler ============================

0x809e172 and 0x80950e4 ¿?

@ziggi
Copy link
Owner

ziggi commented Jun 5, 2024

0x80950e4 points at calling native function in amx_Callback function
0x809e172 points at calling memmove in n_memcpy function

So the problem is somewhere in some callback. Try to check memcpy calls in your script. That's all we can get with this information. Log each callback call at the beginning and at the end (you can do it with samp-log plugin).

@Sesomsoma
Copy link
Author

Sesomsoma commented Jun 5, 2024

0x80950e4 points at calling native function in amx_Callback function
0x809e172 points at calling memmove in n_memcpy function

So the problem is somewhere in some callback. Try to check memcpy calls in your script. That's all we can get with this information. Log each callback call at the beginning and at the end (you can do it with samp-log plugin).

Thank you, you enlightened me. I'll check as soon as I can.

For people who can read (so we can contribute to anyone who has a similar problem):

I think it may be the YSI library, it may be generating some type of problem with the FCNPC drivers and their
VehicleOccupant iterator.

@ziggi
Copy link
Owner

ziggi commented Jun 5, 2024

Yes, YSI do a lot of memory related things that no one understands.

@bladedevoff
Copy link

bladedevoff commented Aug 25, 2024

Hi! How did you fix that? I'm using Pterodactyl panel and i have similar error.

@Sesomsoma
Copy link
Author

Hi! How did you fix that? I'm using Pterodactyl panel and i have similar error.

Hi! It was related to the YSI library and its default iterators (CarDriver and CarOccupant).

I removed that, made my own and voila!

@Sesomsoma
Copy link
Author

Sesomsoma commented Nov 8, 2024

Hello. I know this shouldn't go here, but it can probably help someone else in the future and prevent future crash posts.

I'm looking for you to enlighten me like last time, this time I have this log:

=========================== FCNPC Exception Handler ================== = ========
Signal 11 (segmentation fault), address is 11244 80e1227

Backtracking:
  #0 in plugins/fcnpc.so(_ZN17CExceptionHandler24ExceptionHandlerCallbackEiP9siginfo_tPv+0x126) [0xf7831d06]
  #1 in linux-gate.so.1(__kernel_rt_sigreturn+0) [0xf7eebdc0]
  #2 in ./samp-server() [0x80e1227]
  #3 in ./samp-server() [0x80e3295]
  #4 in plugins/sscanf.so(+0x939a) [0xf42af39a]
  #5 in ./samp-server() [0x809f167]
  #6 in plugins/streamer.so(+0x2d932) [0xf405a932]
  #7 in [0x2ee]

Information:
  System: GNU/Linux
  SA-MP: 0.3.DL R1
  FCNPC: 2.0.10

And I'm breaking my head, without FCNPC I can't have it. I have no way to reproduce it, but I have run the server 1 week with FCNPC and another week without. When I run it with FCNPC the crash occurs randomly 3 times a week at different times. Would you have any idea what those addresses mean?

  • 0x80e1227
  • 0x80e3295

@Sesomsoma Sesomsoma reopened this Nov 8, 2024
@ziggi
Copy link
Owner

ziggi commented Nov 8, 2024

0x80e1227 ContainsInvalidNickChars (internal server function)
0x80e3295 SetPlayerName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants