Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5009

EmptyStackException in JSON plugin due to concurrency

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.5.20
    • 2.5.22, 6.0.0
    • Plugin - JSON
    • JDK 1.8_0_191

      Tomcat 9.0.12

    Description

      EmptyStackException in JSON plugin due to concurrency

      Note: The issue was found in an app that was upgraded from version 2.3.34 

      Logs: logs.txt

      I created a sample application that should help reproducing the error.

      struts-json-example-master.zip

      The error happened opening the app (localhost/struts-json-example) in 4 different browsers / sessions.

      As a workaround I have overridden the JSONInterceptor so a new instance of JSONUtil is used with every request and the issue is not happening anymore. I suppose there is a performance cost with that change but for now it works.

       

      Attachments

        1. struts-json-example-master.zip
          13 kB
          Eduardo Quintanilla
        2. logs-test-fix.log
          8 kB
          Eduardo Quintanilla
        3. logs.txt
          34 kB
          Eduardo Quintanilla

        Issue Links

          Activity

            People

              aleksandr-m Aleksandr Mashchenko
              Eduardo Quintanilla Eduardo Quintanilla
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: