Raised This Month: $32 Target: $400
 8% 

Server is downloading creppy files


Post New Thread Reply   
 
Thread Tools Display Modes
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 02-25-2017 , 05:19   Re: Server is downloading creppy files
Reply With Quote #11

Maybe read_file which i am using? From yesterday, no errors
grs4 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-25-2017 , 07:03   Re: Server is downloading creppy files
Reply With Quote #12

I can't do much unless you're giving me a reproducible way of the issue or some hints where I can look into.
__________________
Arkshine is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 02-25-2017 , 07:25   Re: Server is downloading creppy files
Reply With Quote #13

Quote:
Originally Posted by Arkshine View Post
I can't do much unless you're giving me a reproducible way of the issue or some hints where I can look into.
Yesterday I read this: https://forums.alliedmods.net/showth...=69386?t=69386

I had changing player models. Also i changed all files from .ini to .cfg. and as i said, from yesterday no errors.

If it will appear again, i will PM to you, because I want to repair this.
grs4 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-25-2017 , 07:29   Re: Server is downloading creppy files
Reply With Quote #14

I've no idea what you mean why changing .ini to .cfg, but if related to plugins spamming players, can't do much about it.
If you are using amxx dev version, you should not have issues with setting player's model with cs_set_user_model. Your issue is probably something else.

Anyway, let's try to be logic if your issue is related to player's connection, this has nothing to do with player's model.
You should take a look at plugins which do stuff at this time (plugin_precache, client_connect, etc.).
Ideally, you should try to reproduce the issue, then disable the plugins one by one which does stuff at player's connection, and if related to AMXX, we should find the issue easily.
__________________

Last edited by Arkshine; 02-25-2017 at 07:37.
Arkshine is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 02-25-2017 , 09:04   Re: Server is downloading creppy files
Reply With Quote #15

Quote:
Originally Posted by Arkshine View Post
I've no idea what you mean why changing .ini to .cfg, but if related to plugins spamming players, can't do much about it.
If you are using amxx dev version, you should not have issues with setting player's model with cs_set_user_model. Your issue is probably something else.

Anyway, let's try to be logic if your issue is related to player's connection, this has nothing to do with player's model.
You should take a look at plugins which do stuff at this time (plugin_precache, client_connect, etc.).
Ideally, you should try to reproduce the issue, then disable the plugins one by one which does stuff at player's connection, and if related to AMXX, we should find the issue easily.
If there is a problem with .ini, then chaning to .cfg should fix it.
About cs_set_user_model, there is some bug. If player has a new model set by cs_set_user_model and he is going to spec or discoonecting from server, plugins are registering a touch from this player like he is ingame.

We had talk about Arrays, this function is crashing server. Sometimes this function is working great, sometimes bad.

What is saying?
PHP Code:
if(DEBUG)    
        
log_to_file(LOG_FILE"DEBUG: Getting map index with most votes. Size: %d / %d"
Code:
DEBUG: Getting map index with most votes. Size: 2 / 3
Segmentation fault data..
uploading dump..
What does this function do? It's calculating votes for next map. If there is a draw, &ret1 is first map id and &ret2 is second map id. If map won, &ret2 = 0.
This function is 100% causing server to crash. (Segmentation fault data)

PHP Code:
public GetMapIndexWithMostVotes(&ret1, &ret2)
{
    if(
DEBUG)    
        
log_to_file(LOG_FILE"DEBUG: Getting map index with most votes. Size: %d / %d"g_VotedForNextMapNumVOTE_MAP_COUNT)
        
    new Array:
aVotes ArrayCreate(g_VotedForNextMapNumVOTE_MAP_COUNT)

    for(new 
g_VotedForNextMapNumi++)
         
ArrayPushCell(aVotesGetPlayersNumInVoteZone(i+1));

    new 
tempvotesmostVotessecondMostVotes = -1firstMapIdsecondMapId;

    
/* Get map with most votes */
    
for (new 0g_VotedForNextMapNumi++)
    {
        
tempvotes ArrayGetCell(aVotesi);
        if(
tempvotes mostVotes)
        {
            
mostVotes tempvotes;
            
firstMapId i;
        }
    }

    
/* Get second map with most votes */
    
for(new g_VotedForNextMapNumi++)
    {
        if(
== firstMapId)
            continue;
        
        
tempvotes ArrayGetCell(aVotesi);
        
        if(
tempvotes secondMostVotes)
        {
            
secondMostVotes tempvotes;
            
secondMapId i;
        }
    }

    
// if we have a draw
    
if(mostVotes == secondMostVotes)
    {
        
ret1 firstMapId;
        
ret2 secondMapId
    
}
    else
    {
        
ret1 firstMapId;
        
ret2 = -1;
    }
    
    
ArrayDestroy(aVotes);


Last edited by grs4; 02-25-2017 at 09:05.
grs4 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-25-2017 , 09:26   Re: Server is downloading creppy files
Reply With Quote #16

Quote:
If there is a problem with .ini, then chaning to .cfg should fix it.
This makes no sense. What are you even talking about? .ini/.cfg of what? Please be precise.

Quote:
About cs_set_user_model, there is some bug. If player has a new model set by cs_set_user_model and he is going to spec or discoonecting from server, plugins are registering a touch from this player like he is ingame.
This makes no sense too. You will have to elaborate a bit more. Really difficult to understand you.

Quote:
We had talk about Arrays, this function is crashing server. Sometimes this function is working great, sometimes bad.
How can you be sure the crash comes from this function while a segmentation is not going to tell exactly where it crashed? The code looks fine at first glance. If it's reproducible, can you make a simple test plugin with this code?

I think you should try to ask someone who can speak in english, because it's going to be hard to understand you fully.
__________________

Last edited by Arkshine; 02-25-2017 at 09:26.
Arkshine is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 02-26-2017 , 06:41   Re: Server is downloading creppy files
Reply With Quote #17

Quote:
Originally Posted by Arkshine View Post
This makes no sense. What are you even talking about? .ini/.cfg of what? Please be precise.



This makes no sense too. You will have to elaborate a bit more. Really difficult to understand you.


How can you be sure the crash comes from this function while a segmentation is not going to tell exactly where it crashed? The code looks fine at first glance. If it's reproducible, can you make a simple test plugin with this code?

I think you should try to ask someone who can speak in english, because it's going to be hard to understand you fully.
Quote:
This makes no sense. What are you even talking about? .ini/.cfg of what? Please be precise.
As it was told before, i'm talking about loading/saving from .ini files.
You told that You don't have idea, why I changed .ini to .cfg.

Take a look at this. Depresie said he had same problem and he thought the problem is in loading/saving to .ini files. So i'm trying all paths to fix it. Not only you are trying to help me.

Quote:
There is sure something wrong related either to reading from the .ini file or to the dynamic arrays
I dont want to argue with you and also be patient plase, no one can know english perfectly. (:


Quote:
About cs_set_user_model, there is some bug. If player has a new model set by cs_set_user_model and he is going to spec or discoonecting from server, plugins are registering a touch from this player like he is ingame.
I thought when player disconnected from server and before plugin set him model by cs_set_user_model, plugins thought that player still is on server. Why i thought that? I had entity which had register_touch on a player. When player left, plugin thought he is still on server. but i made an mistake, i forgot about !is_user_connected.

Quote:
How can you be sure the crash comes from this function while a segmentation is not going to tell exactly where it crashed? The code looks fine at first glance. If it's reproducible, can you make a simple test plugin with this code?
PHP Code:
    if(g_VoteTime == 0)
    {
        if(
DEBUG)    
            
log_to_file(LOG_FILE"DEBUG: Voting ended.")
        
        new 
result[3]
        
GetMapIndexWithMostVotes(result[0], result[1]);
                
        
set_hudmessage(02552550.060.7011.04.50.20.2, -1)
        
ShowSyncHudMsg(0g_SyncHudInfo"Calculating results...");
            
        
RemoveVoteMapEntitiesAndResetUsers();
        
set_task(5.0"CheckVoteResults"_result2);
    } 
Because I saw "DEBUG: Voting ended." In console, and only as i said before, GetMapIndexWithMostVotes had been called. I did not saw a hud with "Calculating results.." and no ents were removed from RemoveVoteMapEntitiesAndResetUsers();. Only this `if` was executed.

Quote:
If it's reproducible, can you make a simple test plugin with this code?
Yesterday I removed Dynamic Arrays to check if this was a reason.
[check attachment]
Yesterday 18.55 UTC +1 server was crashed, so then i changed it.
Is hard to create at now reproducible code, because as I said, sometimes It was working, sometimes no and i still don't know why. If crash will appear again, I will be know that dynamic arrays were not a reason, if no, then i will roll back to dynamic arrays to try find a solution.

Sorry for my english, i'm still learning on my bads, i don't want anyone to help me.
Attached Thumbnails
Click image for larger version

Name:	Bez tytułu.png
Views:	37
Size:	30.0 KB
ID:	161100  

Last edited by grs4; 02-26-2017 at 06:50.
grs4 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-26-2017 , 06:57   Re: Server is downloading creppy files
Reply With Quote #18

"ArrayCreate(g_VotedForNextMapNum, VOTE_MAP_COUNT)"

The first argument is wrong (it expects the size in cell). It should be 1 because you save only integers (you usually set > 1 when you're working with array or string to provide the max length).
It might be the cause of the potential crash.

Despite all the checks, it's very easy to crash AMXX when the API is misused.
__________________

Last edited by Arkshine; 02-26-2017 at 08:15.
Arkshine is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 02-26-2017 , 15:50   Re: Server is downloading creppy files
Reply With Quote #19

One question, you are running the server on linux or windows ?
__________________
Depresie is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 02-27-2017 , 04:24   Re: Server is downloading creppy files
Reply With Quote #20

I changed to size 1 and no crash at this time.

Server is linux, plugins are compiled on windows.
grs4 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode