The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Huge tags = sphere crash
Author Message
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #11
RE: Huge tags = sphere crash
nah it's just a copy/paste typo, on the real script it's the same TAG
the entire engine is working fine (sphere script + SQL commands + SQL table + php page), the server crash only occour when this huge tag appears. The engine can sync the paperdoll of all chars on the server, it crash only when try to sync this particular char with the huge tag set.

since sphere can store this huge tag without problems (this tag on example I got directly from my spherechars save file), I think the real problem is only when it try to read this huge tag
(This post was last modified: 04-28-2014 01:03 PM by Coruja.)
04-28-2014 12:59 PM
Find all posts by this user Like Post Quote this message in a reply
Feeh
Sphere Developer
*****

Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4



Post: #12
RE: Huge tags = sphere crash
Results of my local tests
Sphere Console Wrote:19:42:1:'feeh' commands 'lol'=1
19:43:1:'feeh' commands 'lol'=1

The Script used to test
Code:
[FUNCTION lol]
TAG.Sync.Paperdoll="layer1=NULL, layercor1=NULL, layer2=NULL, layercor2=NULL, layer6=NULL, layercor6=NULL, layer6=5447, layercor6=713, layer1=5184, layercor1=NULL, layer2=7030, layercor2=2057, layer6=NULL, layercor6=NULL, layer6=5138, layercor6=2057, layer1=NULL, layercor1=NULL, layer2=NULL, layercor2=NULL, layer6=NULL, layercor6=NULL, layer6=5447, layercor6=713, layer22=NULL, layercor22=NULL, layer22=9860, layercor22=1940, layer2=5122, layercor2=NULL, layer2=NULL, layercor2=NULL, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer2=5122, layercor2=NULL, layer2=NULL, layercor2=NULL, layer22=NULL, layercor22=NULL, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer22=9860, layercor22=1940, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer22=NULL, layercor22=NULL, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer22=9860, layercor22=1940, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer22=NULL, layercor22=NULL, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer22=9860, layercor22=1940, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer22=NULL, layercor22=NULL, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer22=9860, layercor22=1940, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer22=NULL, layercor22=NULL, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=2207, layer22=9860, layercor22=1940, layer8=NULL, layercor8=NULL, layer8=4234, layercor8=71, layer1=5184, layercor1=NULL, layer2=7030, layercor2=2057, layer6=NULL, layercor6=NULL, layer6=5138, layercor6=2057, layer1=NULL, layercor1=NULL, layer2=NULL, layercor2=NULL, layer6=NULL, layercor6=NULL, layer6=5447, layercor6=713, layer1=5184, layercor1=NULL, layer2=7030, layercor2=2057, layer6=NULL, layercor6=NULL, layer6=5138, layercor6=2057, layer1=NULL, layercor1=NULL, layer2=NULL, layercor2=NULL, layer20=NULL, layercor20=NULL, layer6=NULL, layercor6=NULL, layer6=5447, layercor6=713, layer2=3912, layercor2=NULL, layer2=NULL, layercor2=NULL, layer2=3912, layercor2=NULL, layer2=NULL, layercor2=NULL, layer1=5184, layercor1=NULL, layer2=7030, layercor2=2057, layer6=NULL, layercor6=NULL, layer6=5138, layercor6=2057, layer1=NULL, layercor1=NULL, layer2=NULL, layercor2=NULL, layer6=NULL, layercor6=NULL, layer6=5447, layercor6=713"
LOCAL.SQL=<DB.AEXECUTE SQLAsyncResponse, UPDATE paperdoll SET <TAG.Sync.Paperdoll> WHERE uid='<UID>' LIMIT 1>

[FUNCTION SQLAsyncResponse]
IF !(<ARGN2>)
SERV.LOG @SQL error: <ARGS>
ENDIF

The SQL table and its content AFTER script execution
Code:
create table `paperdoll` (
    `uid` double ,
    `layer1` double ,
    `layercor1` double ,
    `layer2` double ,
    `layercor2` double ,
    `layer6` double ,
    `layercor6` double ,
    `layer8` double ,
    `layercor8` double ,
    `layer22` double ,
    `layercor22` double ,
    `layer20` double ,
    `layercor20` double
);
insert into `paperdoll` (`uid`, `layer1`, `layercor1`, `layer2`, `layercor2`, `layer6`, `layercor6`, `layer8`, `layercor8`, `layer22`, `layercor22`, `layer20`, `layercor20`) values('1',NULL,NULL,NULL,NULL,'5447','713','4234','71','9860','1940',NULL,NULL)​;

No crashes
Even with one or more missing columns on the SQL table, the server just spit the error saying the column didn't existed

WAMP provided MySQL server (installed on oct/2013, don't know the version)
SQLYog 8.5.5.0 to read/write/create the tables
Sphere built on (27/apr/2014).

--------------

Try logging the tag to the console, read its length, find the first 'a' character...anything that you think it will crash the server.
Try writing the tag value to a test table and not execute its content


Provide us the SQL table schema you're using or anything else that allow us to test it locally. I'm still in blinds

Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
(This post was last modified: 04-29-2014 08:57 AM by Feeh.)
04-29-2014 08:53 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #13
RE: Huge tags = sphere crash
there's no problem on SQL, everything SQL-related is working perfectly fine, the problem is just the tag. I just used a SQL example because I copy/paste it from my script Confused

but let's try another example without SQL. This will crash the server:
Code:
[FUNCTION lol]
TAG.A=
FOR 100
  TAG.A .= "<TAG.A> a"  //line 4
ENDFOR
SERV.LOG LENGTH: <eval STRLEN(<TAG.A>)> / TAG: <TAG.A>

no dev will make a suicide loop like this on a live shard, it's just a test to simulate an exploit. Like a button that every time you press it will add a new text string to a TAG, and some noob make an macro using infinite loop and no-delay to press this button. Result: server crash

loop results:
FOR 1 = length 1
FOR 2 = length 5
FOR 3 = length 13
FOR 4 = length 29
FOR 5 = length 61
FOR 6 = length 125
FOR 7 = length 253
FOR 8 = length 509
FOR 9 = length 1021
FOR 10 = length 2045
FOR 11 = length 4093
FOR 12 = crash

if the loop value is higher but near 12 (example: 13 or 14), sphereSvr.exe just force-close with absolutely no console error. There's no error even on log files after crash.

using loop 20 it will spam some console exceptions and then crash
Code:
03:11:DEBUG:__ thread (10524) __ |  # | _____ function _____________ | ticks passed from previous function start ______
03:11:DEBUG:>>         10524     |  0 |              CServer::OnTick | +0
03:11:DEBUG:>>         10524     |  1 |        CServer::OnConsoleCmd | +0
03:11:DEBUG:>>         10524     |  2 |              CServer::r_Verb | +0
03:11:DEBUG:>>         10524     |  3 |           CScriptObj::r_Verb | +0
03:11:DEBUG:>>         10524     |  4 |                CChar::r_Verb | +0
03:11:DEBUG:>>         10524     |  5 |             CObjBase::r_Verb | +0
03:11:DEBUG:>>         10524     |  6 |           CScriptObj::r_Call | +0
03:11:DEBUG:>>         10524     |  7 |     CScriptObj::OnTriggerRun | +0
03:11:DEBUG:>>         10524     |  8 | CScriptObj::OnTriggerForLoop | +0
03:11:DEBUG:>>         10524     |  9 |     CScriptObj::OnTriggerRun | +1016
03:11:DEBUG:>>         10524     | 10 |        CScriptObj::ParseText | +0 <-- exception catch point (below is guessed and could be incorrect!)
03:11:DEBUG:>>         10524     | 11 |            CChar::r_WriteVal | +0
03:11:DEBUG:>>         10524     | 12 |         CObjBase::r_WriteVal | +0
03:11:DEBUG:>>         10524     | 13 |           CVarDefMap::GetKey | +0
03:11:DEBUG:response ' a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

-- crash --

and using loop 500, it will start with the same error above but at some point it will turn into "Exception adding debug message on the exception." roflmao (and will crash too)
Code:
02:45:DEBUG:__ thread (5404) __ |  # | _____ function _____________ | ticks passed from previous function start ______
02:45:DEBUG:>>         5404     |  0 |              CServer::OnTick | +0
02:45:DEBUG:>>         5404     |  1 |        CServer::OnConsoleCmd | +0
02:45:DEBUG:>>         5404     |  2 |              CServer::r_Verb | +0
02:45:DEBUG:>>         5404     |  3 |           CScriptObj::r_Verb | +0
02:45:DEBUG:>>         5404     |  4 |                CChar::r_Verb | +0
02:45:DEBUG:>>         5404     |  5 |             CObjBase::r_Verb | +0
02:45:DEBUG:>>         5404     |  6 |           CScriptObj::r_Call | +0
02:45:DEBUG:>>         5404     |  7 |     CScriptObj::OnTriggerRun | +0
02:45:DEBUG:>>         5404     |  8 | CScriptObj::OnTriggerForLoop | +0
02:45:DEBUG:>>         5404     |  9 |     CScriptObj::OnTriggerRun | +5078
02:45:DEBUG:>>         5404     | 10 |                CChar::r_Verb | +31
02:45:DEBUG:>>         5404     | 11 |             CObjBase::r_Verb | +0 <-- exception catch point (below is guessed and could be incorrect!)
02:45:DEBUG:>>         5404     | 12 |            CVarDefMap::Empty | +0
02:45:ERROR:(test.scp,4)Exception adding debug message on the exception.

...

02:45:DEBUG:__ thread (5404) __ |  # | _____ function _____________ | ticks passed from previous function start ______
02:45:DEBUG:>>         5404     |  0 |              CServer::OnTick | +0
02:45:DEBUG:>>         5404     |  1 |        CServer::OnConsoleCmd | +0
02:45:DEBUG:>>         5404     |  2 |              CServer::r_Verb | +0
02:45:DEBUG:>>         5404     |  3 |           CScriptObj::r_Verb | +0
02:45:DEBUG:>>         5404     |  4 |                CChar::r_Verb | +0
02:45:DEBUG:>>         5404     |  5 |             CObjBase::r_Verb | +0
02:45:DEBUG:>>         5404     |  6 |           CScriptObj::r_Call | +0
02:45:DEBUG:>>         5404     |  7 |     CScriptObj::OnTriggerRun | +0
02:45:DEBUG:>>         5404     |  8 | CScriptObj::OnTriggerForLoop | +0
02:45:DEBUG:>>         5404     |  9 |     CScriptObj::OnTriggerRun | +5141
02:45:DEBUG:>>         5404     | 10 |                CChar::r_Verb | +31
02:45:DEBUG:>>         5404     | 11 |             CObjBase::r_Verb | +0 <-- exception catch point (below is guessed and could be incorrect!)
02:45:DEBUG:>>         5404     | 12 |            CVarDefMap::Empty | +0
02:45:ERROR:(test.scp,4)Exception adding debug message on the exception.
02:45:(test.scp,6)LENGTH: 65533 / TAG:  a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

-- crash --

probably the crash occour when the tag length is > 4093
I tested using a similar function and it will crash the server too
Code:
[FUNCTION lol2]
TAG.A=
FOR 10000
  TAG.A .= "a"
ENDFOR
SERV.LOG LENGTH: <eval STRLEN(<TAG.A>)> / TAG: <TAG.A>
if I got some luck, sometimes the console will show the log "LENGTH: 10000 / TAG: aaaaaa..." and crash, but most of times it will crash without any error
(This post was last modified: 04-29-2014 04:51 PM by Coruja.)
04-29-2014 04:33 PM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #14
RE: Huge tags = sphere crash
see... there is a HUGE difference between a tag that is 1700 or so, and one that passé the allowed limit...
Get your facts together before you complain about something.

...and this is why we get frustrated...

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
04-29-2014 08:40 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #15
RE: Huge tags = sphere crash
that's exactly the problem, i'm not complaining about my code, i'm alerting an exploit that could crash the entire server in seconds.
"Luckly" this happened only on my server (1 week with force-close 5x each day, no console error, many players/donators left the server) but just imagine if many of others servers start crashing like this.

I think we must do something to prevent this situation. Sure, this protection must be done on script-side, but if the script-side fail (like a bad-intentioned player using a exploit unexpected by the dev) sphere must try to protect the server too instead let it crash
04-30-2014 02:35 AM
Find all posts by this user Like Post Quote this message in a reply
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #16
RE: Huge tags = sphere crash
// Limit the number of cycles the while/for loop can proceed. Setting this to
// zero disables the limitation
MaxLoopTimes=0 ( maybe it is not related with your situation, just a reminder Smile )

Set limit then. If you dont want inifinite loop. you can actually prevent it. Instead of tagging layers you can directly insert all of them into database. Why are you dealing such things , I donot get it actually. Mysql operations are fast and realiable. No problem about crashing etc. You can achive what you are trying to without tagging layers in a efficient and easier way. Also you are saying your server crashed during 5 days. Why dont you dump profile and looked at your function behavior about how many times used etc. At the first time, you could understand where the problem is. If someone just made a macro and used same operations many times, from the profiler screen it is easy to see where the problem is. You cannot call this situation as a exploit because you let them those noobs to do such a problem. You donot need such a huge tag. You can prefer another way. But, If this is a real problem, as developers we will certainly look where the problem is. Just keep calm and try to be happy even if you are not Smile
(This post was last modified: 04-30-2014 06:26 AM by Avatar.)
04-30-2014 06:12 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #17
RE: Huge tags = sphere crash
The part that I don't like is that he made us WASTE our time with an example that DID NOT replicate the problem...

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
04-30-2014 07:30 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #18
RE: Huge tags = sphere crash
@Coruja
I shared something similar to your paperdoll stuff months ago. The things that you are storing with tags are actually working different way in what I stated. If you want you can look at http://forum.spherecommunity.net/Thread-...erdoll-Web and develop on it as you wish. What I shared is poor example how to do. What I mean by poor is that there is no detailed script for this. This is just a structure of how to do.You do not need to tag all layers. I checked it and all players data is transferred maybe at the same time with several function call. There is no crash issue or lag issue or whatever issue you can count. Sql operations fast and can be worked as background operation as well if you just manage. What I'm doing for transferring equipped items is to insert data into database instantly without storing in SphereServer like the following ;

Code:
for x 1 24
    if <findlayer.<dlocal.x>>
        ref1 = <findlayer.<dlocal.x>.uid>
        db.query insert into myrunuo_characters_layers (char_id, layer_id, item_id, item_hue) VALUES ('<eval <ref1.cont.uid>>','<dlocal.x>','<eval <ref1.id>>','<eval <ref1.color>>') //
    endif
endfor
(This post was last modified: 04-30-2014 08:41 AM by Avatar.)
04-30-2014 08:30 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #19
RE: Huge tags = sphere crash
many thx to all devs, this problem was fixed on latest may 1 nightly build. I tested these same 2 functions to simulate the exploit and now both are working fine, they just show a console warning instead crash the server Smile


@Avatar
thx for share your engine, mine is quite similar but I sync everything in real time instead sync all chars together. I have 5000 accounts on my server, and if I sync everything together it will overload sphere and SQL too.
Each account needs to sync 24 layers + 49 skills + char info (fame, karma, kills, deaths, etc). So it's a 73 loop and 3 tables to update (paperdoll layers + skills + char info)
To sync all 5000 accounts this will be a 365.000 script loop and 15.000 SQL commands to execute. So I think its better sync in real time, the sync will be constant but much more light weight. I'm using TAGs just to optimize it.
Imagine a event like this:
Quote:ON=@Equip
SQL_SyncLayer <ACT.LAYER>

ON=@Unequip
SQL_SyncLayer <ACT.LAYER>
If the player create a macro "equip weapon + unequip weapon" with infinite loop and no-delay this will overload SQL with infinite equip/unequip commands. The TAG goes here, instead execute 1 command to each equip or unequip, it will store all layers to change and then execute a single SQL command
(This post was last modified: 05-02-2014 11:36 AM by Coruja.)
05-02-2014 11:30 AM
Find all posts by this user Like Post Quote this message in a reply
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #20
RE: Huge tags = sphere crash
The things that i shared are not sync at the same time but once the players are logging the game actually Smile). Anyway, It is nice to see you got over with you problem.
05-06-2014 10:32 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)