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: Mon Aug 16, 2010 4:19 am   

[3.22a] Continual Crashes and Weird Behavior
 
Okay I reported this before. I thought I knew what the problem is but I guess I don't. Now I can't even use Cmud at all. Not only that but it is crashing Windows. I haven't changed anything. I didn't do anything or add anything to my package.

Here is what happened today. I connect and get a lot of traffic and Cmud becomes sluggish more and more and then crash.

I then think well perhaps something is corrupted. I export my package to XML then reimport and reinstall Cmud. Now I am back to the problem with functions and all sorts of stuff firing/executing as soon as I load Cmud, which is NOT normal and NOTHING that I did.

Then I click reconnect and boom it crashes. Here is the report.

date/time : 2010-08-15, 23:08:38, 93ms
operating system : Windows XP Service Pack 3 build 2600
system language : English
system up time : 11 minutes 46 seconds
program up time : 7 minutes 46 seconds
processor : AMD Athlon(tm) 64 Processor 3800+
physical memory : 898/2047 MB (free/total)
free disk space : (C:) 120.31 GB
display mode : 1440x900, 32 bit
process id : $8b0
allocated memory : 868.04 MB
executable : cMUD.exe
exec. date/time : 2010-07-30 11:48
version : 3.22.1.1
compiled with : BCB 2006/07
madExcept version : 3.0k
callstack crc : $2a53a0dd, $8a3f446d, $8a3f446d
exception number : 1
exception class : EAccessViolation
exception message : Access violation at address 0065508C in module 'cMUD.exe'. Write of address 7C800000.

Main ($8a4):
0065508c +0024 cMUD.exe PRealStr 292 +3 PRealStrings.Add
0065522b +001b cMUD.exe PRealStr 382 +5 PRealStrings.GetCreate
00655257 +0003 cMUD.exe PRealStr 395 +1 PRealStrings.Store
00dad434 +0024 cMUD.exe CodeExec 276 +1 TCodeExec.PushIPStr
00db8c31 +0445 cMUD.exe CodeExec 3643 +65 TCodeExec.InternalExecute
00dadd02 +0072 cMUD.exe CodeExec 548 +9 TCodeExec.Execute
00db607a +03a2 cMUD.exe CodeExec 2887 +32 HandleCom
00db8e95 +06a9 cMUD.exe CodeExec 3695 +117 TCodeExec.InternalExecute
00dadc4f +0053 cMUD.exe CodeExec 524 +8 TCodeExec.Execute
00da1ae2 +00c2 cMUD.exe PrefDat 11036 +9 TCacheNode.Execute
00d9dd37 +035f cMUD.exe PrefDat 9456 +61 PrefRec.InternalExecute
00d9df9f +001f cMUD.exe PrefDat 9514 +2 PrefRec.Execute
00cdc0f3 +0153 cMUD.exe MAIN 6594 +14 TMUDForm.ExecThread
00ce4664 +0530 cMUD.exe MAIN 9492 +101 TMUDForm.ExecTrig
00cea531 +0519 cMUD.exe MAIN 11665 +86 TMUDForm.InputTrigger
00cd3db3 +0097 cMUD.exe MAIN 4391 +10 TMUDForm.RecordSendStr
00d1b60d +0031 cMUD.exe MAIN 22722 +4 TMUDForm.SendTriggerStr
00d10d14 +7504 cMUD.exe MAIN 20575 +1293 HandleCase
00d15885 +00a5 cMUD.exe MAIN 21215 +13 TMUDForm.ExecCommand
00daed81 +00a9 cMUD.exe CodeExec 1026 +9 ExecMUDCommand
00db5b4b +04bb cMUD.exe CodeExec 2839 +47 DoDefault
00db6d49 +1071 cMUD.exe CodeExec 3134 +279 HandleCom
00db8e95 +06a9 cMUD.exe CodeExec 3695 +117 TCodeExec.InternalExecute
00dadc4f +0053 cMUD.exe CodeExec 524 +8 TCodeExec.Execute
00da1ae2 +00c2 cMUD.exe PrefDat 11036 +9 TCacheNode.Execute
00d9dd37 +035f cMUD.exe PrefDat 9456 +61 PrefRec.InternalExecute
00d9df9f +001f cMUD.exe PrefDat 9514 +2 PrefRec.Execute
00cdc0f3 +0153 cMUD.exe MAIN 6594 +14 TMUDForm.ExecThread
00cdc431 +0015 cMUD.exe MAIN 6655 +1 TMUDForm.ExecThread
00ce2ebc +03cc cMUD.exe MAIN 8973 +51 TMUDForm.RaiseEvent
00ce3012 +005a cMUD.exe MAIN 8991 +1 TMUDForm.RaiseEvent
00ce66f7 +044f cMUD.exe MAIN 10273 +77 TMUDForm.MUDSockConnect
009b7679 +01bd cMUD.exe zsock 676 +41 TClientSocket.DoConnect
009b7496 +002a cMUD.exe zsock 615 +3 TClientSocket.OnSockMsg
009b7259 +0041 cMUD.exe zsock 554 +4 TClientSocket.WndProc
0047d4ac +0014 cMUD.exe Classes StdWndProc
7e4196c2 +000a USER32.dll DispatchMessageA
004aa7f4 +00fc cMUD.exe Forms TApplication.ProcessMessage
004aa82e +000a cMUD.exe Forms TApplication.HandleMessage
004aab23 +00b3 cMUD.exe Forms TApplication.Run
00e49ab0 +0088 cMUD.exe CMUD 372 +20 initialization
7c912c21 +0069 ntdll.dll RtlUnicodeStringToAnsiString

error details:
Clicked Reconnect


I can send you my package if you want because I have no idea how to recreate it when I can't even open Cmud and I have functions and expression triggers and all sorts of stuff executing upon loading for absolutely no reason. One thing I did notice though is that expression triggers are firing when variables are set to default upon opening Cmud and that shouldn't really happen?
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Aug 16, 2010 4:36 pm   
 
Looking at your crash dump, it looks like you have an OnConnect event that is firing and then trying to send something to the MUD that is firing an #ONINPUT command trigger.

Try opening Offline and turning on the Script Debugger and then connecting to see exactly what is executing. My guess is that you have a bad trigger pattern somewhere.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Aug 18, 2010 12:02 am   
 
Yes I have a #send in an onConnect to disable a setting. However, it doesn't send anything to the mud. I disable the setting when connecting so my vaulting doesn't fire when I start getting prompts. I guess I should really change it so it disables when I disconnect so it is disabled when I connect the next time, but that really wouldn't matter would it? Anyway, the following is the entire onConnect.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <event event="onConnect" priority="17430" copy="yes">
    <value>#send "vaultoff"
#T+ checkPassword
pause
$filename = %concat( %char, %time( mmddyyhhnn))
#log $filename</value>
    <notes>This event fires upon connecting and will automatically start logging the session. The format for file name is "charactername + date"</notes>
  </event>
</cmud>


So basically all the happens here is it turns off vaulting. It enables a trigger that fires when password is accepted, which only prints a reminder that I have paused my settings and stuff and disables itself. Then an alias that changes a variable paused to true. Finally, it starts logging. That's it. It has nothing to do with a trigger pattern.

In fact the following functions started firing after reimporting the XML.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <func name="FireForge" copy="yes">
    <value><![CDATA[#if (@selfishness) {
  #print ""
  #print {<color khaki maroon><strong>It appears you have selfishness up. Please drop selfishness before continuing.</strong></color>}
  #T+ forgeSelfishCheck
  } {
  #if (@mounted) {
    #print ""
    #print {<color khaki maroon><strong>It appears you are still mounted. Please dismount before continuing.</strong></color>}
    #T+ forgeMountedCheck
    } {
    #print ""
    #print {<color khaki><strong>Thank you. Forging will now commence.</strong></color>}
    #call @SendImmediate("outr 1 coal")
    #call @SendImmediate("put coal in forge")
    #call @SendImmediate("fire forge")
    #T+ ForgeTimer
    }
  }]]></value>
  </func>
</cmud>


It displayed the Thank you line a couple of times. The only thing I can figure is that I used an expression trigger "forgeMountedCheck" to work with this that disables itself. Basically when I dismount it calls the FireForge function again.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger name="forgeMountedCheck" type="Expression" priority="17930" trigontrig="false" newline="false" enabled="false" copy="yes">
    <pattern>!@mounted</pattern>
    <value>#T- forgeMountedCheck
#call @FireForge()</value>
  </trigger>
</cmud>


Maybe when I export all the disabled settings are not being marked as disabled and everything is basically enabled upon reimporting? That's the only way this would have executed because the forgeMountedCheck trigger isn't enabled unless I am mounted and the FireForge function isn't even called originally unless I enter an alias that starts forging. I also checked the XML file and it shows the trigger as being disabled...so how the heck did that function get called by just loading the session?
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Aug 18, 2010 4:38 pm   
 
Code:
#send "vaultoff"

That is the line that is triggering a Command Input trigger (#ONINPUT) somewhere. So post the XML code for that trigger that is firing.

Also, why would you use #SEND to fire a Command Trigger instead of just creating an alias and calling the alias in both the OnConnect event as well as in the Command Trigger?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Aug 19, 2010 7:33 am   
 
Here it is. I'm not sure why I would create an extra alias.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger type="Command Input" priority="18600" regex="true" copy="yes">
    <pattern>^vaulto(n|ff)$</pattern>
    <value>#noinput
$a = %1
#if ($a == "n") {
  auto.vault = 1
  #call @PrintEnable("Auto Vault")
  } {
  auto.vault = 0
  #call @PrintDisable("Auto Vault")
  }</value>
  </trigger>
</cmud>
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Aug 19, 2010 7:39 am   
 
Also the reason I use the #send in the onConnect is so I also get the print message. Otherwise I would just set the value of the variable straight in the script.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Aug 19, 2010 12:52 pm   
 
I believe Zugg's question was, why don't you make "vaulton" and "vaultoff" into aliases? Especially since you are doing completely different things in your oninput trigger depending on whether it is "vaulton" and "vaultoff"? There's no obvious reason to use an oninput trigger for this.

It looks to me like we will now need the code for PrintDisable.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Aug 19, 2010 5:03 pm   
 
Yep, as Rahab mentioned, now we need @PrintDisable. We need to see all of the code that CMUD is executing as a result of your OnConnect trigger.

Also, the reason to use an alias instead of a Command Input trigger is speed and complexity. Using #SEND to fire a Command Input trigger, which then uses #noinput to prevent output is much much slower than just calling an alias in the first place. You'll have much more stable and supportable code by breaking it into pieces. You'd do this:
Code:
  <event event="onConnect" priority="17430" id="2">
    <value>vaultoff
#T+ checkPassword
pause
$filename = %concat( %char, %time( mmddyyhhnn))
#log $filename</value>
    <notes>This event fires upon connecting and will automatically start logging the session. The format for file name is "charactername + date"</notes>
  </event>

  <alias name="vaulton" id="3">
    <value>auto.vault = 1
#call @PrintEnable("Auto Vault")
</value>
  </alias>

  <alias name="vaultoff" id="4">
    <value>auto.vault = 0
#call @PrintDisable("Auto Vault")
</value>
  </alias>


Keep in mind when you create a Command Input trigger that it is firing for every command you send to the MUD, and every use of the #SEND command. Doing the pattern matching on the Command Input trigger is much slower than doing a direct alias lookup and call.

If you want to get a print message, then add that to your "vaulton" or "vaultoff" alias. Or add it to your @PrintEnable function.

Finally, why is @PrintEnable a function instead of just another alias? It doesn't look like it is returning a value unless you are using it elsewhere in your scripts. If @PrintEnable doesn't return a value, then it's faster to use an alias instead of a function. Unless you just don't want this alias to be active on the command line, which is a possible reason.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Aug 19, 2010 10:16 pm   
 
Well first of all, I am not sure how creating tons of aliases could be better than just a few command input matches. I can replace like 50 aliases by just using a few command input triggers. Also the reason I use functions for the printing is because I don't ever need to enter those on the command line and they are only ever called from code. I thought we went over this a long time ago that if you have a lot of aliases it would make things slower?

For example, I can replace a ton of aliases with this single command input trigger
Code:
^p(abs|ban|c(?:lean|con)|d[ae]m|en|heal|[ip]|piety|rev|truth|ur|w(?:ard|ell))$
All of these relate to a single skillset. Secondly, anything I don't want to go through matching I use #sendraw so it's not a problem. In fact everything I send to the MUD uses #sendraw. So I am not sure what the big deal is?

The printing functions are just for various colors. It saves having to rewrite the same code over and over.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <func name="PrintEnable" copy="yes">
    <value>#print {<font 'Lithos Pro Regular' 11 khaki darkgreen> $msg ON </font>}</value>
    <arglist>$msg</arglist>
  </func>
</cmud>


Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <func name="PrintDisable" copy="yes">
    <value>#print {<font 'Lithos Pro Regular' 11 khaki maroon> $msg OFF </font>}</value>
    <arglist>$msg</arglist>
  </func>
</cmud>
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Aug 19, 2010 10:30 pm   
 
Having lots of aliases does *not* make it slower. That was fixed long ago. Aliases are a fast hash-table lookup. Command Inputs are a slower regular expression pattern match.
Quote:
So I am not sure what the big deal is?

It's not a "big" deal. I'm just trying to help. Your solution *is* slower and is harder to support. If you can read your long Command Input regular expression and ensure that it always matches exactly what you want, then that's fine. But that is beyond what most users will want to deal with. We all know how easy it is to make a mistake in a RegEx pattern. Having simple aliases that perform simple functions will make your code more supportable over a longer time.

I'm just trying to pass on some pointers learned from many years of programming. It's like C programmers who try to stuff as much functionality into a single line of code. Yes, you can do it, but it makes the code harder to understand and support years later when you've forgotten exactly what you are doing.

In that "single command input trigger" that you mentioned above, my guess is that the code is full of #IF statements to determine what command you have entered, and doing all of that string testing is just a LOT less efficient than just creating a bunch of simple aliases.

But do whatever you want, I'm just trying to help you improve your code so it will work better and so other people can understand it better.

Back to the original topic: Using your OnConnect script, and your Command Input Script and your PrintDisable function, I am unable to reproduce the crash. So I'm not sure what else to suggest.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Aug 19, 2010 10:46 pm   
 
I know. Smile Like I said I can send you the XML file and I can also reproduce it. It happens when I export to XML and reimport. It's like everything marked enable = "false" is not disabled upon reimporting. I just created another test package and imported the XML then loaded it to a Test session and opened offline and the same exact thing happened. I started seeing forging messages and messages that should never be printing because those items were disabled. In fact one of the messages that just printed was an alarm that was disabled. So the only way that message could have printed was that alarm was enabled upon reimporting and then counted down and fired the print message when I loaded the session.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Aug 19, 2010 11:35 pm   
 
Well I tried this twice. Both times it just crashes Cmud with an Out of Memory error.

It printed this to the screen:

All forging jobs complete!

Thank you. Forging will now commence.

Auto Vault OFF
Target rebounding coming up!



Here is the alarm that printed the message to screen and the trigger that enables it after I reimported the XML and loaded the test session.

Code:
<trigger name="targSmoked" priority="15910" case="true" regex="true">
        <pattern>^@target takes a long drag off h[ie][sr]\W+(?>\w+\W+)*?pipe\.$</pattern>
        <value><![CDATA[#call @SubTargetAction("Target Smoked Pipe")
#if (!@tsRebounding && !@tsHellsight && !@tsSlickness && !@tsDisloyal) {
  #T+ TargetAura
  } {
  #switch (@tsHellsight) {tsHellsight = 0}
    (@tsSlickness) {tsSlickness = 0}
    (@tsDisloyal) {tsDisloyal = 0}   
  }]]></value>
      </trigger>
      <trigger name="TargetAura" type="Alarm" priority="15940" newline="false" enabled="false">
        <pattern>*7.5</pattern>
        <value>#T- TargetAura
#print "Target rebounding coming up!"
tsRebounding = 1</value>
        <notes>Used to track when targets aura of rebounding will come up.</notes>
      </trigger>


It shows that it is disabled in the XML. Yet it printed its message when I just loaded the session and there is no way that trigger should have fired. Like I said before it's like all the triggers and functions are firing off/executing and everything is enabling for no reason. I even reinstalled Cmud. So I don't understand how it is possibly doing this! It just pegs out the memory and crashes.

Here is the bug report from this time.

date/time : 2010-08-19, 18:28:52, 949ms
operating system : Windows XP Service Pack 3 build 2600
system language : English
system up time : 3 days 19 hours
program up time : 1 minute 40 seconds
processor : AMD Athlon(tm) 64 Processor 3800+
physical memory : 4/2047 MB (free/total)
free disk space : (C:) 120.74 GB
display mode : 1440x900, 32 bit
process id : $ab4
allocated memory : 1.74 GB
executable : cMUD.exe
exec. date/time : 2010-07-30 11:48
version : 3.22.1.1
compiled with : BCB 2006/07
madExcept version : 3.0k
callstack crc : $8d6433e1, $ea85585d, $ea85585d
exception number : 1
exception class : EOutOfMemory
exception message : Out of memory.

Main ($540):
0047394a +04e cMUD.exe Classes TMemoryStream.Realloc
004738b5 +00d cMUD.exe Classes TMemoryStream.SetCapacity
004739a7 +02b cMUD.exe Classes TMemoryStream.Write
004732d1 +015 cMUD.exe Classes TStream.WriteBuffer
0048cfeb +24f cMUD.exe Graphics TBitmap.WriteStream
0048d0ae +002 cMUD.exe Graphics TBitmap.SaveToStream
0048b714 +01c cMUD.exe Graphics TBitmap.Dormant
0075303a +09e cMUD.exe explbtn 708 +12 TExplorerButton.BitmapChange
00487feb +013 cMUD.exe Graphics TGraphic.Changed
0048b6f0 +004 cMUD.exe Graphics TBitmap.Changed
0048b5f0 +0e4 cMUD.exe Graphics TBitmap.Assign
00755124 +038 cMUD.exe explbtn 1567 +5 TExplorerButton.SetBitmap
00cecd0e +086 cMUD.exe MAIN 12690 +4 UpdateItem
00cecec6 +0ce cMUD.exe MAIN 12719 +9 TMUDForm.DoUpdateIcons
00d1dc41 +009 cMUD.exe MAIN 23668 +1 TMUDForm.wmUpdateIcons
004bc11b +2bb cMUD.exe Controls TControl.WndProc
004c011f +4fb cMUD.exe Controls TWinControl.WndProc
004a267f +553 cMUD.exe Forms TCustomForm.WndProc
004bf848 +02c cMUD.exe Controls TWinControl.MainWndProc
0047d4ac +014 cMUD.exe Classes StdWndProc
7e4196c2 +00a USER32.dll DispatchMessageA
004aa7f4 +0fc cMUD.exe Forms TApplication.ProcessMessage
004aa82e +00a cMUD.exe Forms TApplication.HandleMessage
004aab23 +0b3 cMUD.exe Forms TApplication.Run
00e49ab0 +088 cMUD.exe CMUD 372 +20 initialization
7c912c21 +069 ntdll.dll RtlUnicodeStringToAnsiString

error details:
Imported XML file to a Test package, set the toolbars to the correct locations, then loaded the Test package to a Test session and opened the Test session offline.
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Aug 20, 2010 4:44 pm   
 
Quote:
It's like everything marked enable = "false" is not disabled upon reimporting.

Yes, that is a known bug in 3.22 that was reported in another post. It's already fixed for the next version, so you might just want to wait till next week on that. I hope to have 3.23 for next Friday. There isn't any workaround to the "enabled=false" XML import bug in 3.22, sorry.
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