cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "john hight (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-1404) EXC_BAD_ACCESS when using XHR_WITH_PAYLOAD bridge mode
Date Wed, 14 Nov 2012 19:00:13 GMT

    [ https://issues.apache.org/jira/browse/CB-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497346#comment-13497346
] 

john hight commented on CB-1404:
--------------------------------

As Shazron has suggested I pop in here, and that's my GG post above, I'll fill in some details
here.

With 2.2.0, on the IOS simulator, when recording two simultaneous audio files, stopRecord
just "crashes" (quietly rails to return).  The audio buffer recording does indeed stop, as
I do get the usual log messages, but stopRecord does not return:

--------
2012-11-10 12:02:27.262 Test[15518:c07] Stopped recording audio sample '/Users/john/Library/Application
Support/iPhone Simulator/6.0/Applications/6F937803-2C02-4FBC-8773-D9FD4BCB9568/tmp/audio0.wav'

2012-11-10 12:02:27.264 Test[15518:c07] Finished recording audio sample '/Users/john/Library/Application
Support/iPhone Simulator/6.0/Applications/6F937803-2C02-4FBC-8773-D9FD4BCB9568/tmp/audio0.wav'
---------

I suspect some sort of race condition since the problem does not occur when I'm stepping through
the source with the Safari debugger.  Here's the (I believe) relevant piece of code:

   // Re-using the XHR improves exec() performance by about 10%.
   // It is possible for a native stringByEvaluatingJavascriptFromString call
   // to cause us to reach this point when a request is already in progress,
   // so we check the readyState to guard agains re-using an inprogress XHR.
   // Refer to CB-1404.
   if (execXhr && execXhr.readyState != 4) {
       execXhr = null;
   }
   execXhr = execXhr || new XMLHttpRequest();

Stepping into the stopRecord call with thr debugger, the "if expression" at line 1017 evaluates
to False, and subsequently, we reuse the execXhr (we don't make a new one), the constructor
is not called, and stopRecord returns as it should.  Without the debugger, just the simulator,
the "if expression" evaluates True, execXhr is set null, and we next attempt to create a new
execXhr, and the code silently fails within the call to the constructor. 

Perhaps there is still some issue with regard to CB-1404?
                
> EXC_BAD_ACCESS when using XHR_WITH_PAYLOAD bridge mode 
> -------------------------------------------------------
>
>                 Key: CB-1404
>                 URL: https://issues.apache.org/jira/browse/CB-1404
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.1.0
>         Environment: iPad 2, iOS 5.1.1
>            Reporter: Tom Clarkson
>            Assignee: Andrew Grieve
>             Fix For: 2.2.0
>
>
> When calling a plugin the app crashes on WebThread with EXC_BAD_ACCESS in WebCore::DocumentThreadableLoader::cancel.
> This appears to be some sort of timing issue, as it does not happen on every call - I
am seeing it in an autosave function which makes lots of calls to PGSQLitePlugin. 
> The error did not appear before upgrading to 2.1, and setting the bridge mode to IFRAME_NAV
restores the previous behaviour (no crashes, but odd scrolling functionality).
> Setting the bridge mode to XHR_NO_PAYLOAD also seems to fix it - not sure if removing
the payload actually does anything different or just makes it fast enough that the timing
condition does not come up in normal app usage.
>   

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message