Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Windows

Server Support on Windows Get (and give) support on general questions related to the RunUO server itself.

Reply
 
Thread Tools Display Modes
Old 11-06-2006, 01:23 PM   #1 (permalink)
Newbie
 
Shanira's Avatar
 
Join Date: Jul 2004
Age: 26
Posts: 48
Default Crash every 3 days or so using RunUO 2.0 RC1

Quote:
Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.2.3790 Service Pack 1
.NET Framework: 2.0.50727.42
Time: 06-11-2006 16:40:28
Mobiles: 7047
Items: 66543
Clients:
- Count: 0

Exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Server.Core.Main(String[] args)
Really not sure what to make of this one. It keeps happening at semi-regular intervals. Does anyone else get anything like this, or is it just me? I even looked at Core.Main and couldn't figure out where it was erroring. What's also baffling is the lack of information despite starting with -debug.

Um, any ideas?
__________________
There are only 10 or 01 kinds of people, those who understand big and little endian, and those who do not.
Shanira is offline   Reply With Quote
Old 11-06-2006, 03:42 PM   #2 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 28
Posts: 8,305
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Debug crash report might bring up more ideas.
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 11-06-2006, 04:15 PM   #3 (permalink)
Newbie
 
Shanira's Avatar
 
Join Date: Jul 2004
Age: 26
Posts: 48
Default

That is the report after I turned on debug though... O_o

I mean, here's the console dump for the server starting:

Quote:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Core: Running with arguments: -debug
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...done (cached)
__________________
There are only 10 or 01 kinds of people, those who understand big and little endian, and those who do not.
Shanira is offline   Reply With Quote
Old 11-06-2006, 07:43 PM   #4 (permalink)
Forum Novice
 
Kenny164's Avatar
 
Join Date: Sep 2004
Location: Ballymena, Northern Ireland
Age: 24
Posts: 463
Send a message via MSN to Kenny164
Default

Are you running it from the command prompt?

I may be wrong, but I think I heard somebody on this forum (lately) saying that was cause of a similar problem.
__________________
Use the middle mouse button on Here for forum rules, if nothing happens get firefox and try again!!!
Kenny164 is offline   Reply With Quote
Old 11-06-2006, 11:34 PM   #5 (permalink)
Newbie
 
Shanira's Avatar
 
Join Date: Jul 2004
Age: 26
Posts: 48
Default

Well I use a custom solution that restarts the server and lets me remotely stop or restart it as well. So it might be that, but I just spent a good half hour searching for something about this and coming up with a lot of blanks.

If anyone has the solution to this I'd much appreciate knowing.
__________________
There are only 10 or 01 kinds of people, those who understand big and little endian, and those who do not.
Shanira is offline   Reply With Quote
Old 11-06-2006, 11:53 PM   #6 (permalink)
Forum Expert
 
Thistle's Avatar
 
Join Date: Mar 2005
Posts: 1,155
Default

Quote:
Well I use a custom solution that restarts the server ...
Why not remove that and see if the problem goes away?
__________________
Thistle is offline   Reply With Quote
Old 11-07-2006, 07:53 AM   #7 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,279
Default

Is your server completely stock, or do you have custom system(s) installed?
Joeku is offline   Reply With Quote
Old 11-07-2006, 11:49 AM   #8 (permalink)
Newbie
 
Shanira's Avatar
 
Join Date: Jul 2004
Age: 26
Posts: 48
Default

Well without that solution it becomes really hard to manage the server? >_> I suppose I can try that.

And yes, I have a bunch of scripts installed including XmlSpawners, Knives' Townhouses, Sleepable Beds, QuickRestart and a custom script I made for a dye remover item.

I fail to see how any of them would throw an exception in Core.Main() though, if it was a script erroring out wouldn't it give me a stack trace to a script and give a lot more information if it's in debug mode?

Meh, this thing has me completely dumbfounded.

EDIT: Oh AND they always happen when nobody's on, so far. Which makes it even more mysterious.
__________________
There are only 10 or 01 kinds of people, those who understand big and little endian, and those who do not.

Last edited by Shanira; 11-07-2006 at 11:56 AM.
Shanira is offline   Reply With Quote
Old 11-07-2006, 12:08 PM   #9 (permalink)
Forum Master
 
Join Date: Oct 2005
Age: 46
Posts: 6,283
Default

Unfortunately, this is exactly why 2.0 is not recommended to be run on a production shard.
Malaperth is offline   Reply With Quote
Old 11-07-2006, 12:20 PM   #10 (permalink)
Forum Novice
 
Join Date: May 2004
Age: 50
Posts: 100
Default

Have you deleted the
Scripts.cs.dll
Scripts.cs.hash
From the Scripts output folder ? If not do so

Also the reportHistory.xml and StaffHistory.xml from the main directory

I would do that before anything else if you have made or added any new scripts and that should fix it. As long as its not a script issue.

Good Luck
GameOva is offline   Reply With Quote
Old 11-07-2006, 12:34 PM   #11 (permalink)
Forum Novice
 
RavonTUS's Avatar
 
Join Date: Aug 2004
Location: in a house.
Age: 41
Posts: 597
Send a message via AIM to RavonTUS
Default

Greetings,

I could be a timer in a script. Do you have a weather or season script installed that may change or a save/backup that only runs every few days?

One other question, did you modify your core or is it stock?

-Ravon
__________________

the cure for the UO addiction
RavonTUS is offline   Reply With Quote
Old 11-07-2006, 01:59 PM   #12 (permalink)
Newbie
 
Shanira's Avatar
 
Join Date: Jul 2004
Age: 26
Posts: 48
Default

If nobody runs a shard with it bugs like this might not come to the surface though?

Well I let a more schooled friend of mine look at him and according to him the problem is in the core file Main.cs, in Core.Main() (stock, I haven't done core modifications)

Code:
					if ( ( ++sample % sampleInterval ) == 0 ) {
						now = DateTime.Now;
						m_CyclesPerSecond[m_CycleIndex++ % m_CyclesPerSecond.Length] =
							ticksPerSecond / ( now.Ticks - last.Ticks );
						last = now;
					}
This is run in an infinite loop and so eventually m_CycleIndex will become too large and the server exits by throwing an Index Out Of Range error.

I'll uh, think of a fix later when I'm not distracted by playing PSU but this basically seems to be where the problem is.
__________________
There are only 10 or 01 kinds of people, those who understand big and little endian, and those who do not.

Last edited by Shanira; 11-07-2006 at 02:11 PM.
Shanira is offline   Reply With Quote
Old 11-07-2006, 04:00 PM   #13 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 28
Posts: 8,305
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Actually it use the operator % in order to ensure that it will never go out of bounds.
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 11-08-2006, 11:45 AM   #14 (permalink)
Newbie
 
Shanira's Avatar
 
Join Date: Jul 2004
Age: 26
Posts: 48
Default

Asked him again about it today, and explained what you said here. As I understand m_CycleIndex will increase every loop through. The modulus operator will make sure it won't get out of bounds, I just realized.

Only problem comes up when m_CycleIndex is 2147483647.

Apparantly in C# 2147483647 + 1 = -2147483648

I never thought of that as I'm used to getting overflow errors if I try a stunt like that.

-2147483648 mod 100 = -48

m_CyclesPerSecond[-48] = ticksPerSecond / ( now.Ticks - last.Ticks );

And considering:

private static float[] m_CyclesPerSecond = new float[100];

BOOM index out of range exception, server blows up. Considering the crash was about every 3 days, this should be what's happening as far as I can tell.
__________________
There are only 10 or 01 kinds of people, those who understand big and little endian, and those who do not.

Last edited by Shanira; 11-08-2006 at 11:48 AM.
Shanira is offline   Reply With Quote
Old 11-08-2006, 12:12 PM   #15 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 468
Default

I can confirm this. Initialize m_CycleIndex to 2147483646, recompile the core and launch, give it a few seconds and you'll get the same crash.
snicker7 is offline   Reply With Quote
Old 11-08-2006, 12:18 PM   #16 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 468
Default

probably should just add an accessor for CycleIndex, and reset it to 0 whenever it is == to m_CyclesPerSecond.Length.
snicker7 is offline   Reply With Quote
Old 11-08-2006, 12:49 PM   #17 (permalink)
Forum Novice
 
Join Date: Jul 2005
Location: Istanbul/Turkey
Age: 28
Posts: 425
Default

change it to unsigned int
__________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
noobie is offline   Reply With Quote
Old 11-08-2006, 01:28 PM   #18 (permalink)
Forum Novice
 
Join Date: Dec 2005
Posts: 468
Default

it will still overflow eventually, and while it wont crash, it may cause some silly shit with the cyclespersecond counter. I guess that's not that important, but to do it the right way...
snicker7 is offline   Reply With Quote
Old 11-08-2006, 03:04 PM   #19 (permalink)
Forum Administrator
 
krrios's Avatar
 
Join Date: Aug 2002
Posts: 2,854
Default

Great catch! I don't have SVN access from this machine, but I'll make sure this gets resolved.
krrios is offline   Reply With Quote
Old 11-08-2006, 03:23 PM   #20 (permalink)
Administrator
 
Zippy's Avatar
 
Join Date: Aug 2002
Location: Baltimore, MD
Age: 26
Posts: 4,890
Default

Fixed in SVN Rev 100 and 101.
__________________
Zippy, Razor Creator and RunUO Core Developer
The RunUO Software Team

"Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal."
~The Cryptonomicon

Zippy is offline   Reply With Quote
Old 11-08-2006, 04:22 PM   #21 (permalink)
Newbie
 
Shanira's Avatar
 
Join Date: Jul 2004
Age: 26
Posts: 48
Default

Glad I could be of service.
__________________
There are only 10 or 01 kinds of people, those who understand big and little endian, and those who do not.
Shanira is offline   Reply With Quote
Old 11-09-2006, 10:04 AM   #22 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

Great fix Zippy/krrios!
Kenko is offline   Reply With Quote
Old 11-28-2006, 04:59 AM   #23 (permalink)
Lurker
 
Join Date: Sep 2006
Age: 52
Posts: 20
Default

Quote:
Originally Posted by Zippy
Fixed in SVN Rev 100 and 101.
I have the same error on RUNUO 2.0 RC1, so I really would like this fix, but where can I get it.
Searching on SVN comes out with no pages.

So if you would be so kind to hand the link.
Thank you
__________________
It never hurts to help:)
Andromeda is offline   Reply With Quote
Old 11-28-2006, 08:38 AM   #24 (permalink)
Forum Expert
 
Kenko's Avatar
 
Join Date: Dec 2004
Location: Land of the Poor
Posts: 1,828
Send a message via MSN to Kenko
Default

Download TortoiseSVN and follow the link in Announcements forum, there is a thread about SVN Repository.
Kenko is offline   Reply With Quote
Old 11-29-2006, 10:28 AM   #25 (permalink)
Lurker
 
Join Date: Sep 2006
Age: 52
Posts: 20
Default

hmm dunno what you mean but in announcements there is no where the link to: Fixed in SVN Rev 100 and 101. It has only links to TortoiseSVN
and I need to know where to download that as the Main.cs is fixed in there for this problem.
__________________
It never hurts to help:)
Andromeda is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5