Raised This Month: $51 Target: $400
 12% 

Bug Report [SOLVED] ZP 4.3 - HLDS crashes during map changes (fm_cs_get_user_team)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
konichiwa
New Member
Join Date: Sep 2010
Location: For those who want to re
Old 02-11-2011 , 14:39   [SOLVED] ZP 4.3 - HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #1

UPDATE: (06/2011)

This problem has been solved on ZP 4.3 Fix 1, which you can download here: Official Patches for ZP 4.3

---

Recently I had a lot of crashes occurring during map changes in my linux hlds. So Ive enabled debug build and core dump and start invoking psychic debugging. That has led me to these:

PHP Code:
Program terminated with signal 11Segmentation fault.
#0  0xb4756212 in get_pdata_int (amx=0x9312570, params=0x8bee910) at pdata.cpp:42
42              return *((int *)INDEXENT2(index)->pvPrivateData iOffset);
(
gdbbt
#0  0xb4756212 in get_pdata_int (amx=0x9312570, params=0x8bee910) at pdata.cpp:42
#1  0xb49d985a in amx_Callback (amx=0x9312570, index=166, result=0xbfb2be50, params=0x8bee910) at amx.cpp:474
#2  0xb49f3dd0 in JIT_OP_SYSREQ () from /home/game/dustfever/hlds_zpm/cstrike/addons/amxmodx/dlls/amxmodx_mm_i386.so
#3  0xbfb2be50 in ?? () 
So which plugin is causing server crash?

PHP Code:
(gdbamx_analyze
Crash is most likely caused by
cstrike/addons/amxmodx/plugins/zombie_plague/zombie_plague43.amxx 
Hmm, so its zp's fakemeta call causing this crash. It has to do with get_pdata_int call apparently. How do we even know which get_pdata_int call that causes it? Fortunately, there exist only 1 call in zombie_plague43.sma

PHP Code:
// Get User Team
stock fm_cs_get_user_team(id)
{
    return 
get_pdata_int(idOFFSET_CSTEAMSOFFSET_LINUX);

The fix is pretty simple, just replace the fakemeta version with original ones.
EDIT by MeRcyLeZZ: Instead, just check if the player entity's private data is properly initialized before calling get_pdata native.
PHP Code:
// Get User Team
stock fm_cs_get_user_team(id)
{
    
// Prevent server crash if entity is not safe for pdata retrieval
    
if (pev_valid(id) != 2)
        return 
FM_CS_TEAM_UNASSIGNED;
    
    return 
get_pdata_int(idOFFSET_CSTEAMSOFFSET_LINUX);

I didnt and didnt bother figuring out the exact reason of crash, but I guess it has to do with zp trying to access some uninitialized data during map change.

Go fix this yourself, or pray that someone else not lazy and kind enough to post patched source.

Enjoy.

Last edited by MeRcyLeZZ; 06-14-2011 at 20:27. Reason: added descriptive thread title + link to ZP 4.3 Fix 1
konichiwa is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 06-08-2011 , 03:22   Re: [BUG] fm_cs_get_user_team
Reply With Quote #2

Thanks a lot for reporting this and taking the time to trace down the error. I'll definitely be patching the official ZP with this fix soon.

Quote:
Originally Posted by konichiwa View Post
I didnt and didnt bother figuring out the exact reason of crash, but I guess it has to do with zp trying to access some uninitialized data during map change.
That's odd, since the function is called only for valid (connected) players, which should already have team data set up by CS.

Quote:
Originally Posted by konichiwa View Post
The fix is pretty simple, just replace the fakemeta version with original ones.
Now that I look into it, the cs_get_user_team version does check whether the player is in game and has a valid entity before trying to fetch the data. I guess that's it then...
__________________
MeRcyLeZZ is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 06-08-2011 , 11:30   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #3

Thanks.
Guess that's why my server crashes.

sorry for my English use a translator.

pd:Hola MeRcyLeZZ .
pd2:proxy shit.
__________________

Last edited by Destro-; 06-08-2011 at 11:33.
Destro- is offline
zeus
Senior Member
Join Date: Jul 2008
Old 06-08-2011 , 12:34   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #4

@konichiwa YOU ROCK MAN
THX ALOT
@ Mercylezz : Welcome back !
zeus is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-08-2011 , 14:00   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #5

konichiwa finally we meet here, thank for bug report. Gonna patch my zp now, thanks bro.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 06-08-2011 , 14:07   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #6

finally no more crash thank you konichiwa
Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-08-2011 , 16:07   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #7

When i patch "cs_get_user_team(id)" into fm_cs_get_user_team(id) stock it give me 1 warning when compiling. How get rid of this warning "tig tag match".
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
bboygrun
CHOMP
Join Date: May 2010
Location: France
Old 06-08-2011 , 20:55   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #8

Thanks a lot for this ... my Zombie Plague saw a lot of player leave the server because of this, they will come back now because it will not crash ^^.
__________________
bboygrun is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 06-08-2011 , 23:23   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #9

Quote:
Originally Posted by yokomo View Post
When i patch "cs_get_user_team(id)" into fm_cs_get_user_team(id) stock it give me 1 warning when compiling. How get rid of this warning "tig tag match".
PHP Code:
enum CsTeams {
 
CS_TEAM_UNASSIGNED 0,
 
CS_TEAM_T 1,
 
CS_TEAM_CT 2,
 
CS_TEAM_SPECTATOR 3
};
native CsTeams:cs_get_user_team(index, &{CsInternalModel,_}:model CS_DONTCHANGE); 

PHP Code:
enum  {
 
CS_TEAM_UNASSIGNED 0,
 
CS_TEAM_T,
 
CS_TEAM_CT,
 
CS_TEAM_SPECTATOR
}

native cs_get_user_team(index, &{CsInternalModel,_}:model CS_DONTCHANGE
__________________
Destro- is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 06-09-2011 , 12:17   Re: [SOLVED] Linux HLDS crashes during map changes (fm_cs_get_user_team)
Reply With Quote #10

PHP Code:
// Get User Team 
stock fm_cs_get_user_team(id

      return 
cs_get_user_team(id); 

<10646> warning 213: tag mismatch
1 warning.

line 10646 is:

return cs_get_user_team(id);

thanks...
rodrigo286 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 04:37.


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