pBlueG / SA-MP-MySQL

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

Mysql plugin crashes #167

Closed EternityEST closed 6 years ago

EternityEST commented 6 years ago

# =========== Server Log =============

[01:02:40] [debug] Server crashed due to an unknown error [01:02:40] [debug] Native backtrace: [01:02:40] [debug] #0 f72e3180 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so [01:02:40] [debug] #1 f72db064 in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () from plugins/crashdetect.so [01:02:40] [debug] #2 f72dbd64 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () from plugins/crashdetect.so [01:02:40] [debug] #3 f72ddcdb in _ZN11CrashDetect7OnCrashERKN2os7ContextE () from plugins/crashdetect.so [01:02:40] [debug] #4 f72e24d5 in ?? () from plugins/crashdetect.so [01:02:40] [debug] #5 f76dcba0 in ?? () [01:02:40] [debug] #6 08095730 in ?? () from ./samp03svr [01:02:40] [debug] #7 f6e7fff4 in ?? () from plugins/mysql.so [01:02:40] [debug] #8 f6eaaf27 in ?? () from plugins/mysql.so [01:02:40] [debug] #9 f6e928c8 in ?? () from plugins/mysql.so [01:02:40] [debug] #10 f6e91db2 in ?? () from plugins/mysql.so [01:02:40] [debug] #11 f6ebb867 in ProcessTick () from plugins/mysql.so [01:02:40] [debug] #12 080d1ce2 in ?? () from ./samp03svr [01:02:40] [debug] #13 080aef6c in ?? () from ./samp03svr [01:02:40] [debug] #14 080aa13a in ?? () from ./samp03svr [01:02:40] [debug] #15 f7324637 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6 [01:02:40] [debug] Registers: [01:02:40] [debug] EAX: f27097b0 EBX: f271d008 ECX: fffec770 EDX: 00000014 [01:02:40] [debug] ESI: ffffd8ee EDI: 00000008 EBP: ffdd1f98 ESP: ffdd1f70 [01:02:40] [debug] EIP: 08095730 EFLAGS: 00210246 [01:02:40] [debug] Stack: [01:02:40] [debug] ESP+00000000: 0aea0750 029573f8 f6e4812b f717448c [01:02:40] [debug] ESP+00000020: 0a27d160 00000001 ffdd2268 f6e7fff4 [01:02:40] [debug] ESP+00000040: 0aea0750 f6e7ffd6 f717448c f6e843d8 [01:02:40] [debug] ESP+00000060: 00dc6773 00000001 f76dc9e1 f271d008 [01:02:40] [debug] ESP+00000080: ffdd2044 00000002 0000000b 0a64b988 [01:02:40] [debug] ESP+000000a0: 09eec810 0aea075c 0a41a83c f72d414a [01:02:40] [debug] ESP+000000c0: f7307ff4 00000000 0a63ed88 f72dddd7 [01:02:40] [debug] ESP+000000e0: ffffd8ee 0000003b ffdd20e8 00000001 [01:02:40] [debug] ESP+00000100: 00000000 f74be000 ffdd20e8 f742906c [01:02:40] [debug] ESP+00000120: 0022c174 09edc609 09edba08 f7700d00 [01:02:40] [debug] ESP+00000140: ffdd2128 00000001 0a64b988 f7307ff4 [01:02:40] [debug] ESP+00000160: ffdd2164 f7308660 00000079 f76cc000 [01:02:40] [debug] ESP+00000180: 00000000 00000002 00000000 f722cb14 [01:02:40] [debug] ESP+000001a0: f76c8d67 00000000 09eda690 f76ec204 [01:02:40] [debug] ESP+000001c0: 0a64b988 00000000 029573f0 00037cec [01:02:40] [debug] ESP+000001e0: 00037cec 00000020 09eda6a0 09eda698 [01:02:40] [debug] ESP+00000200: 0a64b988 ffdd21ac 0a63ed88 f72e148c [01:02:40] [debug] ESP+00000220: 0a63ed88 0a64b988 ffdd222c f52a4fcc [01:02:40] [debug] ESP+00000240: f0a00010 f74be000 ffdd2200 00000000 [01:02:40] [debug] ESP+00000260: 00000015 00000093 00000001 00000000 [01:02:40] [debug] ESP+00000280: f74be780 f74be000 f7379a00 00000000 [01:02:40] [debug] ESP+000002a0: f74be780 f74be000 00000018 00000000 [01:02:40] [debug] ESP+000002c0: 0a46e5a0 081a1990 ffdd2298 f75a2d88 [01:02:40] [debug] ESP+000002e0: 0a2f60d8 efe029e0 f6e82eab f717448c [01:02:40] [debug] ESP+00000300: 0a429aec f0a00890 ffdd22a8 f6eaaecd [01:02:40] [debug] ESP+00000320: efe020c8 f75e8f26 f6eaae8b f717448c [01:02:40] [debug] ESP+00000340: 0a3f7068 ffdd22c8 f7379a99 f76a7000 [01:02:40] [debug] ESP+00000360: efe020c8 ffdd2350 f6e9287b f717448c [01:02:40] [debug] ESP+00000380: 0a3f7064 ffdd2350 f76b3819 f6e9224c [01:02:40] [debug] ESP+000003a0: f0a00640 f0a00630 00000003 00000000 [01:02:40] [debug] ESP+000003c0: ffdd2358 f76dc96f f6e932db f717448c [01:02:40] [debug] ESP+000003e0: f0a008c8 00000000 ffdd23c8 f7400142 [01:02:40] [debug] Loaded modules: [01:02:40] [debug] 00000000 - 00187dc3 samp03svr [01:02:40] [debug] f76dc000 - f76dcd0b [01:02:40] [debug] f76c8000 - f76caa04 /lib/i386-linux-gnu/libdl.so.2 [01:02:40] [debug] f76ab000 - f76c66ef /lib/i386-linux-gnu/libpthread.so.0 [01:02:40] [debug] f7534000 - f76b4b4b /usr/lib/i386-linux-gnu/libstdc++.so.6 [01:02:40] [debug] f74df000 - f7533010 /lib/i386-linux-gnu/libm.so.6 [01:02:40] [debug] f74c2000 - f74de1e4 /lib/i386-linux-gnu/libgcc_s.so.1 [01:02:40] [debug] f730c000 - f74c891b /lib/i386-linux-gnu/libc.so.6 [01:02:40] [debug] f76dd000 - f77005d8 /lib/ld-linux.so.2 [01:02:40] [debug] f72c5000 - f7307ac4 plugins/crashdetect.so [01:02:40] [debug] f7207000 - f72c539a plugins/streamer.so [01:02:40] [debug] f71fe000 - f7205714 /lib/i386-linux-gnu/librt.so.1 [01:02:40] [debug] f71ee000 - f71fd1d4 plugins/sscanf.so [01:02:40] [debug] f6e5e000 - f71f33de plugins/mysql.so [01:02:40] [debug] f6e3a000 - f6e5dd32 /clients/reval/revalgaming.eu/samp/plugins/../log-core.so [01:02:40] [debug] f5e25000 - f5e362ec /lib/i386-linux-gnu/libnss_files.so.2 [01:02:40] [debug] f76d4000 - f76d72cc plugins/MerRandom.so [01:02:40] [debug] f5e19000 - f5e22918 plugins/whirlpool.so [01:02:40] [debug] f5ac9000 - f5d06854 plugins/YSF.so [01:02:40] [debug] f76cd000 - f76d1a38 /lib/i386-linux-gnu/libnss_dns.so.2 [01:02:40] [debug] f1d08000 - f1d1f494 /lib/i386-linux-gnu/libresolv.so.2

# ==================== Log-Core ========================

[01:02:40] [ERROR] signal 11 (SIGSEGV) catched; shutting log-core down (errno: 0, signal code: 1, exit status: -146022400)

# ===================== Mysql Log =======================

[01:02:40] [INFO] query "SELECT FROM s_seaded WHERE uid = 3" successfully executed within 0.134 milliseconds [01:02:40] [DEBUG] CResultSet::Create(connection=0xa339630, query_str='SELECT FROM s_seaded WHERE uid = 3') [01:02:40] [DEBUG] created new resultset '0xefe022f0' [01:02:40] [DEBUG] fetched MySQL result '0xefe025c8' [01:02:40] [DEBUG] allocated 124 bytes for PAWN result [01:02:40] [DEBUG] CConnection::Execute(query=0xa3f6014, this=0xa51df98, connection=0xa339630) [01:02:40] [DEBUG] CQuery::Execute(this=0xa3f6014, connection=0xa339630) [01:02:40] [INFO] query "INSERT INTO y_log_player (sqlid, sqlid2, nimi, nimi2, tyyp, text, pid, kuupaev, kell) VALUES ('1', '-1', 'Mathis_Frost', 'puudub', '3', '{D1CC43}TELEFON:{AAADAD} Sul ei ole ühtegi lugemata sõnumit!', '0', CURDATE(), CURTIME())" successfully executed within 0.79 milliseconds [01:02:40] [DEBUG] CResultSet::Create(connection=0xa339630, query_str='INSERT INTO y_log_player (sqlid, sqlid2, nimi, nimi2, tyyp, text, pid, kuupaev, kell) VALUES ('1', '-1', 'Mathis_Frost', 'puudub', '3', '{D1CC43}TELEFON:{AAADAD} Sul ei ole ühtegi lugemata sõnumit!', '0', CURDATE(), CURTIME())') [01:02:40] [DEBUG] created new resultset '0xefe000a0' [01:02:40] [DEBUG] fetched MySQL result '0x0' [01:02:40] [DEBUG] CCallback::Execute(amx=0xa64b988, index=-10002, num_params=1)

maddinat0r commented 6 years ago

Could you please show some more lines from the plugin log file?

EternityEST commented 6 years ago

Well, its currently grown too big, but i will delete it at the moment, it crashes time to time, not at server start, but in randomly. I searched alot yesterday, one guy spoke something about if you send multiple queryes, that then the plugin crashes, could that be the problem, currently if player logs in i load data from two tables at the same time.

Like that:

mysql_format(db, string, sizeof(string), "SELECT * FROM s_settings WHERE uid = %i", PlayerInfo[playerid][ForumID]); mysql_tquery(db, string, "LoadSettings", "i", playerid);

mysql_format(db, string, sizeof(string), "SELECT * FROM f_items WHERE characterSQLID = %i", PlayerInfo[playerid][SQLID]); mysql_query(db, string, "LoadItems", "i", playerid);

maddinat0r commented 6 years ago

No, sending multiple queries is absolutely fine. The PAWN callback index seems faulty, which is kind of weird. That's why I need more log output, to see which callback exactly that is and what query was sent.

MichaelBelgium commented 6 years ago

[01:02:40] [debug] #4 f72e24d5 in ?? () from plugins/crashdetect.so

Isn't it the crashdetect plugin that crashed the mysql plugin + the samp server? I've had it frequently that the crashdetect plugin crashed my server.

Don't use the crashdetect plugin and try again? :thinking:

maddinat0r commented 6 years ago

No, the crashdetect plugin just installed crash handlers, which are called in case of a fatal error. That's why the stack trace shows the crashdetect plugin. The actual crash likely happened here:

[01:02:40] [debug] #6 08095730 in ?? () from ./samp03svr

The next call would be likely an abort() call or something similar, and this functions invokes all crash handlers previously installed.

maddinat0r commented 6 years ago

Likely the same problem as in #189.