SphereServer BugTracker - SphereServer
View Issue Details
0001818SphereServerexecutable - genericpublic16-09-10 13:2424-01-11 01:11
Incanus 
MrSugarCube 
normalcrashunable to reproduce
closedduplicate 
 
 
Automated (specify build number)
None
Command_Sysmsgs, FileCommands, NoHouseMuteSpeech, Buffs, NoPrefix
1333
0001818: Sphere throws exception in CScript::ReadKeyParse after running fine for 24 hours
Sphere throws exception in CScript::ReadKeyParse after running fine for 24 hours

00:02:DEBUG:__ thread (2700) __ | # | _____ function _____________ | ticks passed from previous function start ______
00:02:DEBUG:>> 2700 | 0 | CWorld::OnTick | +0
00:02:DEBUG:>> 2700 | 1 | CSector::OnTick | +0
00:02:DEBUG:>> 2700 | 2 | CChar::OnTick | +0
00:02:DEBUG:>> 2700 | 3 | CChar::OnTickEquip | +0
00:02:DEBUG:>> 2700 | 4 | CItem::OnTick | +0
00:02:DEBUG:>> 2700 | 5 | CItem::OnTrigger | +0
00:02:DEBUG:>> 2700 | 6 | CScriptObj::OnTriggerScript | +0
00:02:DEBUG:>> 2700 | 7 | CScriptObj::OnTriggerRunVal | +0
00:02:DEBUG:>> 2700 | 8 | CScriptObj::OnTriggerRun | +0
00:02:DEBUG:>> 2700 | 9 | CItemScript::r_Verb | +0
00:02:DEBUG:>> 2700 | 10 | CItem::r_Verb | +0
00:02:DEBUG:>> 2700 | 11 | CObjBase::r_Verb | +0
00:02:DEBUG:>> 2700 | 12 | CScriptObj::r_Verb | +0
00:02:DEBUG:>> 2700 | 13 | CChar::r_Verb | +0
00:02:DEBUG:>> 2700 | 14 | CObjBase::r_Verb | +0
00:02:DEBUG:>> 2700 | 15 | CScriptObj::r_Call | +0
00:02:DEBUG:>> 2700 | 16 | CScriptObj::OnTriggerRun | +0
00:02:DEBUG:>> 2700 | 17 | CScriptObj::ParseText | +0
00:02:DEBUG:>> 2700 | 18 | CChar::r_WriteVal | +0
00:02:DEBUG:>> 2700 | 19 | CObjBase::r_WriteVal | +0
00:02:DEBUG:>> 2700 | 20 | CScriptObj::r_Call | +0
00:02:DEBUG:>> 2700 | 21 | CScriptObj::OnTriggerRun | +0
00:02:DEBUG:>> 2700 | 22 | CScript::ReadKeyParse | +0 <-- exception catch point (below is guessed and could be incorrect!)
00:02:DEBUG:>> 2700 | 23 | CScript::ReadKey | +0
00:02:DEBUG:>> 2700 | 24 | CResourceLock::ReadTextLine | +0
00:02:DEBUG:>> 2700 | 25 | CScriptKeyAlloc::GetKeyBufferRaw | +0
00:02:CRITICAL:(timeandlight.scp,58)Exception, in CScript::ReadKeyParse() 0000001 "read"

This is only the first exception. It was followed by a huge number of other exception. Sphere didn't crash but occupied all memory so we had to reset the server, because it was impossible to operate it.

I uploaded the complete log until we restarted the server.
Experimental Flags =EF_NetworkOutThread
No tags attached.
related to 0001868resolved MrSugarCube Sphere has a major memory leak 
zip sphere2010-09-16.zip (92,464) 16-09-10 13:24
http://tracker.sphere.torfo.org/bugs/file_download.php?file_id=41&type=bug
Issue History
16-09-10 13:24IncanusNew Issue
16-09-10 13:24IncanusFile Added: sphere2010-09-16.zip
16-09-10 18:43IncanusNote Added: 0000635
17-09-10 13:14IncanusNote Added: 0000636
22-09-10 02:17MrSugarCubeNote Added: 0000659
22-09-10 04:08IncanusNote Added: 0000661
24-01-11 01:02IncanusNote Added: 0000866
24-01-11 01:09MrSugarCubeRelationship addedrelated to 0001868
24-01-11 01:10MrSugarCubeStatusnew => closed
24-01-11 01:11MrSugarCubeAssigned To => MrSugarCube
24-01-11 01:11MrSugarCubeResolutionopen => duplicate

Notes
(0000635)
Incanus   
16-09-10 18:43   
The cause of the errors seems to be a memory leak, leading to this strange behavior, when the memory is full. I noticed sphere consuming a high a amount of 700 mb of memory after running for 18 hours. After a fresh restart it only occupies 460 mb.
(0000636)
Incanus   
17-09-10 13:14   
Disabling EF_NetworkOutThread didn't make a difference
(0000659)
MrSugarCube   
22-09-10 02:17   
Is there anything interesting on line 58 of timeandlight.scp?
(0000661)
Incanus   
22-09-10 04:08   
Line 58 is just a function header: [FUNCTION f_get_light]

The real problem here seems to be the memory leak. We leak 500-600 mb per day, so we have to restart the server regularly.
(0000866)
Incanus   
24-01-11 01:02   
This bug was a result of the memory leak which is fixed in 1402 (thanks for that :) ), so it can get closed