Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite recursion when incompleteFallbackMessage is an object #3289

Closed
AdnoC opened this issue Nov 15, 2021 · 2 comments
Closed

Infinite recursion when incompleteFallbackMessage is an object #3289

AdnoC opened this issue Nov 15, 2021 · 2 comments
Labels
core Issues in the core code (lib/core) fix Bug fixes pr A pr has been created for the issue
Milestone

Comments

@AdnoC
Copy link
Contributor

AdnoC commented Nov 15, 2021

Product: axe-core

Expectation: axe.finishRun should handle data from axe.runPartial

Actual: Stack overflow occurs when processing results

Motivation: :(


axe-core version: 4.3.5

Browser and Assistive Technology versions
Chrome 95.0.4638.69

The following snippet is trimmed down output from axe.runPartial. When passed into axe.finishRun, axe gets stuck recursively calling processMessage until a stack overflow occurs.

   {
      "environmentData":{
         "testEngine":{
            "name":"axe-core",
            "version":"4.3.5"
         },
         "testEnvironment":{
            "orientationAngle":0,
            "orientationType":"landscape-primary",
            "userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",
            "windowHeight":857,
            "windowWidth":1200
         },
         "testRunner":{
            "name":"axe"
         },
         "timestamp":"2021-11-15T17:10:46.131Z",
         "url":"https://www.kay.com/login"
      },
      "frames":[
         
      ],
      "results":[
         {
            "id":"aria-valid-attr-value",
            "impact":null,
            "nodes":[
               {
                  "all":[
                     {
                        "data":{
                           "messageKey":"noId",
                           "needsReview":"aria-describedby=\"parsley-id-undefined\""
                        },
                        "id":"aria-valid-attr-value",
                        "relatedNodes":[
                           
                        ],
                        "result":null
                     },
                     {
                        "data":null,
                        "id":"aria-errormessage",
                        "relatedNodes":[
                           
                        ],
                        "result":true
                     },
                     {
                        "data":null,
                        "id":"aria-level",
                        "relatedNodes":[
                           
                        ],
                        "result":true
                     }
                  ],
                  "any":[
                     
                  ],
                  "node":{
                     "ancestry":[
                        "html > body > main:nth-child(2) > div > div:nth-child(2) > header:nth-child(3) > div:nth-child(4) > div:nth-child(4) > input:nth-child(4)"
                     ],
                     "nodeIndexes":[
                        722
                     ],
                     "selector":[
                        ".mobile-search-input"
                     ],
                     "source":"<input type=\"text\" name=\"text\" class=\"mobile-search-input\" placeholder=\"What can we help you find?\" autocomplete=\"off\" aria-describedby=\"parsley-id-undefined\" aria-invalid=\"false\">",
                     "xpath":[
                        "/div[@id='main-container']/div[2]/header/div[4]/div[4]/input"
                     ]
                  },
                  "none":[
                     
                  ]
               },
            ],
            "pageLevel":false,
            "result":"inapplicable"
         },
      ]
   }
]
@WilcoFiers WilcoFiers added core Issues in the core code (lib/core) fix Bug fixes labels Nov 19, 2021
@WilcoFiers WilcoFiers changed the title axe.finishRun stack overflow Infinite recursion when incompleteFallbackMessage is an object Nov 19, 2021
@WilcoFiers
Copy link
Contributor

There are two bugs and a missing guard clause in this issue:

  1. result:null is invalid. This comes from incorrect serialisation of the results object. This should have been result: undefined

  2. There's a bug in the built system which causes the reviewFallbackMessage, which should be a string, to be an empty object

  3. getFallbackMessage should always return an object. If set anything else, an empty string should be returned.

@WilcoFiers WilcoFiers added the pr A pr has been created for the issue label Nov 24, 2021
@WilcoFiers
Copy link
Contributor

This should've been in the 4.4 milestone.

@WilcoFiers WilcoFiers added this to the Axe-core 4.4 milestone Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) fix Bug fixes pr A pr has been created for the issue
Projects
None yet
Development

No branches or pull requests

2 participants