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

Solved Unregistering the hooks outside their functions might cause a crash


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-24-2022 , 23:33   Re: Server Crash with exit code 139
Reply With Quote #11

Quote:
Originally Posted by fysiks View Post
How do you know it's not the other way around? Have you considered that? Also, investigating errors that are showing could even lead to the root cause.

Put the plugin(s) into debug mode and post the error output. If an error log contains any lines starting with "To enable debug mode . . ." don't bother posting it at all.
Because i already investigated those errors which won't lead to anything, those error lines were meaningless, pointing that there was nothing wrong.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-24-2022 at 23:34.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-25-2022 , 11:56   Re: Server Crash with exit code 139
Reply With Quote #12

Quote:
Originally Posted by fysiks View Post
You should probably start by fixing all those errors before asking why your server crashes.

Error 139 is Pterodactyl daemon not Amxx.

There is no evidence of any effort with regards to utilizing debug of any sort.

Code:
new const SzBeginMsg[]="hello world of debug" amx_log "Kill theory way crash server begin" server_print "%s1:killme %i", SzBeginMsg, iEnt amx_log "%s1:killme %i", SzBeginMsg, iEnt server_print "%s2:dispatch %i",SzBeginMsg, iEnt amx_log "%s2:dispatch %i",SzBeginMsg, iEnt server_print "%s3:target %i",SzBeginMsg, iEnt amx_log "%s3:target %i",SzBeginMsg, iEnt server_print "%s4:impulse 203 %i",SzBeginMsg, iEnt

I've made a safemode plugin you are welcome to use.
It works the opposite of the maps directory in configs only loading what is next to each map name.

Make safe_mode.ini
#"map" "plugin;plugin"
"map" "plugin1.amxx" "plugin2.amxx" "plugin3.amxx" "plugin4.amxx" "plugin5.amxx" "plugin6.amxx" "plugin7.amxx"
__________________

Last edited by DJEarthQuake; 01-25-2022 at 12:14. Reason: Posted as I was typing.
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-25-2022 , 15:57   Re: Server Crash with exit code 139
Reply With Quote #13

The least you can do is add a log message in the beginning and/or end of every major function. This way you will very easily see which function is used right before the server crashes and you will drastically reduce the area of investigation.
__________________

Last edited by OciXCrom; 01-25-2022 at 15:58.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-25-2022 , 16:42   Re: Server Crash with exit code 139
Reply With Quote #14

I already made those checks and the error occurs when the round end.

As you can see here
Code:
L 01/24/2022 - 18:52:06: JAILBREAK Round is ending...
/entrypoint.sh: line 36:    18 Segmentation fault      (core dumped) ./hlds_run -console -game ${HLDS_GAME} -port ${SERVER_PORT} -sport ${VAC_PORT} +map ${SRCDS_MAP} +ip 0.0.0.0 -strictportbind -norestart +maxplayers ${MAX_PLAYERS}
container@pterodactyl~ Server marked as offline...
Round is ending is called when CheckWinCondition successful end the round.

The crash is caused by a global index out of bounds error or some sort of.


@DJEarthQuake can you explain how safe mod is supposed to help me?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-25-2022 at 16:49.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-26-2022 , 14:32   Re: Server Crash with exit code 139
Reply With Quote #15

Safemode reloads map with only the plugins in safe_mode.ini to leverage troubleshooting or solemly load maps incompatible with much Amxx base. Unlike configs\maps\ making a tree with many files to edit, this is all contained in 1 file. I grew weary editing plugins.ini perpetually.

Safemode does not do anything about plugins added to load on a per map basis (configs\maps\ ). They will load still.
If one has the plugins listed there, remove them to make a purer safemode.

If the map is not on the INI list it does not do anything to the system.


How else does one make a with an all else being equal sandbox?

Code:
#safe_mode.ini
"jb_whatevermap" "jb_days_custom.amxx" "infinite_round.amxx" "round_terminator.amxx" "Jailbreak_main.amxx"

Is that daemon better than condebug as far as debugging goes? I hadn't heard of it. When if I crash it is back on instantly no longer than a sudden map change. Have you tried adding -dev to your server launch command line? The reason why to do that is to get to the bottom of this with more information, not for long running server processes. Trouble-shooting. Strictly.

Looking up Docker error 139 handles it how I would, so I'm sharing. Until you run this outside of container and daemon, there is no way to tell. I glanced at history or relatively recent new threads. Could one of the changes you recently made or 'feature code optimizations' that you or community conducted have played a role in influencing any of this newly found instability? Wasn't there a time before crashing? What changed?

Looks like your base system does hook into the Amxx base system sending commands as a task to ents who while they pass pev_valid first do they return 0, 1 , or 2? Things of this sort can help. Seeing that in the debug log is food for thought. At some point the simpler debug bread crumb trail will end. We need to know what it is doing now that it gets to new round and no further. Debug the circumstances leading up to it. This should be a black box to an airplane. We should be able to see it all and not talk about it for 10 years. Everything that happens surrounding 'new round' needs to logged IMHO. Before; after; and during.

Make an intercept or trap with your debugging so when the ent index is out of range to make a log and a return instead letting it crash. That's active debugging. Passive is just the minimal server_print. If that is all it takes and you fix it good. I by habit if I had to add a server_print then I develop it further for future references.

https://stackoverflow.com/questions/...tatus-code-139
__________________
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-26-2022 , 17:47   Re: Server Crash with exit code 139
Reply With Quote #16

an update on the problem:-

I deattached some plugins until two plugins remained which is jailbreak_main & jb_days_custom, i enabled debug and i get Run time error 5: memory access on the following line inside jailbreak_main

PHP Code:
public task_end_the_round(aWinner[], taskid)
{
    if(
bHAS_ROUND_ENDED || !bHAS_ROUND_ENDING) return;
    
    
bHAS_ROUND_ENDING false;

    
server_print("aWinner: %c, aWinner: %s, taskid: %d"aWinner[0], aWinnertaskid);
    switch( 
aWinner[0] ) <--- this is the line where's' the memory access happens.
    {
        case 
'1'TerminateRoundTR_RoundEndType_TeamExterminateTeamWinning_Terrorist );
        case 
'2'TerminateRoundTR_RoundEndType_TeamExterminateTeamWinning_Ct );
        case 
'3'TerminateRoundTR_RoundEndType_Draw );
    }

Also i get a weird output of task parameters.
Output of server print:-
Code:
 aWinner: c, aWinner: common/null.wav, taskid: 1
Code:
L 01/26/2022 - 22:42:08: JAILBREAK Specialday 'Snowball Day' has started!
L 01/26/2022 - 22:42:10: "Natsheh<2><STEAM_0:0:26622031><TERRORIST>" committed suicide with "world"
L 01/26/2022 - 22:42:10: "[POD]Campers Death (98)<60><BOT><TERRORIST>" committed suicide with "world"
L 01/26/2022 - 22:42:10: JAILBREAK Specialday 'Snowball Day' has ended!
Jb_day_Ended Called
dayid pushed
(8)U_FM_FW_THINK_PRE: 1
(10)U_FM_FW_EMITSOUND_PRE: 1
(3)U_FM_FW_SETMODEL_PRE: 1
(7)U_FM_FW_TOUCH_POST: 1
(4)U_FW_SENDAUDIO_MSG: 1
(5)U_FW_TXTMSG_MSG: 1
(11)U_FW_CUR_WEAPON: 1
(1)U_FW_CUR_WEAPON: 1
(2)U_FW_CUR_WEAPON: 1
end: 0
L 01/26/2022 - 22:42:10: "[P0D]George_Hamilton (99)<61><BOT><CT>" committed suicide with "world"
aWinner: c, aWinner: common/null.wav, taskid: 1
L 01/26/2022 - 22:42:14: [AMXX] Displaying debug trace (plugin "Jailbreak_main.amxx", version "2.6.6")
L 01/26/2022 - 22:42:14: [AMXX] Run time error 5: memory access 
L 01/26/2022 - 22:42:14: [AMXX]    [0] Jailbreak_main.sma::task_end_the_round (line 1759)
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-26-2022 at 18:45.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-26-2022 , 18:48   Re: Server Crash with exit code 139
Reply With Quote #17

How is that null wav transmitted to the clients please?
__________________
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-26-2022 , 19:46   Re: Server Crash with exit code 139
Reply With Quote #18

Quote:
Originally Posted by DJEarthQuake View Post
How is that null wav transmitted to the clients please?
I don't know, i don't recall transmitting null wav file.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-26-2022 at 19:49.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-27-2022 , 01:19   Re: Server Crash with exit code 139
Reply With Quote #19

Change aWinner to a global variable so that you know that that memory space will exist (i.e. remain allocated) when the task actually executes. I'm not 100% sure about this but local variables that are not static, IIRC, can be deallocated after the function finishes execution which happens before the task actually ends up executing.
__________________
fysiks is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-27-2022 , 02:29   Re: Server Crash with exit code 139
Reply With Quote #20

Quote:
Originally Posted by fysiks View Post
Change aWinner to a global variable so that you know that that memory space will exist (i.e. remain allocated) when the task actually executes. I'm not 100% sure about this but local variables that are not static, IIRC, can be deallocated after the function finishes execution which happens before the task actually ends up executing.

Doesn't the set_task copy the array(parameters) into a new memory location? And reuse it in the task callfunction, then when the callfunction finish executing the memory will be freed?

Also isn't there a way to check if a variable has a location in memory?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-27-2022 at 02:34.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 17:33.


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