OpenViBE Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000066openvibe-pluginsbug reportpublic2010-11-23 15:332013-11-08 15:44
Reporterlbonnet 
Assigned Tojtlindgr 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformx86OSWindows SevenOS Version64b
Summary0000066: Simple DSP freezing with a "large" equation
DescriptionThe equation tested is precisely:
(3*sin(2*m_pi*x)) * (3*sin(2*m_pi*x))

A message is printed in the console:
[ TRACE ] At time 0 (0x0)<Box algorithm::Simple DSP> Parsing equation [(3*sin(2*M_PI*x))*(3*sin(2*M_PI*x))]...

And then it just freezes (I waited about 1 minute before hard-stop).

When trying the equation (which is the same without unnecessary parenthesis):
3*sin(2*M_PI*x)*3*sin(2*M_PI*x)

it works fine, I just have to wait few seconds.
Steps To ReproduceTime signal + DSP with the equation, then signal display.
Additional Informationsample scenario provided
TagsNo tags attached.
Attached Filesxml file icon test.xml [^] (28,476 bytes) 2010-11-23 15:33

- Relationships

-  Notes
(0001062)
jtlindgr (administrator)
2013-01-21 16:56

Parsing the expression seems to lead to a hopelessly long recursive expansion inside boost. If we don't expect a bug in boost, I suspect there could be something fishy in the grammar specified in ovpCEquationParserGrammar.h. If rules for fun(expression) and (expression) are added to it, the example seems to work reasonably, but not being a grammar guru, I have no idea if this totally ruins the parsing for some other cases.

The modded rules,

            function =
                (root_node_d[as_lower_d[unaryFunction_p]] >> no_node_d[ch_p('(')] >> expression >> no_node_d[ch_p(')')]) |
                (root_node_d[as_lower_d[unaryFunction_p]] >> no_node_d[ch_p('(')] >> ifthen >> no_node_d[ch_p(')')]) |
                (root_node_d[as_lower_d[binaryFunction_p]] >> no_node_d[ch_p('(')] >> infix_node_d[(ifthen >> ',' >> ifthen)] >> no_node_d[ch_p(')')]);

            factor = (function | constant | variable | real)
                | inner_node_d['(' >> expression >> ')']
                | inner_node_d['(' >> ifthen >> ')']
                | (root_node_d[ch_p('-')] >> factor)
                | (root_node_d[ch_p('+')] >> factor);
(0001120)
jtlindgr (administrator)
2013-11-08 15:44

After some testing, it appeared that adding

  inner_node_d['(' >> expression >> ')']

as a component of factor sufficed to address the issue. I also saw the same solution in some other parsers on the net. Preliminary tests did not indicate the mod to cause other problems, but it is challenging to test conclusively.

Fixed in git #b98c1ebdc37568e5a7cd6b032785e247b261e779

- Issue History
Date Modified Username Field Change
2010-11-23 15:33 lbonnet New Issue
2010-11-23 15:33 lbonnet File Added: test.xml
2013-01-21 16:56 jtlindgr Note Added: 0001062
2013-02-19 10:30 jtlindgr Status new => acknowledged
2013-02-19 10:31 jtlindgr Assigned To => jtlindgr
2013-02-19 10:31 jtlindgr Status acknowledged => assigned
2013-02-19 10:31 jtlindgr Status assigned => confirmed
2013-11-08 15:44 jtlindgr Note Added: 0001120
2013-11-08 15:44 jtlindgr Status confirmed => resolved
2013-11-08 15:44 jtlindgr Resolution open => fixed


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker