SphereServer BugTracker - SphereServer
View Issue Details
0001999SphereServerexecutable - windows buildpublic14-07-11 22:3023-07-14 18:58
babidi 
XuN 
normalmajorrandom
resolvedfixed 
20-09-2009, 0.56b Prerelease 
0.56c Nightly 
Automated (specify build number)
None
None
1482
0001999: main thread
randomly get

21:51:WARNING:Forcing thread 'Main' to terminate...
21:51:CRITICAL:'Main' thread hang, restarting...

22:19:WARNING:Forcing thread 'Main' to terminate...
22:19:CRITICAL:'Main' thread hang, restarting...

and cpu use going to 100%
the it take minutes to login
and lags alot

but no more errors in console except that

very strange
22:02:Sphere Version 0.56b-Nightly [WIN32] by www.sphereserver.com, compiled at Jun 22 2011 (00:03:20), internal build 0001482

// Experimental flags
// Flags for options that affect server behaviour and which might affect compatibility
// See the revisions.txt file for more details on this
// EF_DiagonalWalkCheck = 00000001
// EF_New_Triggers = 00000008
// EF_Intrinsic_Locals = 00000020
// EF_Item_Strict_Comparison = 00000040
// EF_NewPositionChecks = 00000080 // Do not set while server is running !!!
// EF_WalkCheck = 00000100
// EF_AllowTelnetPacketFilter = 00000200 // Enables packet filtering for telnet connections as well
// EF_Script_Profiler = 00000400
// EF_Size_Optimise = 00000800
// EF_Minimize_Triggers = 00001000 // Minimize trigger calls (use only 0.51 triggers)
// EF_DamageTools = 00002000 // damage tools (and fire @damage on them) while mining or lumberjacking
// EF_PetSlots = 00004000 // INCOMPLETE YET! DO NOT USE until this warning is removed!
// EF_UsePingServer = 00008000 // Enable the experimental Ping Server (for showing pings on the server list, uses UDP port 12000)
// EF_NPCAct_Triggers = 00010000 // Enable @NPCSpecialAction and @NPCAction triggers (mutual exclusive with EF_Minimize_Triggers)
// EF_FixCanSeeInClosedConts = 00020000 // Change CANSEE to return 0 for items inside containers that a client hasn't opened
// EF_NetworkOutThread = 00800000 // Send network data in a separate thread
// EF_Specific = 01000000 // Specific behaviour, not completly tested
Experimental=01|08|040|0800|010000|0800000

// Option flags
// Flags for options that affect server behaviour but not compatibility
// See the revisions.txt file for more details on this
// OF_Command_Sysmsgs = 00000008 //Shows status of hearall, allshow, allmove... commands after toggling them
// OF_OSIMultiSight = 00000020
// OF_Items_AutoName = 00000040
// OF_FileCommands = 00000080
// OF_NoItemNaming = 00000100
// OF_NoHouseMuteSpeech = 00000200
// OF_Flood_Protection = 00001000
// OF_Buffs = 00002000
// OF_NoPrefix = 00004000 // Add prefix "A" and "An" to itemnames or not
// OF_DyeType = 00008000 // if set allows using i_dye on all t_dye_vat instead of only i_dye_tub
// OF_DrinkIsFood = 00010000 // type T_DRINK will increase FOOD lvl like T_FOOD
// OF_Specific = 01000000 // Specific behaviour, not completly tested
OptionFlags=08|020|0200|02000

// Extra combat flags to control the fight (default:0, 0.55i compatible)
// COMBAT_NODIRCHANGE 00001 // Not rotate player when fighting (like was in 0.51a)
// COMBAT_FACECOMBAT 00002 // Allow faced combat only (recommended)
// COMBAT_PREHIT 00004 // allow prehit for close combat. first hit is instant (delay 0.1sec)
// COMBAT_USE_RESISTANCE 00008 // use character props RES* against oldfashioned damage types
// COMBAT_SPECIALDAMAGE 00010 // use character tags TAG.*DAMAGE to apply additional damage
// COMBAT_DCLICKSELF_UNMOUNTS 00020 // unmount horse when dclicking self while in warmode
// COMBAT_ALLOWHITFROMSHIP 00040 // Allow attacking opponents from ships
// COMBAT_OSIDAMAGEMOD 00080 // modify weapon damage OSI-style (taking anatomy, tactics, lumberjacking into account)
// COMBAT_ARCHERYCANMOVE 00100 // firing bow while moving
// COMBAT_STAYINRANGE 00200 // abort attack swing when out of range instead of waiting to come back in range
// COMBAT_STACKARMOR 01000 // If a region is covered by more than one armor part, all AR will count
// COMBAT_TARGETTEDHIT 02000 // Allows setting of preferred hit area by TAG.HITPREFERENCE
CombatFlags=01|020|040|0100|01000|02000

// Extra magic flags to control magic/magery behaviour (default:0, 0.55i compatible)
// MAGICF_NODIRCHANGE = 0x0000001 // Not rotate player when casting/targeting
// MAGICF_PRECAST = 0x0000002 // Precasting (cast spell before target prompt)
// MAGICF_IGNOREAR = 0x0000004 // Magic damage ignore ar
// MAGICF_CANHARMSELF = 0x0000008 // Magic can do damage on self
// MAGICF_STACKSTATS = 0x0000010 // Different stat spells don't cancel each other out
// MAGICF_FREEZEONCAST = 0x0000020 // No movement whilst casting
// MAGICF_SUMMONWALKCHECK = 0x0000040 // Summoned creatures should be able to walk on the target location (e.g. water creatures to be summoned on water)
// MAGICF_NOFIELDSOVERWALLS = 0x0000080 // Field spells cannot cross over blocking objects
MagicFlags=04|08|010

// NPC AI settings
// NPC_AI_PATH 0001 NPC pathfinding
// NPC_AI_FOOD 0002 NPC food search (objects + grass)
// NPC_AI_EXTRA 0004 NPC magics, etc
// NPC_AI_ALWAYSINT 0008 Always be as smart as possible with pathfinding
// NPC_AI_INTFOOD 0010 NPC food search (more intelligent and trusworthy)
// NPC_AI_COMBAT 0040 Look for friends in combat
// NPC_AI_VEND_TIME 0080 vendors closing their shops at nighttime
// NPC_AI_LOOTING 0100 loot corpses an the way
// NPC_AI_MOVEOBSTACLES 0200 if moveable items block my way, try to move them
NPCAI=0001|0004|0010|0040|0200
crash
Issue History
14-07-11 22:30babidiNew Issue
14-07-11 23:43MirravinNote Added: 0001162
14-07-11 23:45MirravinNote Edited: 0001162bug_revision_view_page.php?bugnote_id=0001162#r372
15-07-11 07:29babidiNote Added: 0001163
01-08-11 20:53babidiNote Added: 0001204
01-08-11 20:54babidiTag Attached: crash
01-08-11 20:56babidiNote Added: 0001205
01-09-11 15:48babidiNote Deleted: 0001205
01-09-11 15:49babidiNote Added: 0001232
08-09-11 22:54babidiNote Added: 0001248
09-09-11 08:45ShaklabanNote Added: 0001249
09-09-11 08:45ShaklabanNote Edited: 0001249bug_revision_view_page.php?bugnote_id=0001249#r409
09-09-11 08:48ShaklabanNote Edited: 0001249bug_revision_view_page.php?bugnote_id=0001249#r410
09-09-11 17:09babidiNote Added: 0001250
09-09-11 17:24ShaklabanNote Added: 0001251
09-09-11 17:25ShaklabanNote Edited: 0001251bug_revision_view_page.php?bugnote_id=0001251#r412
09-09-11 17:25ShaklabanNote Edited: 0001251bug_revision_view_page.php?bugnote_id=0001251#r413
09-09-11 17:26ShaklabanNote Edited: 0001251bug_revision_view_page.php?bugnote_id=0001251#r414
09-09-11 17:26babidiNote Added: 0001252
23-07-14 18:58XuNNote Added: 0002359
23-07-14 18:58XuNStatusnew => resolved
23-07-14 18:58XuNFixed in Version => 0.56c Nightly
23-07-14 18:58XuNResolutionopen => fixed
23-07-14 18:58XuNAssigned To => XuN

Notes
(0001162)
Mirravin   
14-07-11 23:43   
(edited on: 14-07-11 23:45)
Do you using MYSQL database? I had similar problems sometimes when Sphere losing connection with DB server.

or mb infinity loop caused by scripts...

(0001163)
babidi   
15-07-11 07:29   
yes i use mysql for accounts and status
(0001204)
babidi   
01-08-11 20:53   
12:53:World save completed, took 1.3263 seconds
12:53:(sphere_serv_triggers.scp,141)Statics data saved (save/spherestatics.scp).
12:56:WARNING:Forcing thread 'Main' to terminate...
12:56:CRITICAL:'Main' thread hang, restarting...
12:59:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:02:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:02:CRITICAL:(functions_DB.scp,17)'Main' thread hang, restarting...
13:05:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:08:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:11:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
-----
13:30:STATUS: UPDATED SERVER INFO!
13:30:STATUS: UPDATED PLAYERS INFO!
13:31:ERROR:Warning: 1209 items at 3730,2596,40,too complex!
13:31:ERROR:Warning: 1209 items at 3726,2603,39,too complex!
13:33:STATUS: UPDATED SERVER INFO!
13:35:WARNING:(new_server_status.scp,24)Forcing thread 'Main' to terminate...
13:38:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:41:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:44:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:44:(sphere_serv_triggers.scp,141)Statics data saved (save/spherestatics.scp).
13:47:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:47:CRITICAL:(functions_DB.scp,17)'Main' thread hang, restarting...
13:50:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:53:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:56:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
13:59:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
14:02:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
14:05:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
14:08:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
14:11:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
14:14:WARNING:(functions_DB.scp,17)Forcing thread 'Main' to terminate...
---
functions_DB.scp
16# IF <DB.CONNECTED>
17# DB.QUERY "SELECT username, password FROM jos_users WHERE refresh = '1'"
18# IF <DB.ROW.NUMROWS> > 0

maybe some dealay for timeout?

however i say is critical that sometimes database TOTALY blocks sphere
(0001232)
babidi   
01-09-11 15:49   
no news on getting stucked after some use of the database?
(0001248)
babidi   
08-09-11 22:54   
doesn't anyone think is important that using database make server crash?
(0001249)
Shaklaban   
09-09-11 08:45   
(edited on: 09-09-11 08:48)
is the sphere and mysql on the same machine? and you can log the numrows. maybe queries which returns large amount of data is freezing the main thread. im always using limit in the queries because large queries=lag.

(0001250)
babidi   
09-09-11 17:09   
server and mysql are not on same server
this function is triggered by server_timer every 2-3 minutes, and not return large amount of data because is used for user registration so how many user can register in 2-3 minutes...

another function is called with server timer is a insert row for each player for status update (actualy very low player as is a beta server...)

as i said i think is enought to insert a timeout for waiting response from sql server
(0001251)
Shaklaban   
09-09-11 17:24   
(edited on: 09-09-11 17:26)
mysql connections is not fast for remote machines. query function is executed on main thread, so if the response will return slow, sphere will wait it and block the main thread. you should use aquery instead of query. timeout can prevent the crash cannot prevent to little freezes.

http://wiki.sphere.torfo.org/index.php/AQUERY [^]

(0001252)
babidi   
09-09-11 17:26   
if i use aquery, the script will wait for response. right?

es.

aquery users
first user is users[1]

will work good?
(0002359)
XuN   
23-07-14 18:58   
Remote querys should be executed with aquery.