[ 
https://issues.apache.org/jira/browse/CB-2851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pepe Cano updated CB-2851:
--------------------------

          Component/s: iOS
        Fix Version/s: Master
          Description: 
There are different crashes which appears sometimes on my application startup.

- [__NSCFDictionary removeFromSuperlayer]
- EXC_BAD_ACCESS


The usual two root causes in my opinion are a memory management error (e.g. 
something has died and you've kept an invalid pointer to it because reference 
counting failed) or a not properly initialised thing of some kind that's being 
referenced before it's ready or erroneously, maybe due to a programming error.

Looking at the main thread there I think it's probably something running in 
something like dispatch_async(dispatch_get_main_thread(),^{ ... and the thing 
being run is accessing a pointer that's not valid or (in some cases) points to 
an old, dead thing.





-------------> EXC_BAD_ACCESS
com.apple.main-thread Crashed
0        libobjc.A.dylib         objc_msgSend + 15
1        QuartzCore      CALayerGetSuperlayer + 88
2        UIKit   -[UIView(Hierarchy) superview] + 48
3        UIKit   __UIViewWillBeRemovedFromSuperview + 94
4        UIKit   -[UIView(Hierarchy) removeFromSuperview] + 56
5        UIKit   -[UIScrollView setShowsVerticalScrollIndicator:] + 74
6        UIKit   -[UIWebDocumentView 
webView:didCreateOrUpdateScrollingLayer:withContentsLayer:scrollSize:forNode:allowHorizontalScrollbar:allowVerticalScrollbar:]
 + 342
7        CoreFoundation  __invoking___ + 68
8        CoreFoundation  -[NSInvocation invoke] + 290
9        CoreFoundation  -[NSInvocation invokeWithTarget:] + 50
10       WebKit  -[_WebSafeForwarder forwardInvocation:] + 374
11 ...   libdispatch.dylib       _dispatch_call_block_and_release + 10
12       libdispatch.dylib       _dispatch_client_callout + 22
13       libdispatch.dylib       _dispatch_main_queue_callback_4CF + 228
14       CoreFoundation  __CFRunLoopRun + 1288
15       CoreFoundation  CFRunLoopRunSpecific + 356
16       CoreFoundation  CFRunLoopRunInMode + 104
17       GraphicsServices        GSEventRunModal + 74

-------------------------------

0        libobjc.A.dylib         objc_msgSend + 15
1        UIKit   -[UIScrollView(Static) 
_adjustScrollerIndicators:alwaysShowingThem:] + 1938
2        UIKit   -[UIScrollView _endPanWithEvent:] + 5526
3        UIKit   -[UIScrollView _gestureRecognizerFailed:] + 334
4        UIKit   -[UIGestureRecognizer _updateGestureWithEvent:] + 2344
5        UIKit   ___UIGestureRecognizerUpdate_block_invoke_0543 + 46
6        UIKit   _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 218
7        UIKit   _UIGestureRecognizerUpdate + 1164
8        UIKit   -[UIWindow _sendGesturesForEvent:] + 766
9        UIKit   -[UIWindow sendEvent:] + 90
10       UIKit   -[UIApplication sendEvent:] + 380
11       UIKit   _UIApplicationHandleEvent + 6198
12       GraphicsServices        _PurpleEventCallback + 590
13       GraphicsServices        PurpleEventCallback + 34
14 ...   CoreFoundation  
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
20       UIKit   UIApplicationMain + 1120
21       Yoin   
---------------------------------------------------

I have also reported to Apple but I did not still know which could be the root 
of the problem.


  was:
There are different crashes which appears sometimes on my application startup.

- [__NSCFDictionary removeFromSuperlayer]
- EXC_BAD_ACCESS


The usual two root causes in my opinion are a memory management error (e.g. 
something has died and you've kept an invalid pointer to it because reference 
counting failed) or a not properly initialised thing of some kind that's being 
referenced before it's ready or erroneously, maybe due to a programming error.

Looking at the main thread there I think it's probably something running in 
something like dispatch_async(dispatch_get_main_thread(),^{ ... and the thing 
being run is accessing a pointer that's not valid or (in some cases) points to 
an old, dead thing.


The errors have disappeared when: 
- Removing (FileTransfer/CDVContacts plugin)
- Disabling scrolling in the webView
    ((UIScrollView*)[self.webView scrollView]).scrollEnabled = NO;



-------------> EXC_BAD_ACCESS
com.apple.main-thread Crashed
0        libobjc.A.dylib         objc_msgSend + 15
1        QuartzCore      CALayerGetSuperlayer + 88
2        UIKit   -[UIView(Hierarchy) superview] + 48
3        UIKit   __UIViewWillBeRemovedFromSuperview + 94
4        UIKit   -[UIView(Hierarchy) removeFromSuperview] + 56
5        UIKit   -[UIScrollView setShowsVerticalScrollIndicator:] + 74
6        UIKit   -[UIWebDocumentView 
webView:didCreateOrUpdateScrollingLayer:withContentsLayer:scrollSize:forNode:allowHorizontalScrollbar:allowVerticalScrollbar:]
 + 342
7        CoreFoundation  __invoking___ + 68
8        CoreFoundation  -[NSInvocation invoke] + 290
9        CoreFoundation  -[NSInvocation invokeWithTarget:] + 50
10       WebKit  -[_WebSafeForwarder forwardInvocation:] + 374
11 ...   libdispatch.dylib       _dispatch_call_block_and_release + 10
12       libdispatch.dylib       _dispatch_client_callout + 22
13       libdispatch.dylib       _dispatch_main_queue_callback_4CF + 228
14       CoreFoundation  __CFRunLoopRun + 1288
15       CoreFoundation  CFRunLoopRunSpecific + 356
16       CoreFoundation  CFRunLoopRunInMode + 104
17       GraphicsServices        GSEventRunModal + 74

-------------------------------

0        libobjc.A.dylib         objc_msgSend + 15
1        UIKit   -[UIScrollView(Static) 
_adjustScrollerIndicators:alwaysShowingThem:] + 1938
2        UIKit   -[UIScrollView _endPanWithEvent:] + 5526
3        UIKit   -[UIScrollView _gestureRecognizerFailed:] + 334
4        UIKit   -[UIGestureRecognizer _updateGestureWithEvent:] + 2344
5        UIKit   ___UIGestureRecognizerUpdate_block_invoke_0543 + 46
6        UIKit   _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 218
7        UIKit   _UIGestureRecognizerUpdate + 1164
8        UIKit   -[UIWindow _sendGesturesForEvent:] + 766
9        UIKit   -[UIWindow sendEvent:] + 90
10       UIKit   -[UIApplication sendEvent:] + 380
11       UIKit   _UIApplicationHandleEvent + 6198
12       GraphicsServices        _PurpleEventCallback + 590
13       GraphicsServices        PurpleEventCallback + 34
14 ...   CoreFoundation  
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
20       UIKit   UIApplicationMain + 1120
21       Yoin   
---------------------------------------------------

I have also reported to Apple but I did not still know which could be the root 
of the problem.


          Environment: Xcode 4.6 & 4.6.1 with cordova-ios 2.5 and master  (was: 
Xcode 4.6 & 4.6.1 with cordova-ios (2.5))
    Affects Version/s:     (was: 2.5.0)
    
> iOS UIKit Crash webView:didCreateOrUpdateScrollingLayer:withContentsLayer
> -------------------------------------------------------------------------
>
>                 Key: CB-2851
>                 URL: https://issues.apache.org/jira/browse/CB-2851
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>         Environment: Xcode 4.6 & 4.6.1 with cordova-ios 2.5 and master
>            Reporter: Pepe Cano
>            Priority: Minor
>             Fix For: Master
>
>
> There are different crashes which appears sometimes on my application startup.
> - [__NSCFDictionary removeFromSuperlayer]
> - EXC_BAD_ACCESS
> The usual two root causes in my opinion are a memory management error (e.g. 
> something has died and you've kept an invalid pointer to it because reference 
> counting failed) or a not properly initialised thing of some kind that's 
> being referenced before it's ready or erroneously, maybe due to a programming 
> error.
> Looking at the main thread there I think it's probably something running in 
> something like dispatch_async(dispatch_get_main_thread(),^{ ... and the thing 
> being run is accessing a pointer that's not valid or (in some cases) points 
> to an old, dead thing.
> -------------> EXC_BAD_ACCESS
> com.apple.main-thread Crashed
> 0      libobjc.A.dylib         objc_msgSend + 15
> 1      QuartzCore      CALayerGetSuperlayer + 88
> 2      UIKit   -[UIView(Hierarchy) superview] + 48
> 3      UIKit   __UIViewWillBeRemovedFromSuperview + 94
> 4      UIKit   -[UIView(Hierarchy) removeFromSuperview] + 56
> 5      UIKit   -[UIScrollView setShowsVerticalScrollIndicator:] + 74
> 6      UIKit   -[UIWebDocumentView 
> webView:didCreateOrUpdateScrollingLayer:withContentsLayer:scrollSize:forNode:allowHorizontalScrollbar:allowVerticalScrollbar:]
>  + 342
> 7      CoreFoundation  __invoking___ + 68
> 8      CoreFoundation  -[NSInvocation invoke] + 290
> 9      CoreFoundation  -[NSInvocation invokeWithTarget:] + 50
> 10     WebKit  -[_WebSafeForwarder forwardInvocation:] + 374
> 11 ...         libdispatch.dylib       _dispatch_call_block_and_release + 10
> 12     libdispatch.dylib       _dispatch_client_callout + 22
> 13     libdispatch.dylib       _dispatch_main_queue_callback_4CF + 228
> 14     CoreFoundation  __CFRunLoopRun + 1288
> 15     CoreFoundation  CFRunLoopRunSpecific + 356
> 16     CoreFoundation  CFRunLoopRunInMode + 104
> 17     GraphicsServices        GSEventRunModal + 74
> -------------------------------
> 0      libobjc.A.dylib         objc_msgSend + 15
> 1      UIKit   -[UIScrollView(Static) 
> _adjustScrollerIndicators:alwaysShowingThem:] + 1938
> 2      UIKit   -[UIScrollView _endPanWithEvent:] + 5526
> 3      UIKit   -[UIScrollView _gestureRecognizerFailed:] + 334
> 4      UIKit   -[UIGestureRecognizer _updateGestureWithEvent:] + 2344
> 5      UIKit   ___UIGestureRecognizerUpdate_block_invoke_0543 + 46
> 6      UIKit   _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 218
> 7      UIKit   _UIGestureRecognizerUpdate + 1164
> 8      UIKit   -[UIWindow _sendGesturesForEvent:] + 766
> 9      UIKit   -[UIWindow sendEvent:] + 90
> 10     UIKit   -[UIApplication sendEvent:] + 380
> 11     UIKit   _UIApplicationHandleEvent + 6198
> 12     GraphicsServices        _PurpleEventCallback + 590
> 13     GraphicsServices        PurpleEventCallback + 34
> 14 ...         CoreFoundation  
> __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
> 20     UIKit   UIApplicationMain + 1120
> 21     Yoin   
> ---------------------------------------------------
> I have also reported to Apple but I did not still know which could be the 
> root of the problem.

--
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

Reply via email to