JBehave
  1. JBehave
  2. JBEHAVE-290

Stack Overflow when parsing a scenario with a very long step

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.5.7, 3.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      A StackOverflowError occurs when the PatternScenarioParser parses a very long step in a scenario. This happened to us when writing a Given step that included a long table parameter.

      This seems to be caused by the well-known regex bug in Java (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337993). The patternToPullOutSteps method specifies a pattern that contains an alternative wrapped in a star, specifically "(.|
      s)*".

      We were able to use the same strategy as that used to fix JBEHAVE-242.

      One note about the included patch: the test we've added to PatternScenarioParserBehaviour, shouldParseStoryWithVeryLongStep, can sometimes pass incorrectly depending on the order in which the tests from that class are run. If shouldParseLongStoryWithKeywordSplitScenarios runs first, our test passes even without the fix applied. We weren't sure what to do about this, but on our machine the tests reliably ran in the order in which they were defined, so we just kept that one higher up in the file. Possibly there are deeper issues to consider here.

      --Moss Collum and Jim Olsen

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 2.5.7 [ 16500 ]
        Fix Version/s 3.0 [ 16302 ]
        Component/s Core [ 11086 ]
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mauro Talevi added a comment -

        Thanks for the patch. Applied, tested and released in 2.5.7.

        Show
        Mauro Talevi added a comment - Thanks for the patch. Applied, tested and released in 2.5.7.

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Moss Collum
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: