Results 1 to 3 of 3

Thread: Ext.data.JsonP.abort() crashes application due to infinite recursion

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3292 in a recent build.
  1. #1
    Sencha User VladimirTechMan's Avatar
    Join Date
    Jun 2012
    Location
    Russia
    Posts
    50
    Vote Rating
    4
      0  

    Default Ext.data.JsonP.abort() crashes application due to infinite recursion

    Ext version tested:
    • Sencha Touch 2.0.1.1
    • Sensha Touch 2.1.0-b2

    Browser versions tested against:

    • Mobile Safari (iOS 5.1.1)

    Description:
    • When called, method abort() of Ext.data.JsonP crashes the application

    Steps to reproduce the problem:
    • Create a request with Ext.data.JsonP.request()
    • Call Ext.data.JsonP.abort() on that request before the request is completed

    The result that was expected:
    • The request is aborted successfully

    The result that occurs instead:
    • The application crashes with an error pointing to stack overflow

    Root cause and fix:

    Inside method Ext.data.JsonP.abort() there is a "typo": Instead of calling handleAbort(), the abort() method calls itself again and again (till the stack is overflown).

    Exactly, the following code fragment in the abort() method (inside the src/data/JsonP.js file):
    Code:
        ...
        if (request) {
            if (!request.id) {
                request = requests[request];
            }
            this.abort(request);
        } else { ...
    needs to be changed this way:
    Code:
        ...
        if (request) {
            if (!request.id) {
                request = requests[request];
            }
            this.handleAbort(request);
        } else { ...

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Thanks for the report.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    This has been fixed for the next release. Nice catch.

    Sencha Inc

    Jamie Avins

    @jamieavins

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •