Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Sep 25, 2010 2:40 am   

Cmud Lockup and Crash
 
I've got a problem and I have no idea what is causing it. Cmud just locks up pegs out the CPU and I can't do anything. It popped up an error saying The program tried to write to some address. Program terminated. The popup had nothing but an OK button. It's did this like 4 times now.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Sep 25, 2010 4:02 am   
 
Okay this is really annoying me. Pressing ESC does absolutely nothing. I've got the same scripts I have had for the last dozen versions and nothing has changed. As soon as I have a lot of activity and I am engaged in combat or something of that nature it just shoots the CPU to 100% and I can't do anything except kill Cmud through the task manager. I've never had this problem until the last couple of versions.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat Sep 25, 2010 4:30 pm   
 
Something is getting into an infinite loop. When CMUD crashes in an infinite loop you don't get the normal crash dump screen. All I can think of is to run the Script Debugger and turn on the message to show all script executions, although it's possible that the infinite loop will prevent the debugger from updating. But it might help you narrow down which parts of your scripts or triggers to look into. You'll need to enable/disable stuff to try and track it down. Maybe you'll track it down to something I can fix, or maybe it's just some sort of loop in your own code. Impossible to tell at this point.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Sep 25, 2010 6:12 pm   
 
Well I know. That's what is so annoying. Razz I figured it was something in a recursive function I have but it works fine in offline testing. I looked through all of my code and can't find anything. Once it happens it just locks everything, nothing updates, and I have to kill CMUD through the Task Manager. I'll figure it out I guess. Is there anyway to break out of it so I can see what is happening the next time it happens?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Sep 25, 2010 10:54 pm   
 
I think this problem is related to some expression triggers I have. I sent you a PM.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Sep 27, 2010 9:14 pm   
 
Okay disregard this. It was indeed related to trying to use database variables in expression triggers.
Reply with quote
XonDK
Apprentice


Joined: 01 Dec 2006
Posts: 178

PostPosted: Fri Oct 01, 2010 12:49 pm   
 
I've been having a similar problem to this, though oddly enough it happens mostly when nothing has happened for a while, cmud just locks up for no reason, I've checked my triggers but none of the fired one's have changed in a long time, and it is only in random situations anything happens, it 'seems' to be related to the workload however, long time low load or some times during high load.

I've tried to reproduce the lock but similar situations do not cause the lockup every time, it seems random? a leak somewhere? any way to detect a leak in a system?
I have a rather extensive system so going trigger by trigger isn't an option.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Oct 02, 2010 7:30 am   
 
I was wrong. It is still doing this in 3.30 and I removed all of the expression triggers that had database variables. I am still getting the exception thrown that says it tried to write to an illegal address with only an OK button, but only after a long time.

I have went through my settings and can't find anything that would cause this. I'm willing to admit it could be something in my settings, but I am not sure how I can debug it when the exception message is so vague. I don't even know where to start. The debugger doesn't work either because it locks everything up.

Like XonDK it is just random, and usually happens when I have a high load. There is no certain thing that I can find that causes it.

I am also still getting the Integer Overflow errors randomly.
Reply with quote
Derar
Novice


Joined: 09 Sep 2006
Posts: 44

PostPosted: Sat Oct 02, 2010 3:35 pm   
 
The vagueness of the exception error is no fault of CMud's, it's an error generated by the operating system. Typically (at least in my experience with CMud), it's an error that pops up when you max out your available memory and CMud is trying to write something to a non-existent (or at least unavailable) memory address. It's not really random in that regard, either.

The column you want to be watching in your task manager is Memory Usage. You'll probably find it's climbing pretty steadily in this scenario.

This does tend to be a settings-based problem though, but influenced I suspect by how the JSON code is handling memory release, since I hadn't started noticing it before that. I had meant to try and replicate an issue from scratch, but I just haven't had the time. Truthfully, though, even if the JSON memory management is "at fault", it's still controllable from a settings standpoint.

You'll probably want to look at any operations your settings are performing with large database variables. Specifically any loops or recursions that involve updating or rebuilding such large variables; chances are copying over and over is what's eating up your memory. In theory, with the %ref function, you should be able to rewrite whatever scripts are handling that and bypass the need for repeated large variable copy generation.

Hope it helps.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Oct 02, 2010 5:19 pm   
 
The problem is I don't have any of that. The largest db variable I have maybe has 12 keys and these are not called in any scripts that were in use. Ninety-nine percent of my settings just use plain variables and local variables. During the time it happened none of the 2 or 3 database variables were called. Where it might be though is that I use a lot of triggers in stringlists. I'm not really sure. There are two separate errors. The Windows one and the Cmud one. While Cmud may not generate an error on the lockup, I am assuming something is looping, but the problem is I have no idea what it could possibly be. The other exception is the Integer Overflow which is an exception thrown by Cmud.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sun Oct 03, 2010 7:29 pm   
 
If you get an Integer Overflow with a "Send bug report" dialog, then send the bug report or paste it here. If you are getting the error in one of the CMUD Script popup windows (without the crash dump info), then it means the error happened during a background script, like a trigger, etc, and the crash dump reporter isn't able to produce the crash dump report when it happens in a background thread.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Tue Oct 05, 2010 12:23 am   
 
Zugg I can make this happen continually by running a test with my settings and walking through it. However, when it hangs it locks everything and stops printing and the debugger stops. It hangs right at the %pop occurrence every single time, but I don't understand why. It also only happens after certain things take effect, which have no bearing on the %pop so I am completely confused. I've been sitting here for an hour and apparently I am not smart enough to figure it out. I've changed my code, moved stuff around, tried everything. It does the same thing every time. It hangs and then Cmud just closes out with no error or anything. I was going to send you a screenshot but I cannot even do that due to the CPU being pegged out and out of memory. Anyway, I was printing the %json of the stringlist before and after the %pop. It prints the before but then it hangs on the %pop. The list before it looks normal to me.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Tue Oct 05, 2010 8:36 am   
 
Seems that the problem was a %push that added an item to the list after a certain amount of flags were set. I guess it was trying to %push and %pop at the same time. I removed the %push completely and it doesn't happen anymore. Instead of pushing an item onto the list I just replaced the whole list and then the next %pop didn't hang it.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Oct 05, 2010 3:45 pm   
 
Show me the code that you changed so I can look into this. Without code, I can't do much.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Tue Oct 05, 2010 9:33 pm   
 
I give up Zugg. I was going to make a copy of my package to send you. I changed the code back to what it was when it kept happening, but when I ran the same test today nothing happens. Yesterday it happened every time.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Oct 05, 2010 9:48 pm   
 
You might also want to check this thread: http://forums.zuggsoft.com/forums/viewtopic.php?p=161666#161666
where somebody posted a reliable way to reproduce a memory leak and infinite loop hang. See if your script uses %replaceitem anywhere.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Oct 06, 2010 10:44 am   
 
I saw that. Obviously mine is nothing so simple or I would have found it ages ago.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net