Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 293C0189E7 for ; Mon, 1 Jun 2015 16:48:18 +0000 (UTC) Received: (qmail 48139 invoked by uid 500); 1 Jun 2015 16:48:17 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 48120 invoked by uid 500); 1 Jun 2015 16:48:17 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 47917 invoked by uid 99); 1 Jun 2015 16:48:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 16:48:17 +0000 Date: Mon, 1 Jun 2015 16:48:17 +0000 (UTC) From: =?utf-8?Q?I=C3=B1aki_Baz_Castillo_=28JIRA=29?= To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CB-9102) Crash when using a iOS Cordova plugin within a WebSocket event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 I=C3=B1aki Baz Castillo created CB-9102: -------------------------------------- Summary: Crash when using a iOS Cordova plugin within a WebSoc= ket event Key: CB-9102 URL: https://issues.apache.org/jira/browse/CB-9102 Project: Apache Cordova Issue Type: Bug Components: iOS Affects Versions: 3.8.0 Reporter: I=C3=B1aki Baz Castillo I've coded a cordova plugin for iOS. It is exported as a JavaScript object = with multiple functions in `window.cordova.plugins.iosrtc`. If I use any of those exported functions within the callback of a WebSocket= event (onopen, onmessage, etc), the plugin/app usually crashes: ------------------------------- Process 2326 stopped * thread #1: tid =3D 0x94ce5, 0x2e267474 WebCore`WebCore::NavigationSchedul= er::schedule(std::__1::unique_ptr >) + 276, queue =3D 'com.apple.= main-thread', stop reason =3D EXC_BAD_ACCESS (code=3D1, address=3D0x0) frame #0: 0x2e267474 WebCore`WebCore::NavigationScheduler::schedule(std= ::__1::unique_ptr >) + 276 WebCore`WebCore::NavigationScheduler::schedule: -> 0x2e267474 <+276>: ldr r2, [r0] 0x2e267476 <+278>: ldr r3, [r2, #0x10] 0x2e267478 <+280>: mov r2, r10 0x2e26747a <+282>: blx r3 (lldb) error: No auto repeat. (lldb) list 30 =09{ 31 =09 @autoreleasepool { 32 =09 int retVal =3D UIApplicationMain(argc, argv, nil, @"AppDe= legate"); 33 =09 return retVal; 34 =09 } 35 =09} (lldb) bt * thread #1: tid =3D 0x94ce5, 0x2e267474 WebCore`WebCore::NavigationSchedul= er::schedule(std::__1::unique_ptr >) + 276, queue =3D 'com.apple.= main-thread', stop reason =3D EXC_BAD_ACCESS (code=3D1, address=3D0x0) * frame #0: 0x2e267474 WebCore`WebCore::NavigationScheduler::schedule(std= ::__1::unique_ptr >) + 276 frame #1: 0x2e26769e WebCore`WebCore::NavigationScheduler::scheduleLoca= tionChange(WebCore::SecurityOrigin*, WebCore::URL const&, WTF::String const= &, WebCore::LockHistory, WebCore::LockBackForwardList) + 498 frame #2: 0x2de00c20 WebCore`WebCore::DOMWindow::setLocation(WTF::Strin= g const&, WebCore::DOMWindow&, WebCore::DOMWindow&, WebCore::SetLocationLoc= king) + 172 frame #3: 0x2e22b0e2 WebCore`WebCore::Location::setHref(WTF::String con= st&, WebCore::DOMWindow&, WebCore::DOMWindow&) + 86 frame #4: 0x2e03c5d6 WebCore`WebCore::JSDOMWindow::setLocation(JSC::Exe= cState*, JSC::JSValue) + 142 frame #5: 0x2daad47e WebCore`WebCore::JSDOMWindow::put(JSC::JSCell, JSC= ::ExecState, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 446 frame #6: 0x231a3436 JavaScriptCore`JSC::JSProxy::put(JSC::JSCell, JSC:= :ExecState, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 54 frame #7: 0x23199fc0 JavaScriptCore`llint_slow_path_put_by_id + 404 frame #8: 0x233ca3ce JavaScriptCore`llint_entry + 9694 ------------------------------- Sometimes it produces a different error: -------------------------------- 2015-06-01 15:29:17.810 cordovaIosrtcDemo[2298:602476] DiskCookieStorage ch= anging policy from 2 to 0, cookie file: file:///private/var/mobile/Containe= rs/Data/Application/3588C109-5F97-4E5F-83EA-36165871ACC3/Library/Cookies/Co= okies.binarycookies 2015-06-01 15:29:18.083 cordovaIosrtcDemo[2298:602476] Apache Cordova nativ= e platform version 3.8.0 is starting. 2015-06-01 15:29:18.083 cordovaIosrtcDemo[2298:602476] Multi-tasking -> Dev= ice: YES, App: YES 2015-06-01 15:29:18.088 cordovaIosrtcDemo[2298:602476] Unlimited access to = network resources 2015-06-01 15:29:18.277 cordovaIosrtcDemo[2298:602476] iosrtcPlugin#init() 2015-06-01 15:29:18.325 cordovaIosrtcDemo[2298:602476] PluginGetUserMedia#i= nit() 2015-06-01 15:29:18.326 cordovaIosrtcDemo[2298:602476] [CDVTimer][iosrtcplu= gin] 55.085003ms 2015-06-01 15:29:18.326 cordovaIosrtcDemo[2298:602476] [CDVTimer][TotalPlug= inStartup] 55.342019ms 2015-06-01 15:29:18.967 cordovaIosrtcDemo[2298:602476] Resetting plugins du= e to page load. 2015-06-01 15:29:19.432 cordovaIosrtcDemo[2298:602476] Finished load of: fi= le:///private/var/mobile/Containers/Bundle/Application/90A5F156-4893-490C-B= 608-A7D3715F379D/cordovaIosrtcDemo.app/www/index.html Process 2298 stopped * thread #8: tid =3D 0x931b5, 0x21e410e8 CoreFoundation`CFRelease + 1268, n= ame =3D 'WebThread', stop reason =3D EXC_BREAKPOINT (code=3DEXC_ARM_BREAKPO= INT, subcode=3D0xdefe) frame #0: 0x21e410e8 CoreFoundation`CFRelease + 1268 CoreFoundation`CFRelease: -> 0x21e410e8 <+1268>: trap 0x21e410ea <+1270>: trap CoreFoundation`_CFAllocatorDeallocateGC: 0x21e410ec <+0>: push {r4, r7, lr} 0x21e410ee <+2>: mov r4, r1 -------------------------------- IMPORTANT: If I run a setTimeout within the WebSocket event and run the plu= gin function inside it, the app DOES NOT crash. It may be related to https://issues.apache.org/jira/browse/CB-2301 NOTE: This issue is NOT about sleep/resume at all as it happens immediately= when I open the app and a WebSocket connects. -- 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