pBlueG / SA-MP-MySQL

MySQL plugin for San Andreas Multiplayer
BSD 3-Clause "New" or "Revised" License
196 stars 78 forks source link

[ERROR] signal 11 (SIGSEGV) catched; shutting log-core down #251

Open alansyahdwi opened 3 years ago

alansyahdwi commented 3 years ago

I've got this error (signal 11 (SIGSEGV) after quitting the game (/q). Can someone help me about this?

I'm getting this error only at Linux server.

log-ore.log

[16:57:56] [ERROR] signal 11 (SIGSEGV) catched; shutting log-core down (errno: 0, signal code: 1, exit status: -163369800)

server_log.log

[16:57:45] Alansyah Dwi has logged in.
[16:57:56] [debug] Server crashed while executing NGRP.amx
[16:57:56] [debug] AMX backtrace:
[16:57:56] [debug] #0 native fclose () in samp03svr
[16:57:56] [debug] #1 004b1e20 in Log (sz_fileName[]=@0b6bedc8 "logs/login.log", sz_input[]=@0c05aa3c "Alansyah_Dwi (ID: 0 | SQL ID: 4 | Level: 1 | IP: 36.68.216.82) has disconnected.") at ./includes/core/filehandle.pwn:67
[16:57:56] [debug] #2 0011a870 in public ATT_OnPlayerDisconnect (playerid=0, reason=1) at ./includes/callbacks.pwn:2113
[16:57:56] [debug] #3 0003f674 in public CB_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\attachments.inc:174
[16:57:56] [debug] #4 00039b2c in public SSCANF_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\callbacks.inc:671
[16:57:56] [debug] #5 00029398 in public _y_utils_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\sscanf2.inc:266
[16:57:56] [debug] #6 00003aa8 in OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\YSI_Coding\y_timers\..\..\YSI_Core\y_core\y_utils_impl.inc:271
[16:57:56] [debug] #7 00019044 in public OnPlayerDisconnect (0, 1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\YSI_Coding\y_timers\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\y_cgen.inc:127
[16:57:56] [debug] Native backtrace:
[16:57:56] [debug] #0 f7b65f7f in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[16:57:56] [debug] #1 f7b5e81d in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[16:57:56] [debug] #2 f7b5ee48 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[16:57:56] [debug] #3 f7b605dc in _ZN11CrashDetect7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[16:57:56] [debug] #4 f7b6579f in ?? () in plugins/crashdetect.so
[16:57:56] [debug] #5 f7f5e0a0 in ?? ()
[16:57:56] [debug] #6 f7beea34 in fclose () in /lib/i386-linux-gnu/libc.so.6
[16:57:56] [debug] #7 080a44c4 in ?? () in ./samp03svr
[16:57:56] [debug] #8 0809d844 in ?? () in ./samp03svr
[16:57:56] [debug] #9 f7b5e46f in _ZN11CrashDetect15ProcessCallbackEiPiS0_ () in plugins/crashdetect.so
[16:57:56] [debug] #10 f7b63feb in ?? () in plugins/crashdetect.so
[16:57:56] [debug] Registers:
[16:57:56] [debug] EAX: 00000200 EBX: f7d44000 ECX: 080a44b0 EDX: 00000000
[16:57:56] [debug] ESI: 0950bbc0 EDI: f7b90940 EBP: ff9f0da8 ESP: ff9f0d80
[16:57:56] [debug] EIP: f7beea34 EFLAGS: 00010246
[16:57:56] [debug] Stack:
[16:57:56] [debug] ESP+00000000: 093681a0 093681a0 ff9f0db8 080e8782
[16:57:56] [debug] ESP+00000020: 00004980 093681a0 ff9f0db8 080a44c4
[16:57:56] [debug] ESP+00000040: 093681a0 f38f971c 00000000 0c05aa28
[16:57:56] [debug] ESP+00000060: f7b8e890 000000d6 ff9f0f18 f7b5e46f
[16:57:56] [debug] ESP+00000080: 000000d6 00000000 f7f53000 f7f4fd81
[16:57:56] [debug] ESP+000000a0: ff9f0f50 00000000 f7cae825 f7f6e2c9
[16:57:56] [debug] ESP+000000c0: 000000d6 093681a0 00000000 0c05aa28
[16:57:56] [debug] ESP+000000e0: ff9f0e50 00000000 093078c8 f7f4fd60
[16:57:56] [debug] ESP+00000100: 093e22b0 f7d44000 00000001 00000000
[16:57:56] [debug] ESP+00000120: b53d0414 ff9f0eb4 5e8246d1 f7b63078
[16:57:56] [debug] ESP+00000140: f7d44000 e6f6c008 ff9f0f38 f7c85402
[16:57:56] [debug] ESP+00000160: f7c853d7 f7f2e000 ff9f0f28 f7e505ec
[16:57:56] [debug] ESP+00000180: 00000036 603fb204 3a6b585e f7b8e000
[16:57:56] [debug] ESP+000001a0: 09316dd8 000000d6 ff9f0f8c f38f971c
[16:57:56] [debug] ESP+000001c0: 093681a0 000000d6 ff9f0f8c f38f971c
[16:57:56] [debug] ESP+000001e0: e789f11c 0c05acbc 0c056cc0 00000000
[16:57:56] [debug] ESP+00000200: f7b8e860 093681a0 00000001 0950bbc0
[16:57:56] [debug] ESP+00000220: 09316dd8 ff9f1014 ff9f1048 f7b600b4
[16:57:56] [debug] ESP+00000240: 00000183 09315028 00000001 ff9f1104
[16:57:56] [debug] ESP+00000260: ff9f1030 00000183 00000008 0809de7b
[16:57:56] [debug] ESP+00000280: 093681a0 00000001 00000000 00000000
[16:57:56] [debug] ESP+000002a0: ff9f1040 081654e0 ff9f1040 f63afa2e
[16:57:56] [debug] ESP+000002c0: ff9f10bc 093681a0 ff9f10a8 f7b63e6f
[16:57:56] [debug] ESP+000002e0: 00000002 f64487f0 00000183 f63bd676
[16:57:56] [debug] ESP+00000300: 00000002 0c05acb4 00000002 ff9f10c0
[16:57:56] [debug] ESP+00000320: 094e2a90 f671a008 ff9f10c8 080adbfa
[16:57:56] [debug] ESP+00000340: 00000183 00000000 ff9f1238 080dc151
[16:57:56] [debug] ESP+00000360: 0931c2ec 00000008 00000009 ff9f1140
[16:57:56] [debug] ESP+00000380: 094fc730 ff9f1120 ff9f1140 f7e29d88
[16:57:56] [debug] ESP+000003a0: 0932a4c8 ff9f1134 4f49f89a 0018f4fd
[16:57:56] [debug] ESP+000003c0: f7d44000 00000000 ff9f1208 f7c85402
[16:57:56] [debug] ESP+000003e0: b53d0414 f7f5d34c ff9f11e8 f7f5da63
[16:57:56] [debug] Loaded modules:
[16:57:56] [debug] 00000000 - 00194f0b samp03svr
[16:57:56] [debug] f7f5d000 - f7f5e27e 
[16:57:56] [debug] f7f4f000 - f7f51a04 /lib/i386-linux-gnu/libdl.so.2
[16:57:56] [debug] f7f32000 - f7f4d6ef /lib/i386-linux-gnu/libpthread.so.0
[16:57:56] [debug] f7dbb000 - f7f3bb4b /usr/lib/i386-linux-gnu/libstdc++.so.6
[16:57:56] [debug] f7d66000 - f7dba01c /lib/i386-linux-gnu/libm.so.6
[16:57:56] [debug] f7d49000 - f7d651e4 /lib/i386-linux-gnu/libgcc_s.so.1
[16:57:56] [debug] f7b91000 - f7d4dc6b /lib/i386-linux-gnu/libc.so.6
[16:57:56] [debug] f7f5f000 - f7f829c4 /lib/ld-linux.so.2
[16:57:56] [debug] f7b46000 - f7b8e3d4 plugins/crashdetect.so
[16:57:56] [debug] f77b5000 - f7b4aeb2 plugins/mysql.so
[16:57:56] [debug] f7791000 - f77b4d32 /home/container/plugins/../log-core.so
[16:57:56] [debug] f7788000 - f778f714 /lib/i386-linux-gnu/librt.so.1
[16:57:56] [debug] f6773000 - f67842ec /lib/i386-linux-gnu/libnss_files.so.2
[16:57:56] [debug] f6762000 - f67719b4 plugins/sscanf.so
[16:57:56] [debug] f6755000 - f6761011 plugins/gvar.so
[16:57:56] [debug] f644b000 - f660a0c0 plugins/pawncmd.so
[16:57:56] [debug] f6385000 - f644a740 plugins/streamer.so
[16:57:56] [debug] f674b000 - f67537c4 plugins/Whirlpool.so
[16:57:56] [debug] f7f55000 - f7f56f70 plugins/nativechecker.so
[16:57:56] [debug] f670e000 - f6712a38 /lib/i386-linux-gnu/libnss_dns.so.2
[16:57:56] [debug] e5c72000 - e5c89494 /lib/i386-linux-gnu/libresolv.so.2
alansyahdwi commented 3 years ago

When on windows server, it run normally.

server_log.log

[23:18:54] Alansyah Dwi has logged in.
[23:19:01] [part] Alansyah_Dwi has left the server (0:1)
IstuntmanI commented 3 years ago

There's no problem with the MySQL plugin. Log Core simply logs all server crashes. The problem is in your filehandle.pwn file at line 67:

[16:57:56] [debug] Server crashed while executing NGRP.amx
[16:57:56] [debug] AMX backtrace:
[16:57:56] [debug] #0 native fclose () in samp03svr
[16:57:56] [debug] #1 004b1e20 in Log (sz_fileName[]=@0b6bedc8 "logs/login.log", sz_input[]=@0c05aa3c "Alansyah_Dwi (ID: 0 | SQL ID: 4 | Level: 1 | IP: 36.68.216.82) has disconnected.") at ./includes/core/filehandle.pwn:67
[16:57:56] [debug] #2 0011a870 in public ATT_OnPlayerDisconnect (playerid=0, reason=1) at ./includes/callbacks.pwn:2113
[16:57:56] [debug] #3 0003f674 in public CB_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\attachments.inc:174
[16:57:56] [debug] #4 00039b2c in public SSCANF_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\callbacks.inc:671
[16:57:56] [debug] #5 00029398 in public _y_utils_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\sscanf2.inc:266
[16:57:56] [debug] #6 00003aa8 in OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\YSI_Coding\y_timers\..\..\YSI_Core\y_core\y_utils_impl.inc:271
[16:57:56] [debug] #7 00019044 in public OnPlayerDisconnect (0, 1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\YSI_Coding\y_timers\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\y_cgen.inc:127

Looks like fclose is crashing the server. fclose can crash only if the file handle is invalid (equal to File:0) (see https://github.com/pawn-lang/sa-mp-fixes). Before using fclose, make sure to check if the handle is correctly being set (check if fopen returns a valid handle, and if it doesn't, just check why not). Maybe the logs/login.log file fails to be created? Maybe you don't have your logs folder in scriptfiles, but I doubt that, because I guess that you are also logging other things, not only when an user disconnects.

alansyahdwi commented 3 years ago

There's no problem with the MySQL plugin. Log Core simply logs all server crashes. The problem is in your filehandle.pwn file at line 67:

[16:57:56] [debug] Server crashed while executing NGRP.amx
[16:57:56] [debug] AMX backtrace:
[16:57:56] [debug] #0 native fclose () in samp03svr
[16:57:56] [debug] #1 004b1e20 in Log (sz_fileName[]=@0b6bedc8 "logs/login.log", sz_input[]=@0c05aa3c "Alansyah_Dwi (ID: 0 | SQL ID: 4 | Level: 1 | IP: 36.68.216.82) has disconnected.") at ./includes/core/filehandle.pwn:67
[16:57:56] [debug] #2 0011a870 in public ATT_OnPlayerDisconnect (playerid=0, reason=1) at ./includes/callbacks.pwn:2113
[16:57:56] [debug] #3 0003f674 in public CB_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\attachments.inc:174
[16:57:56] [debug] #4 00039b2c in public SSCANF_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\callbacks.inc:671
[16:57:56] [debug] #5 00029398 in public _y_utils_OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\sscanf2.inc:266
[16:57:56] [debug] #6 00003aa8 in OnPlayerDisconnect (playerid=0, reason=1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\YSI_Coding\y_timers\..\..\YSI_Core\y_core\y_utils_impl.inc:271
[16:57:56] [debug] #7 00019044 in public OnPlayerDisconnect (0, 1) at D:\Project\SAMP\SA - GM\GM - CRP (with Linux version)\CRP\pawno\include\YSI_Coding\y_timers\..\..\YSI_Data\y_foreach\..\..\YSI_Coding\y_hooks\..\y_cgen\y_cgen.inc:127

Looks like fclose is crashing the server. fclose can crash only if the file handle is invalid (equal to File:0) (see https://github.com/pawn-lang/sa-mp-fixes). Before using fclose, make sure to check if the handle is correctly being set (check if fopen returns a valid handle, and if it doesn't, just check why not). Maybe the logs/login.log file fails to be created? Maybe you don't have your logs folder in scriptfiles, but I doubt that, because I guess that you are also logging other things, not only when an user disconnects.

you're right, i've been remove the Log function, and it works normally. should i use samp-fixes to fix the crash from filehandle.pwn? because everything works at Windows server, it only crashes at Linux server.

IstuntmanI commented 3 years ago

Make sure to also create the logs folder in the scriptfiles folder in your Linux host. If it still won't work, that's weird and you should also try creating the logs/login.log file, I guess.

You shouldn't need samp-fixes only for this.