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-20-2007, 08:38 PM   #1 (permalink)
Newbie
 
Join Date: Oct 2006
Posts: 13
Default Overflow exception at line 171 in PacketWriter

All right, now, I've investigated this a little, so I'm not just saying, "HELP ME WITH THIS:" but, I figure a good place to start is by showing you the problem I got, copy pasted from a crash log:


Exception:
System.OverflowException: Arithmetic operation resulted in an overflow.
at Server.Network.PacketWriter.Write(Int32 value) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\PacketWriter.cs:line 171
at Server.Network.AccountLoginAck..ctor(ServerInfo[] info) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\Packets.cs:line 3376
at Server.Network.PacketHandlers.AccountLogin_ReplyAc k(NetState state) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\PacketHandlers.cs:line 2251
at Server.Network.PacketHandlers.AccountLogin(NetStat e state, PacketReader pvSrc) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\PacketHandlers.cs:line 2228
at Server.Network.MessagePump.HandleReceive(NetState ns) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\MessagePump.cs:line 236
at Server.Network.MessagePump.Slice() in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\MessagePump.cs:line 106
at Server.Core.Main(String[] args) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Main.cs:line 385

Basically, I checked Core.Main, and followed functions until I got to a line in packet.cs that read something like:

Code:
m_Stream.Write( (sbyte) si.Timezone) );
give or take some of the conventions (capitalization, maybe) that people get nit-picky about.
within write( int value ), it is:
Code:
public void Write( int value )
		{
			m_Buffer[0] = (byte)(value >> 24);
			m_Buffer[1] = (byte)(value >> 16);
			m_Buffer[2] = (byte)(value >>  8);
			m_Buffer[3] = (byte) value;

			m_Stream.Write( m_Buffer, 0, 4 );
		}
Now, I'm fairly new to this portion of the programming, so to be frank, I don't know what it means. All I know is that in my case, the integer being used (Timezone) is probably -5, because of the timezone I live in (eastern U.S.)

if I'm horribly wrong, I'd like to know. I'd like to, you know, get better at this stuff, and I can't do that without being able to get my server running.

This crash occurs when I connect to my server, I'm guessing just before or during the verification step.

- Sephur
Sephur is offline   Reply With Quote
Old 11-21-2007, 05:12 PM   #2 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

It SHOULD be using the following signature:

PacketWriter.cs - Line 138
Code:
		/// <summary>
		/// Writes a 1-byte signed integer value to the underlying stream.
		/// </summary>
		public void Write( sbyte value )
		{
			m_Stream.WriteByte( (byte) value );
		}

Not really sure why it's crashing, that should be a legit explicit conversion.

Last edited by Ravatar; 11-21-2007 at 05:14 PM.
Ravatar is offline   Reply With Quote
Old 11-22-2007, 06:07 AM   #3 (permalink)
Newbie
 
Join Date: Oct 2006
Posts: 13
Default

all right. I'll check it out that way really quickly, and I'll update with what happens.

Reminder: I hate to be the guy that just screams, FIX IT, but at this point, I don't think I really understand this part of the code.
Sephur is offline   Reply With Quote
Old 11-22-2007, 06:21 AM   #4 (permalink)
Newbie
 
Join Date: Oct 2006
Posts: 13
Default

Good news is that it got further,

Exception:
System.OverflowException: Arithmetic operation resulted in an overflow.
at Server.Network.AccountLoginAck..ctor(ServerInfo[] info) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\Packets.cs:line 3374
at Server.Network.PacketHandlers.AccountLogin_ReplyAc k(NetState state) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\PacketHandlers.cs:line 2251
at Server.Network.PacketHandlers.AccountLogin(NetStat e state, PacketReader pvSrc) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\PacketHandlers.cs:line 2228
at Server.Network.MessagePump.HandleReceive(NetState ns) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\MessagePump.cs:line 236
at Server.Network.MessagePump.Slice() in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\MessagePump.cs:line 106
at Server.Core.Main(String[] args) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Main.cs:line 385

However, all it did was eliminate the last foul-up. It's still having a conniption when it gets to the AccountLoginAck() function in Packets.cs, line 3374, which is the line of:

Code:
m_Stream.Write( (byte) si.TimeZone );
Maybe I changed the wrong thing? Anywho, if I could change where it's getting TimeZone from, maybe I could mess around with some values and see if it's the actual value of TimeZone messing it up. But that could be just one of many solutions.
(I even tried explicitly setting it to 0, but all I remember is that it didn't work.)
So, that's the situation thus far, keep me updated if you think of another solution.

- Sephur
Sephur is offline   Reply With Quote
Old 11-22-2007, 06:30 AM   #5 (permalink)
Newbie
 
Join Date: Oct 2006
Posts: 13
Default

I like how I'm talking to myself right now...

Anywho, I did find a line that apparently used my computer's time to set si.TimeZone to a value. I checked what would happen if I instead just kept it at 0, and this occured:

Exception:
System.OverflowException: Arithmetic operation resulted in an overflow.
at Server.Utility.GetAddressValue(IPAddress address) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Utility.cs:line 423
at Server.Network.AccountLoginAck..ctor(ServerInfo[] info) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\Packets.cs:line 3375
at Server.Network.PacketHandlers.AccountLogin_ReplyAc k(NetState state) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\PacketHandlers.cs:line 2251
at Server.Network.PacketHandlers.AccountLogin(NetStat e state, PacketReader pvSrc) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\PacketHandlers.cs:line 2228
at Server.Network.MessagePump.HandleReceive(NetState ns) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\MessagePump.cs:line 236
at Server.Network.MessagePump.Slice() in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Network\MessagePump.cs:line 106
at Server.Core.Main(String[] args) in c:\Users\Douglas\Documents\SharpDevelop Projects\RunUOServer - NVL\Scripts\Main.cs:line 385


Now, I'm just assuming it might be another problem it didn't get to because of the first one. I mean, logically, if something fails at step 4, it'll never get around to seeing that step 6 fails as well, metaphorically.

So, I'm going to investigate this one, and if it just happens to be the same problem again, I'll be updating to this thread anyhow.
Sephur is offline   Reply With Quote
Old 11-22-2007, 06:40 AM   #6 (permalink)
Newbie
 
Join Date: Oct 2006
Posts: 13
Default

So... now it seems to be having a problem with my IP Address. Apparently, I has a rough time writing it as an integer, so I tried, in a desperate attempt, to use, instead of GetAddressValue(), GetLongAddressValue(), which was completely futile, because it had to convert it into an int explicitly for the m_Stream.Write() function. *is stupid and tired*

I need some rest. I should really be doing these things on a clear head. I'm probably just missing some minor detail. I wouldn't put it past myself. My best guess right (oh jeez... I really am tired. I accidentally wrote "write" here, and I had to fix it) now is that my client files are a little behind, because that's what the server is using to run. I should probably patch up sometime.

- Sephur
Sephur is offline   Reply With Quote
Old 11-25-2007, 01:16 AM   #7 (permalink)
Newbie
 
Join Date: Oct 2006
Posts: 13
Default possible problems

I was thinking again tonight, I haven't worked much with building using an IDE. Maybe there's some setting I have that it ruins the process, or maybe (because two folders are created after a build) I'm using the .exe from the wrong folder. Is there any way that could be causing the problem?
Sephur is offline   Reply With Quote
Old 11-25-2007, 02:54 AM   #8 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

When you compile the server, you need to uncheck "Check Arithmetic overflow/underflow." It should be somewhere in the Project Settings window in your IDE.
TheOutkastDev 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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5