Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-4
    • Component/s: core / taglib.core
    • Labels:
      None

      Description

      Assume you have a jelly tag <j:jelly> with children. The following sequence leads to concurrency problems:

      1. Instance 1 of Tag is created on thread 1. Body is ScriptBlock
      2. Instance 2 of Tag is created on thread 2. Body is same ScriptBlock as Instance 1.
      3. doTag -> invokeBody -> getBody -> trimBody is called for Instance 1
      4. same for instance 2
      5. Instance 1 gets the size of the ScriptBlock
      6. Instance 2 gets the size of the ScriptBlock
      7. Instance 1 trims whitespace blocks
      8. Instance 2 gets an IndexOutOfBounds exception since it resumes execution with an incorrect list size (list was changed by Instance 1).

      Both threads concurrently trim the same ScriptBody (the hasTrimmed variable is instance-specific). The attached patch synchronizes access to the body within trimBody.

        Attachments

        1. TagSupportPatch.txt
          10 kB
          Gary Franklin
        2. TagSupport.java
          11 kB
          Gary Franklin

          Activity

            People

            • Assignee:
              diongillard dion gillard
              Reporter:
              gsfranklin Gary Franklin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: