Mysql stockt beim Laden

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,


    Ich habe seit kurzem ein kurioses Problem: Beim Serverstart, also beim Laden der meisten Daten aus der Mysql Datenbank stoppt der Server einfach mit der Meldung Segementation fault. Ich habe nun schon sowohl mit Strickenkid's, als auch mit BlueG's Plugin probiet. Habe das Script nacheinander für beide Plugins angepasst - leider ohne erfolg. Hier ein auszug aus der Log von dem Plugin von BlueG:


    Spoiler anzeigen
    [22:04:29]
    [22:04:29] ---------------------------
    [22:04:29] MySQL Debugging activated (06/13/13)
    [22:04:29] ---------------------------
    [22:04:29]
    [22:04:29] >> mysql_query( Connection handle: 1 )
    [22:04:29] CMySQLHandler::Query(SELECT * FROM config LIMIT 1) - Successfully executed.
    [22:04:29] >> mysql_store_result( Connection handle: 1 )
    [22:04:29] CMySQLHandler::StoreResult() - Result was stored.
    [22:04:29] >> mysql_num_rows( Connection handle: 1 )
    [22:04:29] CMySQLHandler::NumRows() - Returned 1 row(s)
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("hausanzahl") -
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("staatskasse") -
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("steuern") -
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("kfzsteuer") -
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("benzinsteuer") -
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("vermoegenssteuer") -
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("arbeitslosengeld") -
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("lotto") -
    [22:04:29] >> mysql_free_result( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [........}
    [22:04:29] CMySQLHandler::Query(SELECT * FROM fraktionen WHERE id = 23) - Successfully executed.
    [22:04:29] >> mysql_store_result( Connection handle: 1 )
    [22:04:29] CMySQLHandler::StoreResult() - Result was stored.
    [22:04:29] >> mysql_num_rows( Connection handle: 1 )
    [22:04:29] CMySQLHandler::NumRows() - Returned 0 row(s)
    [22:04:29] >> mysql_free_result( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [22:04:29] >> mysql_query( Connection handle: 1 )
    [22:04:29] CMySQLHandler::Query(SELECT * FROM haeuser) - Successfully executed.
    [22:04:29] >> mysql_store_result( Connection handle: 1 )
    [22:04:29] CMySQLHandler::StoreResult() - Result was stored.
    [22:04:29] >> mysql_fetch_row_format( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchRow() - Return: 0|1|niemand|1|1|1|1|1|1|1|1
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )
    [22:04:29] CMySQLHandler::FetchField("hid") - 0
    [22:04:29] >> mysql_fetch_field_row( Connection handle: 1 )


    Strickenkid's Plugin:


    Spoiler anzeigen
    [Thu Jun 13 21:39:07 2013] -------------------------
    [Thu Jun 13 21:39:07 2013] Logging Started
    [Thu Jun 13 21:39:07 2013] -------------------------
    [Thu Jun 13 21:39:07 2013] Function: mysql_init executed with result: "0".
    [Thu Jun 13 21:39:07 2013] Connected (0) to sa-mp @ 127.0.0.1 via TCP/IP.
    [Thu Jun 13 21:39:07 2013] MySQL Server Version 5.1.66-0+squeeze1.
    [Thu Jun 13 21:39:07 2013] Function: mysql_query executed: "SELECT * FROM config LIMIT 1" with result: "0".
    [Thu Jun 13 21:39:07 2013] Function: mysql_store_result executed with result: "1"
    [Thu Jun 13 21:39:07 2013] Function: mysql_num_rows executed with result: "%".
    [Thu Jun 13 21:39:07 2013] Function: mysql_fetch_field executed.


    Server log:


    Spoiler anzeigen

    ----------
    Loaded log file: "server_log.txt".
    ----------

    Spoiler anzeigen
    SA-MP Dedicated Server
    ----------------------
    v0.3x, (C)2005-2013 SA-MP Team

    Spoiler anzeigen
    [22:02:19] filterscripts = "" (string)
    [22:02:19]
    [22:02:19] Server Plugins
    [22:02:19] --------------
    [22:02:19] Loading plugin: mysql.so
    [22:02:19]

    Spoiler anzeigen
    > MySQL plugin R6 successfully loaded.

    Spoiler anzeigen
    [22:02:19] Loaded.
    [22:02:19] Loading plugin: streamer.so
    [22:02:19]

    Spoiler anzeigen
    *** Streamer Plugin v2.6.1 by Incognito loaded ***

    Spoiler anzeigen
    [22:02:19] Loaded.
    [22:02:19] Loaded 2 plugins.

    Spoiler anzeigen
    [22:02:19]
    [22:02:19] Filterscripts
    [22:02:19] ---------------
    [22:02:19] Loaded 0 filterscripts.

    Spoiler anzeigen
    [22:02:19] Config wird geladen..
    [22:02:19] 1
    [22:02:19] 2
    [22:02:19] 3
    [22:02:19] 4
    [22:02:19] 5
    [22:02:19] 6
    [22:02:19] 7
    [22:02:19] Config wurde geladen!
    [22:02:19] Fraktionen werden geladen..
    [22:02:19] Fraktionsid 1, Name: wurde geladen
    [22:02:19] Fraktionen wurden geladen!
    [22:02:19] Häuser werden geladen..



    config laden:


    Spoiler anzeigen
    stock Load_Config()
    {
    print("1");
    new data[128];
    print("2");
    mysql_query("SELECT * FROM config LIMIT 1");
    print("3");
    mysql_store_result();
    print("4");
    if(mysql_num_rows())
    {
    print("5");
    data = "baum";
    mysql_fetch_field("hausanzahl",data);
    Config[hausanzahl] = strval(data);
    mysql_fetch_field("staatskasse",data);
    Config[staatskasse] = strval(data);
    mysql_fetch_field("steuern",data);
    Config[steuern] = strval(data);
    mysql_fetch_field("kfzsteuer",data);
    Config[kfzsteuer] = strval(data);
    mysql_fetch_field("benzinsteuer",data);
    Config[benzinsteuer] = strval(data);
    mysql_fetch_field("vermoegenssteuer",data);
    Config[vermoegenssteuer] = strval(data);
    mysql_fetch_field("arbeitslosengeld",data);
    Config[arbeitslosengeld] = strval(data);
    mysql_fetch_field("lotto",data);
    Config[lotto] = strval(data);
    }
    print("6");
    mysql_free_result();
    print("7");
    return 1;
    }


    Häuser laden:


    Spoiler anzeigen
    stock Load_Houses()
    {
    new data[128];
    mysql_query("SELECT * FROM haeuser");
    mysql_store_result();
    new count;
    new string[128], result[256];
    while(mysql_fetch_row(result))
    {
    mysql_fetch_field("hid",data);
    hInfo[count][hid] = strval(data);
    mysql_fetch_field("hart",data);
    hInfo[count][hArt] = strval(data);
    mysql_fetch_field("hbesitzer",data);
    hInfo[count][hBesitzer] = data;
    mysql_fetch_field("henterx",data);
    hInfo[count][hEnterX] = floatstr(data);
    mysql_fetch_field("hentery",data);
    hInfo[count][hEnterY] = floatstr(data);
    mysql_fetch_field("henterz",data);
    hInfo[count][hEnterZ] = floatstr(data);
    mysql_fetch_field("hexitx",data);
    hInfo[count][hExitX] = floatstr(data);
    mysql_fetch_field("hexity",data);
    hInfo[count][hExitY] = floatstr(data);
    mysql_fetch_field("hexitz",data);
    hInfo[count][hExitZ] = floatstr(data);
    mysql_fetch_field("hint",data);
    hInfo[count][hInt] = strval(data);
    mysql_fetch_field("hpreis",data);
    hInfo[count][hPreis] = strval(data);
    format(string, sizeof(string), "Haus: %i, %i, %s, %f.2,%f.2,%f.2,%f.2,%f.2,%f.2,%i,%i erfolgreich geladen!",
    hInfo[count][hid], hInfo[count][hArt], hInfo[count][hBesitzer], hInfo[count][hEnterX], hInfo[count][hEnterY], hInfo[count][hEnterZ],
    hInfo[count][hExitX], hInfo[count][hExitY], hInfo[count][hExitZ], hInfo[count][hInt], hInfo[count][hPreis]);
    print(string);
    count++;
    }
    mysql_free_result();
    }


    PuTTy sagt einfach Segementation fault....
    Komischerweise stoppen beide Plugins an einer anderen Stelle, ich kann euch versichern: Es hat, bevor ich apt-get upgrade durchgeführt habe(ich glaube das ist die Ursache), definitiv funktioniert.



    MfG
    Hammerboy

    Einmal editiert, zuletzt von Hammerboy ()

  • Habe den Server schon einmal komplett neu installiert... ich denke das liegt an irgendeinem mysql-dienst-update, welches ich mit dem upgrade befehl installiert hab. Der Server hat ja in der exakt selben Konfiguration funktioniert. Nur sind halt ein paar Programme aktualisiert wurden.


    Gibt es eine Log, die die Änderungen von apt-get upgrade anzeigt? Und, wenn ja, gibt es so etwas wie downgrades für Programme?

  • Habe jetzt den Server zum 3. mal neu installiert und habe crashdetect durchlaufen lassen. dieses sagt, dass der crash wohl durch fetch_field ausgelöst wird....


    hier nochmal alle Logs:


    Server:

    Spoiler anzeigen
    ----------
    Loaded log file: "server_log.txt".
    ----------

    Spoiler anzeigen
    SA-MP Dedicated Server
    ----------------------
    v0.3x, (C)2005-2013 SA-MP Team

    Spoiler anzeigen
    [21:05:30] filterscripts = "" (string)
    [21:05:30]
    [21:05:30] Server Plugins
    [21:05:30] --------------
    [21:05:30] Loading plugin: mysql.so
    [21:05:30] SA:MP MySQL Plugin v2.1.1 Loaded.
    [21:05:30] Loaded.
    [21:05:30] [MySQL] Thread running. Threadsafe: Yes.
    [21:05:30] Loading plugin: streamer.so
    [21:05:30]

    Spoiler anzeigen
    *** Streamer Plugin v2.6.1 by Incognito loaded ***

    Spoiler anzeigen
    [21:05:30] Loaded.
    [21:05:30] Loading plugin: crashdetect.so
    [21:05:30] crashdetect v4.9 is OK.
    [21:05:30] Loaded.
    [21:05:30] Loading plugin: nativechecker.so
    [21:05:30] Loaded.
    [21:05:30] Loaded 4 plugins.

    Spoiler anzeigen
    [21:05:30]
    [21:05:30] Filterscripts
    [21:05:30] ---------------
    [21:05:30] Loaded 0 filterscripts.

    Spoiler anzeigen
    [21:05:30] [MySQL] Connected (0) to 'samp'@'127.0.0.1 via TCP/IP'.
    [21:05:30] [MySQL] Server Version 5.5.31-0+wheezy1.
    [21:05:30] Config wird geladen..
    [21:05:30] [debug] Server crashed while executing script.amx
    [21:05:30] [debug] AMX backtrace:
    [21:05:30] [debug] #0 native mysql_fetch_field () [f7410610] from mysql.so
    [21:05:30] [debug] #1 0003e608 in Load_Config () at C:\Users\Tim\Desktop\script.pwn:5849
    [21:05:30] [debug] #2 00003264 in public Itter_OnGameModeInit () at C:\Users\Tim\Desktop\script.pwn:855
    [21:05:30] [debug] #3 native CallLocalFunction () [080d2870] from samp03svr
    [21:05:30] [debug] #4 00000c88 in public OnGameModeInit () at C:\Users\Tim\Desktop\pawno\include\foreach.inc:667
    [21:05:30] [debug] System backtrace:
    [21:05:30] [debug] #0 f6b4635b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
    [21:05:30] [debug] #1 f6b3f389 in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
    [21:05:30] [debug] #2 f6b418ed in _ZN11crashdetect11OnExceptionEPv () from plugins/crashdetect.so
    [21:05:30] [debug] #3 f6b45e68 in ?? () from plugins/crashdetect.so
    [21:05:30] [debug] #4 f7739410 in ?? ()
    [21:05:30] [debug] #5 f74fbad6 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
    [21:05:30] [debug] #6 f740cd9b in _Z9SetStringP6tagAMXiPKc () from plugins/mysql.so
    [21:05:30] [debug] #7 f7410701 in _ZN7Natives19n_mysql_fetch_fieldEP6tagAMXPi () from plugins/mysql.so
    [21:05:30] [debug] #8 08093c94 in ?? () from ./samp03svr
    [21:05:30] [debug] #9 f6b41ea7 in _ZN11crashdetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
    [21:05:30] [debug] #10 f6b4441e in ?? () from plugins/crashdetect.so
    [21:05:30] [debug] #11 f6b4806e in amx_Exec () from plugins/crashdetect.so
    [21:05:30] [debug] #12 f6b41dab in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
    [21:05:30] [debug] #13 f6b44457 in ?? () from plugins/crashdetect.so
    [21:05:30] [debug] #14 080d2b12 in ?? () from ./samp03svr
    [21:05:30] [debug] #15 08093c94 in ?? () from ./samp03svr
    [21:05:30] [debug] #16 f6b41ea7 in _ZN11crashdetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
    [21:05:30] [debug] #17 f6b4441e in ?? () from plugins/crashdetect.so
    [21:05:30] [debug] #18 f6b4806e in amx_Exec () from plugins/crashdetect.so
    [21:05:30] [debug] #19 f6b41dab in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
    [21:05:30] [debug] #20 f6b44457 in ?? () from plugins/crashdetect.so
    [21:05:30] [debug] #21 080acc4b in ?? () from ./samp03svr
    [21:05:30] [debug] #22 080b2b3d in ?? () from ./samp03svr
    [21:05:30] [debug] #23 080b1407 in ?? () from ./samp03svr
    [21:05:30] [debug] #24 f7492e46 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
    [21:05:30] [debug] #25 0804b521 in ?? () from ./samp03svr


    Mysql Debug:

    Spoiler anzeigen
    [Wed Jun 19 21:05:30 2013] -------------------------
    [Wed Jun 19 21:05:30 2013] Logging Started
    [Wed Jun 19 21:05:30 2013] -------------------------
    [Wed Jun 19 21:05:30 2013] Function: mysql_init executed with result: "0".
    [Wed Jun 19 21:05:30 2013] Connected (0) to samp @ 127.0.0.1 via TCP/IP.
    [Wed Jun 19 21:05:30 2013] MySQL Server Version 5.5.31-0+wheezy1.
    [Wed Jun 19 21:05:30 2013] Function: mysql_query executed: "SELECT * FROM config LIMIT 1" with result: "0".
    [Wed Jun 19 21:05:30 2013] Function: mysql_store_result executed with result: "1"
    [Wed Jun 19 21:05:30 2013] Function: mysql_num_rows executed with result: "%".
    [Wed Jun 19 21:05:30 2013] Function: mysql_fetch_field executed.


    Inhalt der Datenbank:
    data.PNG




    Update: Hab ein anderes Problem durch die Benutzung eines anderen Plugins gefixxt. Falls dieses Problem noch wem wiederfährt, use this

    Einmal editiert, zuletzt von Hammerboy () aus folgendem Grund: update