|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Jan 03, 2008 11:57 am
[2.20] *100% Reproducable* long CMUD hang/CPU spike when reformating script |
Create a new alias or trigger. In the action text put the following
Code: |
#SWITCH @blah
("char1") {
#SAY Test1
#SAY Test2
#SAY Test3
}
("char2") {
#SAY Test1
#SAY Test2
#SAY Test3
} |
The two extra spaces before Test1 and Test2 *do* matter!
Those extra spaces at the are what we expect the reformatter to remove to bring it in line with Test3.
Open Task Manager and watch CMUD.exe usage...
Then reformat the script with Ctrl-M.
For ~10 seconds CMUD will hang and you'll see CMUD.exe spike around 100%, then it'll reformat correctly and everything will be back to normal.
Can anyone verify this? Might be related to the other settings editor hangs people are seeing? |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Last edited by Guinn on Sat Mar 15, 2008 2:39 pm; edited 2 times in total |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Thu Jan 03, 2008 1:14 pm |
I did not notice any spikes in task manager, as well as in another process controlling utility, everything looks fine for me. WinXP.
|
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Thu Jan 03, 2008 1:44 pm |
I tried on Vista, and got this as a reformat:
Code: |
#SWITCH @blah
("char1") {
{
#SAY Test1
#SAY Test2
#SAY Test3
}
("char2") {
{
#SAY Test1
#SAY Test2
#SAY Test3
} |
Which looks correct. It also didn't take very long, maybe .5 sec at the most (I didn't have the debugger open so I couldnt tell exatly how long). |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Jan 03, 2008 5:01 pm |
That's wrong, jed - it's actually created unmatched braces there. I get the same thing.
So there's definitely a bug with the reformatter here, I just dunno if it's causing a hang. It didn't for me, it reformatted instantly. |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Thu Jan 03, 2008 7:00 pm |
I've been dealing with this for a while too, I'm glad you were able to reproduce it. Perhaps we are a step closer to it being fixed now.
|
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Thu Jan 03, 2008 10:18 pm |
After reading your posts I tried Guinn example once more. Again, CMUD reformatted sample script instantly, but I can't see any unmatched braces. Here is what exactly I have after pressing Ctrl+M under WinXP:
Code: |
#SWITCH @blah
("char1") {
#SAY Test1
#SAY Test2
#SAY Test3
}
("char2") {
#SAY Test1
#SAY Test2
#SAY Test3
} |
I dunno where you've got those extra braces. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Jan 03, 2008 10:34 pm |
Yeah, I tried again after you said that it worked, and it worked for me too. Odd thing is I'd actually cut down that example from a larger one (a #SWITCH with 6 conditions each doing 5-7 class on/off toggles) and I tested the code I posted maybe half a dozen times to be absolutely sure the CPU spike was at just that time.
I'll see if I can figure what caused it to go odd... |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Jan 10, 2008 6:39 pm |
bump...
This is definitely reproducable, just not every time.
I tried it again with the following
Code: |
#SWITCH @blah
("char1") {
#SAY Test1
#SAY Test2
#SAY Test3
}
("char2") {
#SAY Test1
#SAY Test2
#SAY Test3
} |
and it was fine
then I changed the spaces a bit to
Code: |
#SWITCH @blah
("char1") {
#SAY Test1
#SAY Test2
#SAY Test3
}
("char2") {
#SAY Test1
#SAY Test2
#SAY Test3
} |
and it hung for 15 seconds again when pressing Ctrl-M
Could someone try putting the text in, reformatting, then if it works put a few spaces in one of the other lines, reformat. You should see a spike fairly soon and once it's happened once it keeps on happening until you restart cmud. |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Thu Jan 10, 2008 7:11 pm |
I can confirm this produces the spike for me, but I need to have the "#say Test2" indented 2 spaces past the others for it to work for me. Others may need to play around with the spaces just a bit to get this to work for them. I can get it to spike again and again by reinserting the spaces and doing it again.
This is such an annoying problem. Thanks for finding one that is reproducible.
Code: |
#SWITCH @blah
("char1") {
#SAY Test1
#SAY Test2
#SAY Test3
}
("char2") {
#SAY Test1
#SAY Test2
#SAY Test3
} |
|
|
Last edited by ReedN on Thu Jan 10, 2008 7:12 pm; edited 1 time in total |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Thu Jan 10, 2008 7:11 pm |
I see what you are talking about. It took no less than 20 tries for me though. CMUD utilized 50% CPU (i.e. 100% for 1 core) for about 4-5 seconds (very approximate values from task manager - 5% on 1st second, 25% on 2nd second, 45% on 3rd, 50% on 4th...)
|
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Jan 10, 2008 9:21 pm |
If it took 20 tries, then it's possible that you just happened to do the Reformat at the same time that the background database update was happening. That could certainly cause a spike since database access is blocked while it's writing to the disk file. So far I haven't gotten the spike myself yet.
|
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Thu Jan 10, 2008 9:37 pm |
It was repeatable for me every time I added two spaces and performed a reformat.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Jan 10, 2008 11:43 pm |
It's definitely repeatable Zugg.
After it's spiked once it spikes every time (until you restart CMUD) so something is getting tripped up and staying tripped. |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Jan 15, 2008 10:08 pm |
Got it nailed down at last. It's weird.
It's completely reproducable on my system - it's all in the timing.
Enter the following at the command line
Code: |
#alias test {#SWITCH @blah
(1) {
#SAY Test1
#SAY Test2
}
(2) {
#SAY Test3
#SAY Test4
}
} |
Now, go into the settings editor and click into the alias. Notice that the (1) and (2) are highlighted because they're recognised as being integers.
Next, go to the start of the #SAY Test1 line.
Keep watching the highlighting of the numbers.
Press space once at the start of the line to put #SAY Test1 out of line with the rest
Notice that the moment you press space then (1) loses its colour. A second or two later (2) loses the colour too.
Also, the code folding +/- disappears when the numbers change colour. What appears to be happening is that putting the extra space in is making the settings editor lose the syntax. I guess this makes some sense, but here's the kicker...
If you wait until both (1) and (2) have gone black then you can reformat instantly using Ctrl-M
If you reformat before (2) has gone black then CMUD hangs for 5-10 seconds.
As mentioned previously, once it's hung the first time it's like something breaks inside CMUD, because the syntax highlighting doesn't work anymore.
Anyone able to confirm? |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Jan 15, 2008 10:47 pm |
Indeed I can. Nice catch.
|
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Tue Jan 15, 2008 10:57 pm |
Very nice debugging indeed. I can't imagine how long you've been staring at this trying to replicate it. I can see now how those that don't do a lot of reformatting would never catch this as they take too long selecting it from the menu. But those like myself who use it a ton and use the keyboard short-cut would start running into this if we hit the ctrl-m before the period of time elapsed.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Jan 15, 2008 11:24 pm |
I was trying to duplicate it on my laptop. So I had the desktop and laptop doing exactly the same thing and it wasn't happening. Then I'd do it just on the desktop and it'd happen. So eventually figured it was because I was going through each step slowly when using both, but going quickly when only using one. So blind luck really ;)
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jan 15, 2008 11:26 pm |
I'll take a look at this to see if I can also reproduce it. The numbers are going black because your edit is causing an error in the background parsing that is controlling the color highlighting. But I'm not sure how that would relate to the long delay.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sun Feb 10, 2008 8:30 pm |
Wondering if you ever managed to reproduce this Zugg?
Also bumping my posts to the magic 1000. 998 now, just two other silly comments to make then I can retire from the forums :D |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Feb 11, 2008 6:00 pm |
Sorry, but I'm not currently doing bug fixes. I'm still doing the Delphi 2007 conversion and working on the TreeView in the settings editor. So no, I still haven't tried to reproduce this one, sorry.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sat Mar 15, 2008 2:39 pm |
Still exists in 2.20
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Sat Mar 15, 2008 3:05 pm |
I've gotten really good at reproducing this one as I have to try to consciously avoid doing a ctrl-m too fast after doing an edit. If the text I'm working on is too big and it doesn't finish it's hilighting before I hit the ctrl-m then it hangs for ~15 seconds. I try to give it extra time based on how complex the trigger is, but sometimes I hit it too fast and it hangs.
I think the easiest way to reproduce this would be to dig up a very complex hilighting wise trigger and then edit the text and do a reformat right after that by using the quick ctrl-m key sequence. It's a bit of a timing issue to get it in there but if you dug up a complex trigger it should be fairly easy to do. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Mar 17, 2008 5:17 pm |
This is still on my bug list and nothing that I changed in 2.20 would have fixed this.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Apr 29, 2008 11:27 pm |
Bumping for 2.23 as it's pretty annoying
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Wed Apr 30, 2008 12:57 am |
Guinn is time travelling again, how he gets hold of these versions before Zugg actually releases them is anybodies guess. We should probably rename him Dr. Who!!
|
|
_________________ Taz :) |
|
|
|
|
|