You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "simon tretter (JIRA)" <ji...@apache.org> on 2016/02/27 00:39:18 UTC

[jira] [Commented] (CB-10712) app freezes if device is offline

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

simon tretter commented on CB-10712:
------------------------------------

I found the issue. I use the cordoba-app-loader which allows to side load files from a server (or updates them). Well, it's implementation uses a slight modified version of the pegasus function.
Somehow this seems to cause the issue, I have modified my pegasus function to a jquery ajax call. Now all issues seem to be gone. 

Still not sure why this caused the issue.. but as long as it disappeared Im happy for now.

In case someone runs into the same issue, here is the pegasus function using jQuery:
window.pegasus = function pegasus(a) {
        return new Promise(function(resolve, reject) {
                           $.ajax({url: a,timeout: 5000,dataType:'json'})
                    .done(function(data) {
                          resolve(data);
                          })
                    .fail(function(err) {
                          reject();
                          })
                    });
    };

original code can be found here https://raw.githubusercontent.com/markmarijnissen/cordova-app-loader/master/dist/bootstrap.js

> app freezes if device is offline
> --------------------------------
>
>                 Key: CB-10712
>                 URL: https://issues.apache.org/jira/browse/CB-10712
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 4.1.0
>         Environment: iOS
>            Reporter: simon tretter
>
> similar to CB-10530, but this one happens every time when I start the app when my device is completely offline (no wifi, no sim inserted). not sure how or if this is offline thing is really related, but at least it's easy to reproduce due to the reason that i happens all the time.
> I have ajax request in the app, but seems not related. I can reproduce the issue even if I skip all the network stuff. The app freezes during start. always on a different line of code. 
> last log lines show a memory warning
> 2016-02-26 22:53:01.674 hokify[849:77467] initPage index
> 2016-02-26 22:53:01.724 hokify[849:77467] i am nitialized
> 2016-02-26 22:53:01.725 hokify[849:77467] DEVICE READY
> 2016-02-26 22:53:01.738 hokify[849:77467] meep
> 2016-02-26 22:53:24.951 hokify[849:77467] Received memory warning.
> 2016-02-26 22:53:24.967 hokify[849:77467] Received memory warning.
> (lldb) 
> and after a while the app sends a EXC_BAD_ACCESS in a WebThread.
> (lldb) bt
> * thread #13: tid = 0x12f07, 0x273bae94 JavaScriptCore`bmalloc::VMHeap::grow() + 116, name = 'WebThread', stop reason = EXC_BAD_ACCESS (code=1, address=0xbbadbeef)
>   * frame #0: 0x273bae94 JavaScriptCore`bmalloc::VMHeap::grow() + 116
>     frame #1: 0x273b9dfa JavaScriptCore`bmalloc::Heap::allocateLarge(std::__1::lock_guard<bmalloc::StaticMutex>&, unsigned long) + 78
>     frame #2: 0x273b84be JavaScriptCore`bmalloc::Allocator::allocateLarge(unsigned long) + 86
>     frame #3: 0x273b8246 JavaScriptCore`bmalloc::Allocator::reallocate(void*, unsigned long) + 554
>     frame #4: 0x26ffdbc4 JavaScriptCore`WTF::StringImpl::reallocate(WTF::PassRefPtr<WTF::StringImpl>, unsigned int, unsigned char*&) + 44
>     frame #5: 0x26ffdb00 JavaScriptCore`void WTF::StringBuilder::reallocateBuffer<unsigned char>(unsigned int) + 64
>     frame #6: 0x26ffd522 JavaScriptCore`unsigned char* WTF::StringBuilder::appendUninitializedSlow<unsigned char>(unsigned int) + 46
>     frame #7: 0x26ffd370 JavaScriptCore`WTF::StringBuilder::append(unsigned char const*, unsigned int) + 64
>     frame #8: 0x27241980 JavaScriptCore`JSC::Interpreter::stackTraceAsString(JSC::ExecState*, WTF::Vector<JSC::StackFrame, 0ul, WTF::CrashOnOverflow, 16ul>) + 84
>     frame #9: 0x271ea3ec JavaScriptCore`JSC::ErrorInstance::finishCreation(JSC::ExecState*, JSC::VM&, WTF::String const&, bool) + 960
>     frame #10: 0x270d8f72 JavaScriptCore`JSC::createSyntaxError(JSC::ExecState*, WTF::String const&) + 82
>     frame #11: 0x272a3d4c JavaScriptCore`JSC::JSONProtoFuncParse(JSC::ExecState*) + 584
>     frame #12: 0x272f96fe JavaScriptCore`llint_entry + 21374
> (lldb) 
> As a side note, I also experience this sometimes when I'm not offline. Couldn't figure out if this is now fixed by 4.1. But I guess not.
> update #1
> I also tried to remove cordova-plugin-statusbar and other plugins.. couldn't relate to a plugin causing this. 
> update #2
> i can reproduce this issue with cordova iOS 3.9, 4.0 and 4.1



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org