Crash with SZ_GetSpace overflow on netchan -> message

Сообщения
219
Реакции
42
Yes, I already search the error and nothing to solve this found.
only people complaining about this or non-useful solutions.

There are two problems:
  1. Crash with SZ_GetSpace overflow on (Player Nick)
  2. Crash with SZ_GetSpace overflow on netchan -> message

First crash I solved it by hooking Con_Printf on ReHLDS and kicking the player who committed that overflow more than 10 times.
Second crash I don't know how to discover what is causing it.

It seems be caused by so many HUDs / messages / information sending to clients. By that's all.
Plugins aren't sending an incorrect message or similar.

That's my plugin to solve first crash:
Код:
#include <amxmodx>
#include <reapi>

new g_iWarns[33]
new Float:g_fLastWarn[33]

new g_LogNetchan

public plugin_init()
{
    register_plugin("SZ_GetSpace Overflow fix", "0.1", "RauliTop")

    register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

    // to avoid getting console message when server starts up
    set_task(20.0, "enable_Con_Printf_hook")
}

public client_putinserver(id)
{
    g_iWarns[id] = 0
    g_fLastWarn[id] = 0.0
}

public event_new_round()
{
    g_LogNetchan = 0
}

public enable_Con_Printf_hook()
{
    RegisterHookChain(RH_Con_Printf, "RH_Con_Printf_Pre", 0);
}

public RH_Con_Printf_Pre(const string[])
{
    // to be able log_amx without doing a loop crash
    new iContain = contain(string, ".amxx")
    if (iContain > -1)
        return HC_CONTINUE;

    iContain = contain(string, "SZ_GetSpace: overflow on ")
    if(iContain == -1) {
        return HC_CONTINUE;
    }

    const iLenOfPattern = 25 // length of "SZ_GetSpace: overflow on "
    new szName[32]
    copy(szName, charsmax(szName), string[iContain + iLenOfPattern])
    replace_all(szName, charsmax(szName), "^n", "") // remove 'next line' from name string

    new id = get_user_index(szName)
    if (!id) // name = netchan->message
    {
        g_LogNetchan++

        if (g_LogNetchan <= 3) // max 3 lines per round
            log_to_file("overflow.log", "NOT FOUND overflow on %s", szName)

        return HC_SUPERCEDE; // block show message at console
    }

    g_iWarns[id]++
    log_to_file("overflow.log", "Warns: %d | overflow on %s", g_iWarns[id], szName)

    new Float:LastTime = get_gametime()
    if (g_iWarns[id] >= 10 && LastTime - g_fLastWarn[id] <= 1.5)
    {
        new iUserId = get_user_userid(id)
        server_cmd("kick #%d ^"Unrealiable channel overflowed^"", iUserId)

        log_to_file("overflow.log", "kicked %s", szName)
    }

    g_fLastWarn[id] = LastTime

    return HC_SUPERCEDE; // block show message at console
}
 
Последнее редактирование:
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
good soup if problem not printed then there isn't.
 
Сообщения
673
Реакции
242
Помог
11 раз(а)
Как вариант в коде
Код:
if (!id) // name = netchan->messag
{

}
можно включить булевую на true, и во-всех плагинах где участвует message_begin, hud, dhud, chat_color_print и тд, просто дать ограничение на показ и тд на какое-то время example if(true) return 0

тем самым решаем;
1) спам всяких дхуд, info и тд
2) нормализация передача пакетов




делать проверку если SZ_GetSpace: overflow on не поступало через N секунд то вырубить булевую (false) и дальше показывать инфу

Код:
if (!id) // name = netchan->message
{
    g_LogNetchan++

    if (g_LogNetchan <= 3) // max 3 lines per round
    {
        log_to_file("overflow.log", "NOT FOUND overflow on %s", szName)
        g_iUserOverflow[id] = true;
    }

    return HC_SUPERCEDE; // block show message at console
}

stock dHudMessage(index, szText)
{
    if(g_iUserOverflow[index])
        return 0;
    
    set_dhudmessage(0, 255, 0, -1.0, -1.0, 2, 1.0, 1.0, 0.1, 1.0, false);
    show_dhudmessage(index, "%s", szText);
    
    return 1;
}
 
Последнее редактирование:
Сообщения
219
Реакции
42
Limbooc
When the overflow is caused by netchan->message, there's no id.

Server is crashing once a month.

I am continuing to find the solution
 
Сообщения
219
Реакции
42
I tried to reduce this problem reducing HUDs, DHUDs calls.
Also delete some message_begin on plugins.

Nothing of this worked.

Server is crashing once a month, once a week, on the same day 2 times...
It's randomly.

Don't know how make. It's really frustating.

Anybody has some clue?
 
Сообщения
147
Реакции
29
You are trying with this code to hook crashes? Isnt it better to disable plugin by plugin and check what cause it and repair ofc ?
 
Сообщения
219
Реакции
42
You are trying with this code to hook crashes?
Yes. Hooking this crash and kicking the client that overflow the server works.
But I can't do nothing when the overflow is in: netchan -> message

Isnt it better to disable plugin by plugin and check what cause it and repair ofc ?
No, the server crash randomly. once a month, once a week, on the same day 2 times...
It's difficult to know what plugin is causing it, taking into account that is a big Zombie Mod.
All plugins are already reviewed, but nothing strange found.

The question is: anybody has a way to cause this error? a code example will be great
Searching in the Internet the information is confusing and answers are not 100% sure.
 
Сообщения
23
Реакции
8
Помог
1 раз(а)
@raulitop,what zp? 4.3 or 5.0.8? zp 4.3 trash, if 4.3 or 5.0.8 delete everything and re-insert gradually making your edits.

overflow messages are normal, can occur when the player closed the client in a peculiar way or minimize the game window, it is also important to work correctly with hud and hud.
 
Сообщения
219
Реакции
42
@raulitop,what zp? 4.3 or 5.0.8? zp 4.3 trash, if 4.3 or 5.0.8 delete everything and re-insert gradually making your edits.

overflow messages are normal, can occur when the player closed the client in a peculiar way or minimize the game window, it is also important to work correctly with hud and hud.
zp 4.3 edited from 2011-2022. But theses messages start to happen after a bigs updates on mod last year.
Overflow messages are normal yes, but not the server crash because of them.

Please, this type of comments doesn't help.
I need an answer of people that already solved it or has similar problems.
 
Сообщения
23
Реакции
8
Помог
1 раз(а)
raulitop, i had a similar problem on 4.3, zp 4.3 structure is disgusting,
the best solution is to put 5.0.8 and make your changes
 
Сообщения
219
Реакции
42
The most technical comment I found about this is:
SZ_Getspace Overflow on netchan
A bad vague one - some server error caused by a bad map. In one situation of this I know of, it was solved by copy/pasting the ENTIRE level over into another .rmf file; when another time it occured it was solved by reducing the number of doors that used the same sound. In a third it seems it was caused by too many player start entities?, and in a fourth by a bad .wav file. But really I don't know if this was really caused by the WAVs, or by bad brushes, ghost entitys, or what. good luck figuring it out!
Source: https://www.slackiller.com/tommy14/errors.htm#portalclip
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу