Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Crash using query_client_cvar #1087

Open
6 tasks done
NiceFeatures opened this issue Dec 17, 2023 · 3 comments
Open
6 tasks done

Server Crash using query_client_cvar #1087

NiceFeatures opened this issue Dec 17, 2023 · 3 comments

Comments

@NiceFeatures
Copy link

NiceFeatures commented Dec 17, 2023

Help us help you

  • I have checked that my issue doesn't exist yet.
  • I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
  • I can always reproduce the issue with the provided description below.

Environment

  • Operating System version: CentOs 7
  • Game/AppID (with version if applicable): 10
  • Current AMX Mod X version: 1.10 5467
  • Current Metamod version: MetaMod-r 1.3.0.138
# Problematic Code (or Steps to Reproduce)
#include <amxmodx>
#include <amxmisc>
#include <reapi>

public plugin_init()
{
        register_plugin("Query cvar", "1.0", "GH")
}

public client_putinserver(id)
{
        set_task_ex(10.0, "CheckCvars", id, .flags = SetTask_Once)
}

public CheckCvars(id)
{
        if(is_user_connected(id))
        {
                query_client_cvar(id, "cl_minmodels", "OnClMinModels_CallBack")
        }
}

public OnClMinModels_CallBack(id, const Cvar[], const Value[])
{
        if (equal(Cvar, "cl_minmodels"))
                if(str_to_num(Value) != 0)
                        rh_drop_client(id, fmt("Please use cl_minmodels 0"))
}

If use this query the server crashes in few minutes.

Logs

https://hastebin.com/share/sadelayefu.vbnet

According to s1lentq callback does not check that player can be disconnected instantly.

rehlds/Metamod-R#67 (comment)

@pizzahut2
Copy link
Contributor

  • The Hastebin content is gone.
  • The "include" commands are missing the file names, maybe more is missing. Using code tags would avoid this issue. Mark the code and then click the Code icon '<>'.

@NiceFeatures
Copy link
Author

  • The Hastebin content is gone.

    • The "include" commands are missing the file names, maybe more is missing. Using code tags would avoid this issue. Mark the code and then click the Code icon '<>'.

Thanks for the answer, I edited my post so that everything works again, in terms of logs, the server just crashes, I have the .dmp file.

@UnrealKaraulov
Copy link
Contributor

UnrealKaraulov commented Aug 5, 2024

@NiceFeatures rh_drop_client cause crash (server infinite loop restart amxmodx plugins)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants