[LINUX][MySQL] Segmentation fault bei mysql_fetch_field

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo,


    bei meinem Script kommt seit dem letzten Kompilern ein Segmentation Fault (Speicherzugriffsverletzung) in folgendem Script:




    stock mysql_fetch_field_row(dest[], const fieldname[], handle = 0) mysql_fetch_field(fieldname, dest, handle);
    [....]
    Function LoadTankstellen()
    {
    new result[100];
    for(new t=0; t<sizeof(TankInfo); t++)
    {
    format(mysql_string, sizeof mysql_string, "SELECT * FROM `tankstellen` WHERE id = '%d'", t+1);
    mysql_query(mysql_string);
    mysql_store_result();
    if(mysql_num_rows() == 1)
    {
    /*mysql_fetch_field_row(TankInfo[t][tOwner],"Owner"); //ORGINALE FEHLERZEILE
    mysql_fetch_field_row(TankInfo[t][tTeilhaber],"Teilhaber");
    mysql_fetch_field_row(result,"Owned"); TankInfo[t][tOwned] = strval( result );
    mysql_fetch_field_row(TankInfo[t][tName],"Name");
    mysql_fetch_field_row(result,"PosX"); TankInfo[t][tPosX] = floatstr( result );
    mysql_fetch_field_row(result,"PosY"); TankInfo[t][tPosY] = floatstr( result );
    mysql_fetch_field_row(result,"PosZ"); TankInfo[t][tPosZ] = floatstr( result );
    mysql_fetch_field_row(result,"TankPreis"); TankInfo[t][tTankPreis] = strval( result );
    mysql_fetch_field_row(result,"BenzinPreis"); TankInfo[t][tBenzinPreis] = strval( result );
    mysql_fetch_field_row(result,"BenzinLager"); TankInfo[t][tBenzinLager] = strval( result );
    mysql_fetch_field_row(result,"BenzinKauf"); TankInfo[t][tBenzinKauf] = strval( result );
    mysql_fetch_field_row(result,"DieselPreis"); TankInfo[t][tDieselPreis] = strval( result );
    mysql_fetch_field_row(result,"DieselLager"); TankInfo[t][tDieselLager] = strval( result );
    mysql_fetch_field_row(result,"DieselKauf"); TankInfo[t][tDieselKauf] = strval( result );
    mysql_fetch_field_row(result,"SuperPreis"); TankInfo[t][tSuperPreis] = strval( result );
    mysql_fetch_field_row(result,"SuperLager"); TankInfo[t][tSuperLager] = strval( result );
    mysql_fetch_field_row(result,"SuperKauf"); TankInfo[t][tSuperKauf] = strval( result );
    mysql_fetch_field_row(result,"KerosinPreis"); TankInfo[t][tKerosinPreis] = strval( result );
    mysql_fetch_field_row(result,"KerosinLager"); TankInfo[t][tKerosinLager] = strval( result );
    mysql_fetch_field_row(result,"KerosinKauf"); TankInfo[t][tKerosinKauf] = strval( result );
    mysql_fetch_field_row(result,"TankBank"); TankInfo[t][tTankBank] = strval( result );*/


    mysql_fetch_field("Owner", TankInfo[t][tOwner]); //Auch hier tritt das Problem 1 zu 1 auf
    mysql_fetch_field("Teilhaber", TankInfo[t][tTeilhaber]);
    mysql_fetch_field("Owned", result); TankInfo[t][tOwned] = strval( result );
    mysql_fetch_field("Name", TankInfo[t][tName]);
    mysql_fetch_field("PosX", result); TankInfo[t][tPosX] = floatstr( result );
    mysql_fetch_field("PosY", result); TankInfo[t][tPosY] = floatstr( result );
    mysql_fetch_field("PosZ", result); TankInfo[t][tPosZ] = floatstr( result );
    mysql_fetch_field("TankPreis", result); TankInfo[t][tTankPreis] = strval( result );
    mysql_fetch_field("BenzinPreis", result); TankInfo[t][tBenzinPreis] = strval( result );
    mysql_fetch_field("BenzinLager", result); TankInfo[t][tBenzinLager] = strval( result );
    mysql_fetch_field("BenzinKauf", result); TankInfo[t][tBenzinKauf] = strval( result );
    mysql_fetch_field("DieselPreis", result); TankInfo[t][tDieselPreis] = strval( result );
    mysql_fetch_field("DieselLager", result); TankInfo[t][tDieselLager] = strval( result );
    mysql_fetch_field("DieselKauf", result); TankInfo[t][tDieselKauf] = strval( result );
    mysql_fetch_field("SuperPreis", result); TankInfo[t][tSuperPreis] = strval( result );
    mysql_fetch_field("SuperLager", result); TankInfo[t][tSuperLager] = strval( result );
    mysql_fetch_field("SuperKauf", result); TankInfo[t][tSuperKauf] = strval( result );
    mysql_fetch_field("KerosinPreis", result); TankInfo[t][tKerosinPreis] = strval( result );
    mysql_fetch_field("KerosinLager", result); TankInfo[t][tKerosinLager] = strval( result );
    mysql_fetch_field("KerosinKauf", result); TankInfo[t][tKerosinKauf] = strval( result );
    mysql_fetch_field("TankBank", result); TankInfo[t][tTankBank] = strval( result );
    }
    mysql_free_result();
    }
    }


    Der Auskommentierte Code ist der Code, der bislang (fast) immer funktioniert hat.
    Erst seit heute morgen fährt er sich fest.
    Die Verbindung zur Datenbank wird hergestellt (Siehe Server Log).
    Geändert wurde an diesem Teil des Scriptes nichts, deswegen ist mir der Fehler unerklärlich.


    Server_Log:

    Code
    SA-MP Dedicated Server----------------------v0.3z-R3, (C)2005-2014 SA-MP Team[13/07/2014 11:41:40] [13/07/2014 11:41:40] Server Plugins[13/07/2014 11:41:40] --------------[13/07/2014 11:41:40]  Loading plugin: crashdetect.so[13/07/2014 11:41:40]   CrashDetect v4.11.2 is OK.[13/07/2014 11:41:40]   Loaded.[13/07/2014 11:41:40]  Loading plugin: mysql.so[13/07/2014 11:41:40]  SA:MP MySQL Plugin v2.1.1 Loaded.[13/07/2014 11:41:40] [MySQL] Thread running. Threadsafe: Yes.[13/07/2014 11:41:40]   Loaded.[......][13/07/2014 11:41:41] [MySQL] Connected (0) to 'system_samp'@'127.0.0.1 via TCP/IP'.[13/07/2014 11:41:41] [MySQL] Server Version 5.5.37-0+wheezy1.[13/07/2014 11:41:41]  [ EXP: INFO ] STARTING (1.0.0)![......][13/07/2014 11:41:41] [debug] Server crashed while executing GermanReallife.amx[13/07/2014 11:41:41] [debug] AMX backtrace:[13/07/2014 11:41:41] [debug] #0 native mysql_fetch_field () [f6a97610] from mysql.so[13/07/2014 11:41:41] [debug] #1 0022d828 in public LoadTankstellen () from GermanReallife.amx[13/07/2014 11:41:41] [debug] #2 000698cc in public Streamer_OnGameModeInit () from GermanReallife.amx[13/07/2014 11:41:41] [debug] #3 native CallLocalFunction () [080dcc00] from samp03svrz[13/07/2014 11:41:41] [debug] #4 00008128 in public OnGameModeInit () from GermanReallife.amx[13/07/2014 11:41:41] [debug] Native backtrace:[13/07/2014 11:41:41] [debug] #0 f749660b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #1 f748de92 in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #2 f748f8d9 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #3 f74962a0 in ?? () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #4 f7765410 in ?? ()[13/07/2014 11:41:41] [debug] #5 f75262e6 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6[13/07/2014 11:41:41] [debug] #6 f6a93d9b in _Z9SetStringP6tagAMXiPKc () from plugins/mysql.so[13/07/2014 11:41:41] [debug] #7 f6a97701 in _ZN7Natives19n_mysql_fetch_fieldEP6tagAMXPi () from plugins/mysql.so[13/07/2014 11:41:41] [debug] #8 08094054 in ?? () from ./samp03svrz[13/07/2014 11:41:41] [debug] #9 f748d5fc in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #10 f749215c in ?? () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #11 f749a64d in amx_Exec () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #12 f748fabb in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #13 f7492100 in ?? () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #14 080dcea2 in ?? () from ./samp03svrz[13/07/2014 11:41:41] [debug] #15 08094054 in ?? () from ./samp03svrz[13/07/2014 11:41:41] [debug] #16 f748d5fc in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #17 f749215c in ?? () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #18 f749a64d in amx_Exec () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #19 f748fabb in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #20 f7492100 in ?? () from plugins/crashdetect.so[13/07/2014 11:41:41] [debug] #21 080a3a6b in ?? () from ./samp03svrz[13/07/2014 11:41:41] [debug] #22 080a9e2d in ?? () from ./samp03svrz[13/07/2014 11:41:41] [debug] #23 080a86d2 in ?? () from ./samp03svrz[13/07/2014 11:41:41] [debug] #24 f74bce66 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6[13/07/2014 11:41:41] [debug] #25 0804b4d1 in ?? () from ./samp03svrz


    Strace Log:
    Als Anhang, hier ein kleiner Ausschnitt:

    Code
    connect(7, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("127.0.0.1")}, 16) = 0setsockopt(7, SOL_SOCKET, SO_RCVTIMEO, "\2003\341\1\0\0\0\0", 8) = 0setsockopt(7, SOL_SOCKET, SO_SNDTIMEO, "\2003\341\1\0\0\0\0", 8) = 0setsockopt(7, SOL_IP, IP_TOS, [8], 4)   = 0setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0setsockopt(7, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0read(7, "T\0\0\0\n5.5.37-0+wheezy1\0\306l\0\0Js&b:;"..., 16384) = 88stat64("/usr/local/mysql/share/mysql/charsets/Index.xml", 0xff8a39fc) = -1 ENOENT (No such file or directory)futex(0xf6aff400, FUTEX_WAKE_PRIVATE, 2147483647) = 0write(7, "M\0\0\1\r\242\0\0\0\0\0@\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 81) = 81read(7, "\7\0\0\2\0\0\0\2\0\0\0", 16384) = 11time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [MySQL] Co"..., 85) = 85time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [MySQL] Se"..., 63) = 63time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(6, "[Sun Jul 13 11:41:41 2014] Conne"..., 80) = 80time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(6, "[Sun Jul 13 11:41:41 2014] MySQL"..., 66) = 66time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41]  [ EXP: IN"..., 55) = 55time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] --------- "..., 74) = 74time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74gettimeofday({1405244501, 778891}, NULL) = 0gettimeofday({1405244501, 778934}, NULL) = 0gettimeofday({1405244501, 778975}, NULL) = 0time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] --------- "..., 67) = 67time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] --------- "..., 70) = 70time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] --------- "..., 67) = 67time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] ----------"..., 74) = 74poll([{fd=7, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)write(7, ",\0\0\0\3SELECT * FROM  `tankstellen"..., 48) = 48read(7, "\1\0\0\1\26;\0\0\2\3def\vsystem_samp\vtankst"..., 16384) = 1813time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(6, "[Sun Jul 13 11:41:41 2014] Funct"..., 123) = 123time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(6, "[Sun Jul 13 11:41:41 2014] Funct"..., 82) = 82time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(6, "[Sun Jul 13 11:41:41 2014] Funct"..., 79) = 79time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(6, "[Sun Jul 13 11:41:41 2014] Funct"..., 65) = 65--- SIGSEGV (Segmentation fault) @ 0 (0) ---time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] Se"..., 80) = 80time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] AM"..., 45) = 45time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #0"..., 86) = 86time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 95) = 95time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 103) = 103time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #3"..., 88) = 88time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #4"..., 94) = 94futex(0xf7608d7c, FUTEX_WAKE_PRIVATE, 2147483647) = 0time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] Na"..., 48) = 48time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #0"..., 97) = 97time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 118) = 118time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 109) = 109time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #3"..., 79) = 79time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #4"..., 51) = 51time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #5"..., 96) = 96time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #6"..., 95) = 95time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #7"..., 114) = 114time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #8"..., 69) = 69time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #9"..., 115) = 115time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 80) = 80time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 86) = 86time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 108) = 108time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 80) = 80time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 70) = 70time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 70) = 70time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 116) = 116time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 80) = 80time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 86) = 86time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #1"..., 108) = 108time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 80) = 80time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 70) = 70time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 70) = 70time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 70) = 70time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 112) = 112time(NULL)                              = 1405244501stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0write(3, "[13/07/2014 11:41:41] [debug] #2"..., 70) = 70rt_sigaction(SIGSEGV, {SIG_DFL, [], 0}, NULL, 8) = 0tgkill(29813, 29813, SIGSEGV)           = 0rt_sigreturn(0x41)                      = 0--- SIGSEGV (Segmentation fault) @ 0 (0) ---+++ killed by SIGSEGV +++


    Server.cfg

    Code
    echo Executing Server Config...lanmode 0rcon_password *************maxplayers 75port 7777hostname Testservergamemode0 Script 1filterscripts autos fahrschule sonstige.objecte Warnlicht blinkerannounce 1query 1weburl onfoot_rate 40incar_rate 40weapon_rate 40stream_distance 300.0stream_rate 1000maxnpc 50plugins crashdetect.so mysql.so sscanf.so streamer.so socket.so SyncHTTP.sologtimeformat [%d/%m/%Y %H:%M:%S]mapname Testmapprofile_gamemode 1profile_filterscriptsprofile_format htmlcall_graph 0password ******


    System und Plugins

    Spoiler anzeigen

    Server: Debian Root Server (Root Rechte vorhanden)
    MySQL: 5.5.37-0+wheezy1
    MySQL Plugin: MySQL Plugin von Strickenkid (http://forum.sa-mp.com/showthread.php?t=122983)
    SA:MP Server wird nicht als Root ausgeführt.


    Vielleicht hat hier jemand nen Tipp, wie man das Problem, welches nur sporadisch Auftritt, lösen kann.


    MfG
    Wepper

  • Ich rate dir die funktion
    mysql_fetch_row_format zu nutzen bevor du die dinge laden willst, denn der Server schmiert ab sobald kein ergebnis vorhanden ist

    Hallo,


    leider hat das Plugin von Strickenkid kein mysql_fetch_row_format, sondern nur mysql_fetch_row.


    Aber um nochmal zum Problem zum Problem zurückzukommen:


    Ich habe eigentlich nur zu Debugzwecken folgenden Code eingefügt, und nun scheint es zu funktionieren:



    format(mysql_string, sizeof mysql_string, "SELECT * FROM `tankstellen` WHERE id = '%d'", t+1);
    mysql_query(mysql_string);
    mysql_store_result();
    mysql_fetch_row(result);
    printf("%s", result);
    if(mysql_num_rows() == 1)
    [......]

    Mit freundlichem Gruß
    Weper

  • Ahh das ist das Strickenkid plugin...
    Ok dann fehlt dir das mysql_fetch_row_data
    Hier mal nen Auszug von mir wie ich das mache
    mysql_store_result(SqlConnection[0]);
    //hier könnte man abfragen wie viele felder vorhanden sind brauch ich bei den beispiel aber net ^^
    mysql_fetch_row_data(SqlConnection[0]);
    mysql_fetch_field("time",query,SqlConnection[0]);
    mysql_free_result(SqlConnection[0]);

    All in all it's just another brick in the wall

  • Hallo.


    Hab jetzt folgenden Code, mit dem im Moment keine weiteren Fehler auftretten.
    Danke an Beavis für die Tipps.



    Function LoadTankstellen()
    {
    new result[1000];
    for(new t=0; t<sizeof(TankInfo); t++)
    {
    format(mysql_string, sizeof mysql_string, "SELECT * FROM `tankstellen` WHERE id = '%d'", t+1);
    mysql_query(mysql_string);
    mysql_store_result();
    mysql_fetch_row(result);
    printf("%s", result);
    if(mysql_num_rows() == 1)
    {
    mysql_fetch_field("Owner", TankInfo[t][tOwner]);
    mysql_fetch_field("Teilhaber", TankInfo[t][tTeilhaber]);
    mysql_fetch_field("Owned", result); TankInfo[t][tOwned] = strval( result );
    mysql_fetch_field("Name", TankInfo[t][tName]);
    mysql_fetch_field("PosX", result); TankInfo[t][tPosX] = floatstr( result );
    mysql_fetch_field("PosY", result); TankInfo[t][tPosY] = floatstr( result );
    mysql_fetch_field("PosZ", result); TankInfo[t][tPosZ] = floatstr( result );
    mysql_fetch_field("TankPreis", result); TankInfo[t][tTankPreis] = strval( result );
    mysql_fetch_field("BenzinPreis", result); TankInfo[t][tBenzinPreis] = strval( result );
    mysql_fetch_field("BenzinLager", result); TankInfo[t][tBenzinLager] = strval( result );
    mysql_fetch_field("BenzinKauf", result); TankInfo[t][tBenzinKauf] = strval( result );
    mysql_fetch_field("DieselPreis", result); TankInfo[t][tDieselPreis] = strval( result );
    mysql_fetch_field("DieselLager", result); TankInfo[t][tDieselLager] = strval( result );
    mysql_fetch_field("DieselKauf", result); TankInfo[t][tDieselKauf] = strval( result );
    mysql_fetch_field("SuperPreis", result); TankInfo[t][tSuperPreis] = strval( result );
    mysql_fetch_field("SuperLager", result); TankInfo[t][tSuperLager] = strval( result );
    mysql_fetch_field("SuperKauf", result); TankInfo[t][tSuperKauf] = strval( result );
    mysql_fetch_field("KerosinPreis", result); TankInfo[t][tKerosinPreis] = strval( result );
    mysql_fetch_field("KerosinLager", result); TankInfo[t][tKerosinLager] = strval( result );
    mysql_fetch_field("KerosinKauf", result); TankInfo[t][tKerosinKauf] = strval( result );
    mysql_fetch_field("TankBank", result); TankInfo[t][tTankBank] = strval( result );
    }
    mysql_free_result();
    }
    }

    Mit freundlichem Gruß
    Weper