Author Topic: [v1.6.1.20] Long dynamic command names freeze VoiceAttack  (Read 3686 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
[v1.6.1.20] Long dynamic command names freeze VoiceAttack
« on: January 14, 2017, 03:57:51 PM »
Reported for v1.6.1.20 as it still occurs, but it happened as far back as v1.5.12.

With the following command name, VoiceAttack "freezes" while taking up more than a core's worth of CPU time and an increasing amount of memory. It's possible that when left running it'd eventually finish or outright crash, but the fact that it freezes is enough for me:
Quote
long dynamic number [1..2147483647]
You may note that this is the exact upper limit of an Int32. This is important because the following does not produce the same result:
Quote
long dynamic number [1..21474836470]
While the number range is much larger, it doesn't freeze, but also doesn't produce any command variations to the speech engine(as far as I can tell by speaking "long dynamic number one" and such). I would speculate it fails silently instead of attempting to actually process the range.

What does cause a freeze is
Quote
long dynamic number [1..214748369,10]
If I understand correctly, the final variant would be "long dynamic number 2147483690", which falls out of the maximum range an Int32, so it should either fail or crash at the end.

Finally,
Quote
long dynamic number [1..10,214748369]
doesn't freeze, but doesn't appear to generate anything either(Unrecognized : 'long dynamic number 214,740,369').

At first I figured something went wrong with the normal "Dynamic Command Generation Warning" message about too many variants, but the message does appear with a smaller range like "[1..2147]", so it's the chicken and egg problem(egg came first, proto-chicken laid it, but that's beside the point) of needing to process the variants before knowing how many there will be.

I'd also like to note that there is no option to heed the warning and cancel the creation of the command, it can only be acknowledged by clicking "OK", after which the command will still be generated.


And yes,

It's an edge case, I know :P

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: [v1.6.1.20] Long dynamic command names freeze VoiceAttack
« Reply #1 on: January 14, 2017, 07:45:11 PM »
I've optimized the section where this is occurring.  In this case it will ultimately run out of memory when it grows too big, but at least it will get there quicker ;)  The only drawback for this is the warning message will be vague since I'm not wrapping everything in try/catch blocks for speed and it's not bubbling up.  To help a little with that, the final error message (out of memory, max integer exceeded, etc) will be pumped out to the log.  Edgy case ;)  As always, thanks for catching the loose ends :)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: [v1.6.1.20] Long dynamic command names freeze VoiceAttack
« Reply #2 on: January 21, 2017, 03:31:22 PM »
With v1.6.1.23, VoiceAttack now unfreezes and shows "The numeric range is too large to store in memory.  You must create a smaller range." in the log after a few seconds(According to task manager it occurs when memory usage exceeds approximately 1.5 GB).

However, sometimes this is accompanied by a popup message titled "Unexpected speech engine error.", with the important part stating "[Exception of type 'System.OutOfMemoryException' was thrown.]", though speech recognition and command execution keeps working afterwords.


Also, infinitesimally small thing, but there are two spaces between "The numeric range is too large to store in memory." and "You must create a smaller range.".

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: [v1.6.1.20] Long dynamic command names freeze VoiceAttack
« Reply #3 on: January 21, 2017, 09:56:15 PM »
I can't really put a hard cap on it... it's just going to run until it can't run any more.

Quote
Also, infinitesimally small thing, but there are two spaces between "The numeric range is too large to store in memory." and "You must create a smaller range.".

If that throws you off, you're really going to love the help doc ;)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: [v1.6.1.20] Long dynamic command names freeze VoiceAttack
« Reply #4 on: January 21, 2017, 11:25:49 PM »
If that throws you off, you're really going to love the help doc ;)