|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Sep 28, 2007 10:24 pm
[2.04] Alarm misbehavior |
Starting from a fresh install and a blank session I did this at the command line
Code: |
#LOOP 100 {#ALARM {+1} {#LOOP 10000 {#ADD a 1};#SHOW @a}} |
This resulted in a few different bugs being found.
1. Each of those alarms waits for the previous one to finish before its time is considered. This means that one fires each second.
2. Pressing ESC at the right time once they are going causes erronius outputs of '10000'
3. Turning off triggers with the gun icon seems to stop the alarm madness, but when triggers are turned back on the alarms no longer exist.
4. Opening the Package Editor during the alarms produced a rather nasty crash for me. I am still trying to get a bug report made for it, but my last attempt failed to save it. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Sep 28, 2007 10:39 pm |
Still working on getting a crash dump procedure for item 4. I ran into a nice hangup in the attempt.
The procedure to produce a hangup is
1. Launch CMud
2. Close the Sessions window
3 Enter the command to create the alarms from above at the command line.
4 After the first 10000 is displayed press CTRL-G to open the package editor.
Once the lockup occurs it stays in a continuous hourglass state. The CMud process was pegging my processor and I gave it about 5 minutes to see if it would do anything. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Sep 28, 2007 11:20 pm |
I was able to get to get a crash report, but it may be erronius. The procedure to reliably produce a crash is the same as above for a lock up with one extra step. The extra step is the tricky part though, since pressing ESC cancles the crash report and continues the program. I have seen a few different crash error because of not catching the first one.
The procedure to produce a crash is
1. Launch CMud
2. Close the Sessions window
3. Enter the command to create the alarms from above at the command line.
4. After the first 10000 is displayed press CTRL-G to open the package editor.
5. Once the Package Editor hangs in its display press ESC repeatedly until crash.
This is the crash I got when I was able to catch the first crash. Second and 3rd crashes continuing the procedure had a wide variety of causes.
Code: |
date/time : 2007-09-28, 19:33:29, 324ms
operating system : Windows XP Service Pack 2 build 2600
system language : English
system up time : 10 days 12 hours
program up time : 1 minute 12 seconds
processor : AMD Athlon(tm) Processor
physical memory : 96/383 MB (free/total)
free disk space : (C:) 14.19 GB
display mode : 1024x768, 32 bit
process id : $978
allocated memory : 26.36 MB
executable : cMUD.exe
exec. date/time : 2007-09-28 15:38
version : 2.4.0.0
madExcept version : 3.0b
callstack crc : $ffc2d507, $ba9aa9bb, $ba9aa9bb
count : 3
exception number : 1
exception class : EAccessViolation
exception message : Access violation at address 00C28371 in module 'cMUD.exe'. Read of address 00000370.
Main ($f64):
00c28371 +381 cMUD.exe PkgMain 3020 +63 TPkgMainF.ShowPage
00c9d937 +13b cMUD.exe MAIN 9316 +21 TMUDForm.DoSetting
00c5c23f +023 cMUD.exe PARENT 9697 +1 TParentForm.cmdClassesExecute
0047ef9d +01d cMUD.exe Classes 10464 +3 TBasicAction.Execute
0051438f +03f cMUD.exe ActnList 375 +1 TContainedAction.Execute
005155fb +077 cMUD.exe ActnList 961 +7 TCustomAction.Execute
005156e1 +011 cMUD.exe ActnList 985 +1 TCustomAction.HandleShortCut
0051486e +0aa cMUD.exe ActnList 510 +11 TCustomActionList.IsShortCut
0052b1b6 +04e cMUD.exe Forms 4995 +3 DispatchShortCut
0052b247 +06f cMUD.exe Forms 5006 +3 TCustomForm.IsShortCut
0052ed81 +065 cMUD.exe Forms 6853 +3 TApplication.IsShortCut
0052e4c5 +4b1 cMUD.exe Forms 6620 +93 TApplication.WndProc
0047fef8 +014 cMUD.exe Classes 10966 +8 StdWndProc
7c90eae0 +010 ntdll.dll KiUserCallbackDispatcher
77d4e2f2 +044 USER32.dll SendMessageA
0050045f +033 cMUD.exe Controls 1816 +2 SendAppMessage
0050c2d4 +09c cMUD.exe Controls 7446 +16 TWinControl.IsMenuKey
0050c317 +02b cMUD.exe Controls 7458 +5 TWinControl.CNKeyDown
00505f93 +1df cMUD.exe Controls 4645 +53 TControl.WndProc
00509cc2 +18e cMUD.exe Controls 6342 +33 TWinControl.WndProc
00509894 +034 cMUD.exe Controls 6237 +3 TWinControl.MainWndProc
0047fef8 +014 cMUD.exe Classes 10966 +8 StdWndProc
7c90eae0 +010 ntdll.dll KiUserCallbackDispatcher
77d4e2f2 +044 USER32.dll SendMessageA
0052ec82 +0be cMUD.exe Forms 6831 +20 TApplication.IsKeyMsg
0052ee23 +087 cMUD.exe Forms 6869 +9 TApplication.ProcessMessage
0052ee8f +00f cMUD.exe Forms 6892 +1 TApplication.HandleMessage
0052f12a +0a6 cMUD.exe Forms 6976 +16 TApplication.Run
00db65c0 +088 cMUD.exe CMUD 343 +18 initialization
7c91312f +069 ntdll.dll RtlUnicodeStringToAnsiString
7c812907 +0b6 kernel32.dll GetVersionExA |
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Fri Sep 28, 2007 11:31 pm |
Check the bugreport.txt file in your CMUD folder - it may still get written to if you cancel the crash report dialog.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Sep 28, 2007 11:38 pm |
Well, that's definitely a good "horror test" for the threading system and the settings editor.
On (1), that is normal. Alarms do not create their own threads...they execute in the main thread. So the main thread is going to busy executing one alarm before it gets to the next one.
2) When you press ESC, the execution module is aborted. If anything is left on the runtime stack, it gets displayed on the screen (and probably sent to the MUD), since CMUD thinks that this was left on the stack by just putting "10000" on it's own line in the screen. For example, when you have an alias like this:
#ALIAS test {hello world}
it just puts "hello world" on the stack, and when the alias is done, anything left on the stack is sent to the MUD. So, my guess is that the 10000 from the #LOOP command argument is still on the stack somehow. I can look into trying to clear the stack when ESC is detected.
Good catch on the settings editor hang. I didn't work on the settings editor hang bug in 2.04 yet (I was focused more on the other critical problems). But this might be a good way to reproduce it and get it fixed. I can imagine that this test causes all sorts of havoc since you have so much stuff changing in the background (@a being updated and lots of alarms firing).
This is just the kind of cruel and evil stuff that we need to do to CMUD to uncover some of these bugs. I try to do testing like this myself since it tends to bring out problems that you don't normally encounter with normal MUDding. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Oct 05, 2007 1:19 am |
Well, this is a real killer test. It's driving me insane. But it's been really good at tracking down various CriticalSection deadlocks. There were several problems here. Mainly, I had at least one typo where I was calling "Lock" instead of "UnLock" at the end of one routine (so now the CriticalSection was always locked). Also had some problems were I had created my own CriticalSections without fully realizing that they depended upon some other system sections, and there were some deadlock conditions.
In working on this, I have also changed alarms so that they actually run in their own thread instead of in the main thread. Otherwise, when you execute the above test, you end up flooding the main thread with the computation, and within #LOOP there is no Windows message processing. So, the TreeView doesn't get updated until all of the alarms are finished.
Once I changed the alarms to threads, then at least the TreeView would update. But it appeared hung because every background change to @a was causing the tree to update/refresh itself. I fixed this and then I was finally able to run this test. I am able to click on various alarms, and I can watch the alarms disappear from the list as they are executed. Of course, having 100 threads executing a script in the background makes the whole system incredibly slow (especially with all of my thread debugging that I currently have enabled). But I think it's finally working...or at least working much better. I'll probably test this a bit more tomorrow. Right now I'm fried. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri Oct 05, 2007 1:30 am |
I've noticed lately, then when i create an #ALARM with a #TRIGGER, more often then not it is formed outside of any module altogether (not even withing the main window), unless i specifically put it in a class.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Oct 05, 2007 5:59 am |
You should probably create a separate thread about that and give me the exact trigger that is creating the alarm. I haven't seen anything like this in my current testing. But it depends a lot upon the context that the trigger fires in.
|
|
|
|
|
|