Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-27298

[GSS](7.4.z) UNDERTOW-2401 - Tags leak in WebInjectionContainer after exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.4.19.CR1, 7.4.19.GA
    • 7.4.17.GA
    • Undertow
    • None
    • False
    • None
    • False
    • +
    • Hide

      1. Deploy a basic app using a tag like the included kitchensink-jsp.war
      2. Use byteman to throw an exception from the tag if needed with the included rule, adding a JVM option like:

          -javaagent:<mypath>/lib/byteman.jar=script:<mypath>/UNDERTOW-2401.btm,sys:<mypath>/lib/byteman.jar
      

      3. Test simple load to a jsp with tag

        $ ab -c 100 -n 100000 http://localhost:8080/kitchensink-jsp/registrationResult.jsp
      

      4. Note the count of live tag instances in heap increase continually:

      $ jmap -histo:live $JBOSS_PID | grep OutTag
        11:        100000        4800000  org.apache.taglibs.standard.tag.rt.core.OutTag
      

      You can also note from the byteman tracing that release is never called. Or from the generated $EAP_HOME/standalone/tmp/org/apache/jsp/registrationResult_jsp.java file, note that there is no try/finally for the tag calls

      Show
      1. Deploy a basic app using a tag like the included kitchensink-jsp.war 2. Use byteman to throw an exception from the tag if needed with the included rule, adding a JVM option like: -javaagent:<mypath>/lib/byteman.jar=script:<mypath>/UNDERTOW-2401.btm,sys:<mypath>/lib/byteman.jar 3. Test simple load to a jsp with tag $ ab -c 100 -n 100000 http: //localhost:8080/kitchensink-jsp/registrationResult.jsp 4. Note the count of live tag instances in heap increase continually: $ jmap -histo:live $JBOSS_PID | grep OutTag 11: 100000 4800000 org.apache.taglibs.standard.tag.rt.core.OutTag You can also note from the byteman tracing that release is never called. Or from the generated $EAP_HOME/standalone/tmp/org/apache/jsp/registrationResult_jsp.java file, note that there is no try/finally for the tag calls

      org.apache.jasper.compiler.Generator compiles JSP classes without try/finallys wrapping the tag use. So if a tag throws an exception, release/destroy calls are skipped and the tag remains in the WebInjectionContainer to result in leaks over time.

      This was addressed in Tomcat jasper:
      https://github.com/apache/tomcat/commit/e7a1d655ed9f7d186f58dab655d0e120495db03e

      We have synced that to jastow master:
      https://github.com/undertow-io/jastow/commit/710a98fa56f2c2825d9f9abfa8ec2063af59fe64

      But need this fix on other branches.

              istudens@redhat.com Ivo Studensky
              rhn-support-aogburn Aaron Ogburn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: