RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[?]quad core issue or am i screwed?

koluch

Sorceror
I took a save(tried several) and put in on my new quad core computer. The game started, I did a [save and it was fine, did a shutdown with save, all good.
I restarted the server, starts fine, did a [save....CRASH!!! And I mean HUGE!

This scenario is happening with different versions of the server, one from way, same thing on this new machine. I have tried different saves also. .I am afraid to shut my server off, but I have to, because I don't think I cam get it restarted if it does the same thing that is happening on my machine :( Help???????? :( Here is the huge crash log....*sobhzzz*

Code:
Server Crash Report
===================

RunUO Version 2.2, Build 4649.23040
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 4.0.30319.269
Time: 10/1/2012 6:30:58 AM
Mobiles: 37281
Items: 406000
Exception:
System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Server.Guilds.Guild.Serialize(GenericWriter writer)
   at Server.DynamicSaveStrategy.<SaveGuilds>b__e(BaseGuild guild, ParallelLoopState state, QueuedMemoryWriter writer)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass7.<ExecuteSelfReplicating>b__6(Object )
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource,TLocal](IEnumerable`1 source, Func`1 localInit, Func`4 body, Action`1 localFinally)
   at Server.DynamicSaveStrategy.SaveGuilds()
   at Server.DynamicSaveStrategy.Save(SaveMetrics metrics, Boolean permitBackgroundWrite)
   at Server.World.Save(Boolean message, Boolean permitBackgroundWrite)
   at Server.Commands.CommandHandlers.Save_OnCommand(CommandEventArgs e)
   at Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType type)
   at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
   at Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Server.Guilds.Guild.Serialize(GenericWriter writer)
   at Server.DynamicSaveStrategy.<SaveGuilds>b__e(BaseGuild guild, ParallelLoopState state, QueuedMemoryWriter writer)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass7.<ExecuteSelfReplicating>b__6(Object )<---


Clients:
- Count: 1
Thats HUGE!

Thoughts please anyone!
 

koluch

Sorceror
** I am NOT bumping this tread just posting the answer so others might know**


FYI: there is nothing wrong with my server, it just will not compile and run on a Quad Core 64bit machine, at least without modifying something I do not know about.

I am use SVN 908, Framework 4.0 with the proper Assemblies.cfg.

I moved the backup to another machine, a 64bit duel core and it compiled and ran just fine.

Anyone out there using a Quad Core to run their server, I would appreciate if you could let know what changes I need to make :)

Thank you,

Koluch
 

Avelyn

Sorceror
** I am NOT bumping this tread just posting the answer so others might know**


FYI: there is nothing wrong with my server, it just will not compile and run on a Quad Core 64bit machine, at least without modifying something I do not know about.

I am use SVN 908, Framework 4.0 with the proper Assemblies.cfg.

I moved the backup to another machine, a 64bit duel core and it compiled and ran just fine.

Anyone out there using a Quad Core to run their server, I would appreciate if you could let know what changes I need to make :)

Thank you,

Koluch


I am not sure you aren't correct on this, and I don't run my servers on Quad Cores, but from that crash log, I find it strange that it has saved okay and then randomly crashes when you do it a different time, I would think if it was having problems with the CPU, it would crash every time. The crash is happening when you are trying to Serialize your guilds. The Dual core you ran it on, did it also have .NET 4? If it truly is something with the multi core, I believe there is a way you can force the server to only run as if there is one, I would need to look into that or maybe someone will answer that. If RunUO has problems with quad cores, that would need to be an edit in the core compiled files, so you would want to check there if you have the knowledge and recompile the RunUO core, or wait until the RunUo team addresses it. I still wonder if it would be something else. Is the server you are using completely clean and SVN updated properly?
 

koluch

Sorceror
I am not sure you aren't correct on this, and I don't run my servers on Quad Cores, but from that crash log, I find it strange that it has saved okay and then randomly crashes when you do it a different time, I would think if it was having problems with the CPU, it would crash every time. The crash is happening when you are trying to Serialize your guilds. The Dual core you ran it on, did it also have .NET 4? If it truly is something with the multi core, I believe there is a way you can force the server to only run as if there is one, I would need to look into that or maybe someone will answer that. If RunUO has problems with quad cores, that would need to be an edit in the core compiled files, so you would want to check there if you have the knowledge and recompile the RunUO core, or wait until the RunUo team addresses it. I still wonder if it would be something else. Is the server you are using completely clean and SVN updated properly?
Yes on everything.
The core compile I did as I always do, only now on my now quad core machine. This was the first core I compiled on this machine.

I have compiled many cores and yes I am updated to the latest SVN. A core compilied on a duel core computer has no issues, that was done the following day using the server, saves and scripts that gave the crash report above. It saves and runs with no issues.
In the core, would this be the problem maybe?
Code:
using System;
using Server;

namespace Server
{
    public abstract class SaveStrategy
    {
        public static SaveStrategy Acquire()
        {
            if (Core.MultiProcessor)
            {
                int processorCount = Core.ProcessorCount;

#if Framework_4_0
                if (processorCount > 2)
                {
                    return new DynamicSaveStrategy();
                }
#else
                if (processorCount > 16)
                {
                    return new ParallelSaveStrategy(processorCount);
                }
#endif
                else
                {
                    return new DualSaveStrategy();
                }
            }
            else
            {
                return new StandardSaveStrategy();
            }
        }

        public abstract string Name { get; }
        public abstract void Save(SaveMetrics metrics, bool permitBackgroundWrite);

        public abstract void ProcessDecay();
    }
}

where is is making anything over a duel core use DynamicSaveStrategy rather then StandardSaveStrategy??

Im going to compile a core with the older version of this file to see if the standard Save Strategy works .

Other then that, I just dont know :/
 

Avelyn

Sorceror
Yes on everything.
The core compile I did as I always do, only now on my now quad core machine. This was the first core I compiled on this machine.

I have compiled many cores and yes I am updated to the latest SVN. A core compilied on a duel core computer has no issues, that was done the following day using the server, saves and scripts that gave the crash report above. It saves and runs with no issues.
In the core, would this be the problem maybe?
Code:
using System;
using Server;
 
namespace Server
{
    public abstract class SaveStrategy
    {
        public static SaveStrategy Acquire()
        {
            if (Core.MultiProcessor)
            {
                int processorCount = Core.ProcessorCount;
 
#if Framework_4_0
                if (processorCount > 2)
                {
                    return new DynamicSaveStrategy();
                }
#else
                if (processorCount > 16)
                {
                    return new ParallelSaveStrategy(processorCount);
                }
#endif
                else
                {
                    return new DualSaveStrategy();
                }
            }
            else
            {
                return new StandardSaveStrategy();
            }
        }
 
        public abstract string Name { get; }
        public abstract void Save(SaveMetrics metrics, bool permitBackgroundWrite);
 
        public abstract void ProcessDecay();
    }
}

where is is making anything over a duel core use DynamicSaveStrategy rather then StandardSaveStrategy??

Im going to compile a core with the older version of this file to see if the standard Save Strategy works .

Other then that, I just dont know :/


Is it me or is that code kind of confusing. I know it's late, but to me, there seems to be a problem there. If you have the 4.0 Framework running, and you have a quad core, it would satisfy the first if statement, but can anything satisfy the second? If you have more then 2, it will run the first statement and if you have less than two it will run neither and go with the standard save. I am not sure, but I think you nailed that section as the problem area.
 

koluch

Sorceror
Reverted this back to the old version
Code:
/***************************************************************************
 *                             SaveStrategy.cs
 *                            -------------------
 *   begin                : May 1, 2002
 *   copyright            : (C) The RunUO Software Team
 *   email                : [email protected]
 *
 *   $Id: SaveStrategy.cs 844 2012-03-07 13:47:33Z mark $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

using System;
using Server;

namespace Server
{
    public abstract class SaveStrategy
    {
        public static SaveStrategy Acquire()
        {
            if (Core.MultiProcessor)
            {
                int processorCount = Core.ProcessorCount;

                if (processorCount > 16)
                {
#if Framework_4_0
                    return new DynamicSaveStrategy();
#else
                    return new ParallelSaveStrategy( processorCount );
#endif
                }
                else
                {
                    return new DualSaveStrategy();
                }
            }
            else
            {
                return new StandardSaveStrategy();
            }
        }

        public abstract string Name { get; }
        public abstract void Save(SaveMetrics metrics, bool permitBackgroundWrite);

        public abstract void ProcessDecay();
    }
}

Bingo.
Saved with no crash.
Need to test further but that I believe is the issue that needs to be addressed.
 
Top