pBlueG / SA-MP-MySQL

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

log freeze server #113

Closed dimaz1k closed 7 years ago

dimaz1k commented 8 years ago

mysql_log(ERROR | WARNING);

Freeze server

maddinat0r commented 8 years ago

Please describe your problem in detail, I can't help you with that scarce information.

dimaz1k commented 8 years ago

Windows 10 freeze after mysql_connect_file code:

    print("freeze 1");
    mysql_log(ERROR | WARNING);
    print("freeze 2");
    mysql = mysql_connect_file();
    print("freeze 3");

log:

[14:04:31] freeze 1
[14:04:31] freeze 2

plugins jit pawncmd streamer sscanf regex mysql gvar - crash plugins crashdetect pawncmd streamer sscanf regex mysql gvar - freeze plugins pawncmd streamer sscanf regex mysql gvar - freeze

crashinfo:

SA-MP Server: 0.3.7-R2

Exception At Address: 0x682175AA Module: (log-core.dll)

Registers:
EAX: 0x002B09B8 EBX: 0x0258EF50 ECX: 0x00000000 EDX: 0x00000000
ESI: 0x0019F504 EDI: 0x00000001 EBP: 0x0019F4F8 ESP: 0x0019F4F4
EFLAGS: 0x00010202

Stack:
+0000: 0x002B09B8   0x0019F7A4   0x6821A82F   0x00000000
+0010: 0x0019F500   0x6821FAF8   0x00000078   0x0019F7A4
+0020: 0x00000000   0x0000000F   0x0258EF50   0x0019F7F3
+0030: 0x0465BC44   0xFA000BF1   0x00290000   0x773FF5F1
+0040: 0x002956D4   0x00000000   0x773FF3AE   0x02000002
+0050: 0x00006050   0x00290000   0xFFFFF475   0x002900C0
+0060: 0x00000064   0xF40003F7   0x0038E3C0   0x0038DAF4
+0070: 0x00000000   0x00000000   0x0258EF50   0x00000000
+0080: 0xFFFFFFE8   0x00380BB4   0x682224E8   0x0019F584
+0090: 0x682224D4   0x0019F594   0x0000001F   0x000001F4
+00A0: 0x7173796D   0x6F635F6C   0x63656E6E   0x69665F74
+00B0: 0x2228656C   0x7173796D   0x6E692E6C   0x00292269
+00C0: 0x00000330   0x00000000   0x00000001   0x06B78010
+00D0: 0x00000077   0x00000000   0x000000ED   0x0000005F
+00E0: 0x001C11F0   0x00000100   0x00000080   0x000000DF
+00F0: 0x011C0000   0x00000000   0x003014E0   0x00000000
+0100: 0x77419D59   0x25E2C58D   0x00000020   0x00000002
+0110: 0x6849B2D8   0x0038E3C0   0x00000019   0x0019F644
+0120: 0x001A0000   0x00515BF8   0x0046F654   0x00000010
+0130: 0x00000010   0x01290000   0x0019F5F8   0x00000000
dimaz1k commented 8 years ago

freeze by autoreconnect (database has been disabled) crash by JIT 2.0.4 without mysql_log dont crash

maddinat0r commented 8 years ago

Can you please enable full logging (mysql_log(ALL);) and reproduce those crashes again? And post the log output here of course.

dimaz1k commented 8 years ago
print("crash 1");
mysql_log(ALL);
print("crash 2");
mysql = mysql_connect_file();
print("crash 3");
[12:10:36] Server Plugins
[12:10:36] --------------
[12:10:36]  Loading plugin: jit
[12:10:36]   JIT plugin v2.0.4 is OK.
[12:10:36]   Loaded.
[12:10:36]  Loading plugin: pawncmd
[12:10:36] Pawn.CMD plugin v3.1.1 by urShadow loaded
[12:10:36]   Loaded.
[12:10:36]  Loading plugin: streamer
[12:10:36] 

*** Streamer Plugin v2.8.2 by Incognito loaded ***

[12:10:36]   Loaded.
[12:10:36]  Loading plugin: sscanf
[12:10:36] 

[12:10:36]  ===============================

[12:10:36]       sscanf plugin loaded.     

[12:10:36]          Version:  2.8.1        

[12:10:36]    (c) 2012 Alex "Y_Less" Cole  

[12:10:36]  ===============================

[12:10:36]   Loaded.
[12:10:36]  Loading plugin: regex
[12:10:36] 

[12:10:36] ______________________________________

[12:10:36]  Regular Expression Plugin v0.2.0 loaded
[12:10:36] ______________________________________

[12:10:36]  By: Fro (c) Copyright <TBG> 2009-2011
[12:10:36] ______________________________________

[12:10:36]   Loaded.
[12:10:36]  Loading plugin: mysql
[12:10:36]  >> plugin.mysql: R40 successfully loaded.
[12:10:36]   Loaded.
[12:10:36]  Loading plugin: gvar
[12:10:36] 

*** GVar Plugin v1.3 by Incognito loaded ***

[12:10:36]   Loaded.
[12:10:36]  Loaded 7 plugins.

[12:10:36] 
[12:10:36] Filterscripts
[12:10:36] ---------------
[12:10:36]   Loaded 0 filterscripts.

[12:10:37] crash 1
[12:10:37] crash 2
--------------------------
SA-MP Server: 0.3.7-R2

Exception At Address: 0x66D775AA Module: (log-core.dll)

Registers:
EAX: 0x04A92A98 EBX: 0x0237EF50 ECX: 0x00000000 EDX: 0x00000000
ESI: 0x0019F504 EDI: 0x00000001 EBP: 0x0019F4F8 ESP: 0x0019F4F4
EFLAGS: 0x00010202

Stack:
+0000: 0x04A92A98   0x0019F7A4   0x66D7A82F   0x00000000
+0010: 0x0019F500   0x66D7FAF8   0x00000078   0x0019F7A4
+0020: 0x00000000   0x0000000F   0x0237EF50   0x0019F7F3
+0030: 0x04514CF8   0x2D000528   0x00620000   0x77BCF5F1
+0040: 0x006256D4   0x00000000   0x77BCF3AE   0x02000002
+0050: 0x00006050   0x00620000   0xFFFFFB3E   0x006200C0
+0060: 0x00000064   0x31000332   0x006B1D30   0x049820CC
+0070: 0x00000000   0x00000000   0x0237EF50   0x00000000
+0080: 0xFFFFFFF2   0x00380BEC   0x66D824E8   0x0019F584
+0090: 0x66D824D4   0x0019F594   0x0000001F   0x000001F4
+00A0: 0x7173796D   0x6F635F6C   0x63656E6E   0x69665F74
+00B0: 0x2228656C   0x7173796D   0x6E692E6C   0x00292269
+00C0: 0x00000330   0x00000000   0x00000001   0x06A18010
+00D0: 0x00000177   0x00000000   0x000000E9   0x00000169
+00E0: 0x001C11F0   0x00000100   0x00000080   0x000001E9
+00F0: 0x011C0000   0x00000000   0x006B51C0   0x00000000
+0100: 0x77BE9D59   0x14B55204   0x00000020   0x00000002
+0110: 0x657FCC58   0x006B1D30   0x00000003   0x0019F644
+0120: 0x001A0000   0x00515BF8   0x0046F654   0x00000010
+0130: 0x00000010   0x01620000   0x0019F5F8   0x00000000

[09/08/16 12:14:20] [ERROR] exception 0XC0000005 (ACCESS_VIOLATION) from Vectored Exception Handler catched; shutting log-core down

maddinat0r commented 8 years ago

Can you also post the mysql.log here?

dimaz1k commented 8 years ago

No such log

maddinat0r commented 8 years ago

Weird... Is there a plugins directory in your logs folder? If not, can you create it and try again?

dimaz1k commented 8 years ago

Similar...

maddinat0r commented 8 years ago

Can you download R41 here and try to reproduce these crashes/freezes with R41 again?

dimaz1k commented 7 years ago

Exception At Address: 0x5157754A Module: (log-core.dll)

[09/11/16 11:11:47] [ERROR] exception 0XC0000005 (ACCESS_VIOLATION) from Vectored Exception Handler catched; shutting log-core down

no mysql.log

maddinat0r commented 7 years ago

And if you remove mysql_log from your script it stops crashing?

dimaz1k commented 7 years ago

Yes.

Konstantinos-Sk commented 7 years ago

I can't seem to be able to reproduce it. Please do the following:

1) Download R41 from here: https://ci.appveyor.com/api/buildjobs/gvlf0csyyp8svtqb/artifacts/mysql-R41-win32.zip 2) Load only mysql plugin and no other plugin. 3) Run a clean gamemode:

#include <a_samp>

main() {}

public OnGameModeInit()
{
    mysql_log(ALL);
    printf("mysql_connect_file -> %i", _: mysql_connect_file());
    return 1;
}

4) Before running the server, delete logs folder. 5) Make sure mysql.ini (it should have .ini extension otherwise it returns an error _mysql_connectfile: handle error: invalid connection file specified) is located at the same folder the samp-server.exe is. 6) Make sure the contents of the file have the same configuration:

hostname = 127.0.0.1
username = user_here
password = pw_here
database = db_here

7) Run the server.

What are the results? What did it write in logs\plugins\mysql.txt file?

dimaz1k commented 7 years ago

Crash only with JIT plugin on my gamemode. Empty gamemode and JIT and mysql plugin, start is succesfull.

Konstantinos-Sk commented 7 years ago

Well, JIT plugin isn't known for its stability. Reading in its thread, it mentions crashes so it is to be expected. Fro1sha's regex plugin is also known for crashes.

Anyway, unload crashdetect (not sure if it has been fixed but had issues with JIT) plugin and set _mysqllog to NONE. Try again and tell us if it crashes or not.

dimaz1k commented 7 years ago

mysql_log(NONE); - no crash

dimaz1k commented 7 years ago

mysql_log(WARNING); - no crash mysql_log(ERROR); - crash

Konstantinos-Sk commented 7 years ago

I presume you still run R41 and not R40, right? If that is the case, ERROR is the one conflicting as it seems and perhaps try the rest (INFO and DEBUG) so it will limit the options.

dimaz1k commented 7 years ago

R41. Only 'ERROR' crash

maddinat0r commented 7 years ago

Can you enable all log levels except error and post the mysql.log here?

maddinat0r commented 7 years ago

Any updates on this issue @xDimazzz?

YashasSamaga commented 7 years ago

[12:38:54] [log-core] exception 0XC0000005 (ACCESS_VIOLATION) from Vectored Exception Handler catched; shutting log-core down

This is pretty bizarre. The server connects to the SQL server properly. Queries work! Everything works until I spawn. Once I spawn, the server crashes and the aforementioned error appears in the logs.

I am using a minimal gamemode to test textdraws. It doesn't even use OnPlayerSpawn.

The last line in mysql.log is [13:20:48] [INFO] Callback successfully executed.

plugins sscanf mysql crashdetect dns

I am not sure if this has anything to do with the MySQL plugin.

maddinat0r commented 7 years ago

The log-core is a extra library, not directly affiliated with the MySQL plugin. The log-core has crash detection built in, and every time a crash happens (doesn't matter what caused that crash), it logs that log line into the log-core.log file and shuts itself down safely.