You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2014/02/19 14:28:23 UTC

[Bug 56160] New: StackOverflowError when using WhileController within IfController

https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

            Bug ID: 56160
           Summary: StackOverflowError when using WhileController within
                    IfController
           Product: JMeter
           Version: 2.10
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: real_thuri@gmx.de

Created attachment 31332
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31332&action=edit
Testplan to reproduce

I got a Testplan that contains a WhileController below an IfController.
The condition of the IfController is false and the WhileController uses the
__javaScript function to evaluate the content of a variable.

If the variable is not set (for example because it's set below the IfController
before the WhileController) JMeter logs the line 

WARN  - jmeter.control.GenericController: StackOverflowError detected 

The Error doesn't bubble up but it slows down test execution.

Furthermore it's strange something below the IfController is executed/evaluated
even if the condition of the if is false.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Date: Sun Oct 12 15:30:39 2014
New Revision: 1631189

URL: http://svn.apache.org/r1631189
Log:
Bug 56160 - StackOverflowError when using WhileController within IfController
Bugzilla Id: 56160

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/GenericController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/IfController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContext.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestIfController.java
    jmeter/trunk/xdocs/changes.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

--- Comment #1 from real_thuri@gmx.de ---
After some debugging, the problem seems to be that the WhileController always
returns the one contained sampler on nextIsNull().
Therefore nextIsAController always returns the Sampler too and never null;
(Though nextIsAController can't ever return null but at the end of the
controller)

So because the WhileLoop never returns null reInitializeSubController will be
called recursivly until the SOE is thrown.

But the first thing is that the WhileController.next() shouldn't have been
called in the first place.

I'll try to create a patch and see what you think of it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Although summary of 52496 may not be clear, it is the exact duplicate, see bugs
already marked as duplicate

*** This bug has been marked as a duplicate of bug 52496 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
           Hardware|PC                          |All
                 OS|Windows XP                  |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

--- Comment #2 from real_thuri@gmx.de ---
Created attachment 31333
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31333&action=edit
Proposed Patch

Patch for IfController so that child elements are not "touched" if the
condition is false.
+ UnitTests

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

--- Comment #3 from real_thuri@gmx.de ---
The proposed patch makes the IfController return null if the condition is false
on the first invocation of it's next method.

This should prevent Jmeter to dive into the children of the IfController and
call their next method.
So child-controllers which always return an element and never null (e.g.
WhileController with condition that is always true) won't result in a
StackOverflow.

The issue may persist if the whileController is supposed to loop forever and
and the if controller's condition is true.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexander.hertlein@garmin.c
                   |                            |om

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
*** Bug 52618 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

--- Comment #5 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
*** Bug 52496 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |g.szczutkowski@gmail.com

--- Comment #6 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
*** Bug 53768 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56160] StackOverflowError when using WhileController within IfController

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |---

-- 
You are receiving this mail because:
You are the assignee for the bug.