I just moved a working Ember-CLI project using Ember version 9 to version 11 and CLI from 0.1.15 to 0.2.2. After making all the necessary tweaking here and there though I now have an app that starts serving files but then immediately crashes with a Segmentation fault: 11. As far as I can see there are no logs anywhere and I'm at a loss on how to debug what is actually causing the fault.
Any help would be greatly appreciated.
A good way to gain insight into a segfault is to install ddobson's debugging tool found on github at: https://github.com/ddopson/node-segfault-handler.
You can install this with npm with:
npm install segfault-handler
Then just add the following two lines to your server/index.js file:
var segfaultHandler = require('segfault-handler');
segfaultHandler.registerHandler();
This will produce a stack trace for your node_modules which are dipping into native code (which is likely why you're getting the segfault).
In my case above the problem clearly stem from SASS compilation:
PID 30497 received SIGSEGV for address: 0x71
0 segfault-handler.node 0x00000001040f890f _ZL16segfault_handleriP9__siginfoPv + 287
1 libsystem_platform.dylib 0x00007fff90fd7f1a _sigtramp + 26
2 ??? 0x000000010141c6a0 0x0 + 4316055200
3 binding.node 0x00000001078a6fb3 _ZN4Sass6Parser16parse_expressionEv + 25
4 binding.node 0x00000001078a6e11 _ZN4Sass6Parser14parse_relationEv + 25
5 binding.node 0x00000001078a6bd1 _ZN4Sass6Parser17parse_conjunctionEv + 23
6 binding.node 0x00000001078a6aef _ZN4Sass6Parser17parse_disjunctionEv + 23
7 binding.node 0x00000001078a27b1 _ZN4Sass6Parser16parse_space_listEv + 23
8 binding.node 0x00000001078a2ccd _ZN4Sass6Parser14parse_argumentEv + 349
9 binding.node 0x00000001078a2a8a _ZN4Sass6Parser15parse_argumentsEv + 182
10 binding.node 0x00000001078a8a30 _ZN4Sass6Parser19parse_function_callEv + 186
11 binding.node 0x00000001078a7747 _ZN4Sass6Parser12parse_factorEv + 623
12 binding.node 0x00000001078a714d _ZN4Sass6Parser10parse_termEv + 25
13 binding.node 0x00000001078a6fb3 _ZN4Sass6Parser16parse_expressionEv + 25
14 binding.node 0x00000001078a6e11 _ZN4Sass6Parser14parse_relationEv + 25
15 binding.node 0x00000001078a6bd1 _ZN4Sass6Parser17parse_conjunctionEv + 23
16 binding.node 0x00000001078a6aef _ZN4Sass6Parser17parse_disjunctionEv + 23
17 binding.node 0x00000001078a27b1 _ZN4Sass6Parser16parse_space_listEv + 23
18 binding.node 0x00000001078a2ccd _ZN4Sass6Parser14parse_argumentEv + 349
19 binding.node 0x00000001078a2a8a _ZN4Sass6Parser15parse_argumentsEv + 182
20 binding.node 0x000000010789de19 _ZN4Sass6Parser16parse_mixin_callEv + 211
21 binding.node 0x00000001078a1949 _ZN4Sass6Parser11parse_blockEv + 1103
22 binding.node 0x000000010789f864 _ZN4Sass6Parser13parse_rulesetE18Selector_Lookahead + 174
23 binding.node 0x00000001078a1cfb _ZN4Sass6Parser11parse_blockEv + 2049
24 binding.node 0x000000010789f864 _ZN4Sass6Parser13parse_rulesetE18Selector_Lookahead + 174
25 binding.node 0x00000001078a1cfb _ZN4Sass6Parser11parse_blockEv + 2049
26 binding.node 0x000000010789f864 _ZN4Sass6Parser13parse_rulesetE18Selector_Lookahead + 174
27 binding.node 0x000000010789b98b _ZN4Sass6Parser5parseEv + 1651
28 binding.node 0x00000001078402c1 _ZN4Sass7Context10parse_fileEv + 375
29 binding.node 0x00000001078c1a69 _Z16sass_parse_blockP12Sass_ContextPN4Sass7ContextE + 162
30 binding.node 0x00000001078c144c _Z20sass_compile_contextP12Sass_ContextN4Sass7Context4DataE + 343
31 binding.node 0x00000001078c1715 sass_compile_file_context + 487
Abort trap: 6
Related
I have a Catalyst version of my app written on SwiftUI. There is a picker which I wanted to be styled as WheelPickerStyle(). Mac Catalyst supports WheelPickerStyle():
https://developer.apple.com/documentation/swiftui/wheelpickerstyle
At launch app crashes. With other styles everything works fine.
2021-05-20 11:04:48.341319+0300 Н или НН[2745:66389] [General] UIPickerView is not supported when running Catalyst apps in the Mac idiom.
2021-05-20 11:04:48.350037+0300 Н или НН[2745:66389] [General] (
0 CoreFoundation 0x00007fff205fd87b __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff20335d92 objc_exception_throw + 48
2 UIKitCore 0x00007fff4544dc52 -[UIView(UICatalystMacIdiomUnsupported_Internal) _throwForUnsupportedNonMacIdiomBehaviorWithReason:] + 0
3 UIKitCore 0x00007fff45158fe4 -[UIPickerView _didMoveFromWindow:toWindow:] + 191
4 UIKitCore 0x00007fff44578d14 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 759
5 UIKitCore 0x00007fff4452dfa1 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 130
6 UIKitCore 0x00007fff4452de1a -[UIView(Hierarchy) _postMovedFromSuperview:] + 800
7 UIKitCore 0x00007fff4452cbcd -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1957
8 SwiftUI 0x00007fff565f2e0b $s7SwiftUI11DisplayListV11ViewUpdaterC010updateItemE033_C85E9C9D8E8767197A33852BB19DA7BELL9container4from10localStateyAE9ContainerAGLLVz_AC0H0VAE5ModelO0U0VztF + 971
9 SwiftUI 0x00007fff565f2861 $s7SwiftUI11DisplayListV11ViewUpdaterC015updateInheritedE033_C85E9C9D8E8767197A33852BB19DA7BELL9container4from11parentStateyAE9ContainerAGLLVz_AC4ItemVSPyAE5ModelO0U0VGtF + 867
10 SwiftUI 0x00007fff565f2179 $s7SwiftUI11DisplayListV11ViewUpdaterC6update33_C85E9C9D8E8767197A33852BB19DA7BELL9container4from11parentStateyAE9ContainerAGLLVz_ACSPyAE5ModelO0T0VGtF + 513
11 SwiftUI 0x00007fff565f1e5f $s7SwiftUI11DisplayListV11ViewUpdaterC6render04rootE04from4time7version10maxVersion13contentsScaleAA4TimeVSo6UIViewC_AcnC0M0VAR12CoreGraphics7CGFloatVtFANSPyAE5ModelO5StateV7GlobalsVGXEfU_ + 314
12 SwiftUI 0x00007fff565f1ce8 $s7SwiftUI11DisplayListV11ViewUpdaterC6render04rootE04from4time7version10maxVersion13contentsScaleAA4TimeVSo6UIViewC_AcnC0M0VAR12CoreGraphics7CGFloatVtF + 670
13 SwiftUI 0x00007fff566ba9ee $s7SwiftUI11DisplayListV12ViewRendererC6render04rootE04from4time8nextTime7version10maxVersion13contentsScaleAA0L0VSo6UIViewC_Ac2oC0O0VAS12CoreGraphics7CGFloatVtF + 110
14 SwiftUI 0x00007fff56277796 $s7SwiftUI14_UIHostingViewC17renderDisplayList_4time8nextTime7version10maxVersionAA0J0VAA0fG0V_A2jL0M0VANtF + 230
15 SwiftUI 0x00007fff56832579 $s7SwiftUI16ViewRendererHostPAAE6render8interval17updateDisplayListySd_SbtFyyXEfU_ + 4674
16 SwiftUI 0x00007fff5682c3f2 $s7SwiftUI16ViewRendererHostPAAE6render8interval17updateDisplayListySd_SbtF + 350
17 SwiftUI 0x00007fff5699d5e2 $s7SwiftUI14_UIHostingViewC14layoutSubviewsyyF + 241
18 SwiftUI 0x00007fff5699d600 $s7SwiftUI14_UIHostingViewC14layoutSubviewsyyFTo + 21
19 UIKitCore 0x00007fff44580013 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2925
20 QuartzCore 0x00007fff26d058d3 -[CALayer layoutSublayers] + 326
21 QuartzCore 0x00007fff26d05239 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 619
22 QuartzCore 0x00007fff26e5107f _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 655
23 QuartzCore 0x00007fff26ce70df _ZN2CA11Transaction6commitEv + 713
24 UIKitCore 0x00007fff44661e14 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81
25 CoreFoundation 0x00007fff20583512 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
26 CoreFoundation 0x00007fff205833c3 __CFRunLoopDoBlocks + 440
27 CoreFoundation 0x00007fff2058209d __CFRunLoopRun + 910
28 CoreFoundation 0x00007fff2058164c CFRunLoopRunSpecific + 563
29 HIToolbox 0x00007fff287bfab3 RunCurrentEventLoopInMode + 292
30 HIToolbox 0x00007fff287bf815 ReceiveNextEventCommon + 587
31 HIToolbox 0x00007fff287bf5b3 _BlockUntilNextEventMatchingListInModeWithFilter + 70
32 AppKit 0x00007fff22d826f2 _DPSNextEvent + 864
33 AppKit 0x00007fff22d80ec5 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
34 AppKit 0x00007fff22d73239 -[NSApplication run] + 586
35 AppKit 0x00007fff22d4747c NSApplicationMain + 816
36 AppKit 0x00007fff2303e414 _NSApplicationMainWithInfoDictionary + 16
37 UIKitMacHelper 0x00007fff3405ed47 UINSApplicationMain + 1430
38 UIKitCore 0x00007fff444cc98c UIApplicationMain + 144
39 –Э –Є–ї–Є –Э–Э 0x00000001088fee4b main + 75
40 libdyld.dylib 0x00007fff204a5f5d start + 1
41 ??? 0x0000000000000003 0x0 + 3
)
(lldb)
I got this (not particularly helpful, in my eyes) crash message and was wondered what the usual suspect was for this/where I'm best to look? I'm getting this when I navigate using a NavigationLink to another View. I know from some research that this crash tends to have a different cause each time, but I wondered if the stack trace would give any clues?
Each crash companies about the same invalid attribute id: 83753. Any way I can track something down using this ID?
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1c1f2584c __pthread_kill + 8
1 libsystem_pthread.dylib 0x1de7f09e8 pthread_kill + 212
2 libsystem_c.dylib 0x19ed5c8f4 abort + 100
3 AttributeGraph 0x1bd82dc7c util::Heap::Heap(void*, unsigned long, unsigned long) + 186
4 AttributeGraph 0x1bd8269f0 AG::AttributeID::size() const + 238
5 AttributeGraph 0x1bd82d530 AGGraphGetValue + 500
6 SwiftUI 0x19c9e4eb0 ResolvedTextFilter.updateValue() + 56
7 SwiftUI 0x19c4cee34 partial apply for specialized implicit closure #2 in implicit closure #1 in closure #1 in closure #1 in Attribute.init<A>(_:) + 20
8 AttributeGraph 0x1bd81714c AG::Graph::UpdateStack::update() + 484
9 AttributeGraph 0x1bd81755c AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 328
10 AttributeGraph 0x1bd81c1f8 AG::Graph::value_ref(AG::AttributeID, AGSwiftMetadata const*, bool*) + 152
11 AttributeGraph 0x1bd82d468 AGGraphGetValue + 300
12 SwiftUI 0x19c6321d8 ViewGraph.sizeThatFits(_:) + 212
13 SwiftUI 0x19ca285e0 closure #1 in ViewRendererHost.sizeThatFits(_:) + 52
14 SwiftUI 0x19c5d2ec4 thunk for #callee_guaranteed (#guaranteed ViewGraph) -> (#unowned CGSize) + 24
15 SwiftUI 0x19ca2687c closure #1 in ViewRendererHost.updateViewGraph<A>(body:) + 92
16 SwiftUI 0x19ca1f0b4 ViewRendererHost.updateViewGraph<A>(body:) + 88
17 SwiftUI 0x19ca25328 ViewRendererHost.sizeThatFits(_:) + 112
18 SwiftUI 0x19cb7b980 _UIHostingView.sizeThatFits(_:) + 112
19 SwiftUI 0x19cb7b9c8 #objc _UIHostingView._baselineOffsets(at:) + 48
20 UIKitCore 0x197eadbb0 -[_UITAMICAdaptorView updateForAvailableSize] + 120
21 UIKitCore 0x197eadafc -[_UITAMICAdaptorView didMoveToWindow] + 60
22 UIKitCore 0x198dcdbc0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 2016
23 UIKitCore 0x198dcd680 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 672
24 UIKitCore 0x198dcd680 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 672
25 UIKitCore 0x197ed2350 -[UINavigationBar _didMoveFromWindow:toWindow:] + 64
26 UIKitCore 0x198dc1ac8 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 136
27 UIKitCore 0x198dc19b4 -[UIView(Hierarchy) _postMovedFromSuperview:] + 748
28 UIKitCore 0x198dd0028 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2132
29 UIKitCore 0x1981385d8 -[UILayoutContainerView addSubview:] + 64
30 UIKitCore 0x1981434a0 -[UINavigationController _unhideNavigationBarForEdge:] + 100
31 UIKitCore 0x1981436e8 -[UINavigationController _setNavigationBarHidden:edge:duration:] + 216
32 UIKitCore 0x198142d30 -[UINavigationController _setNavigationBarHidden:edgeIfNotNavigating:duration:] + 516
33 UIKitCore 0x1981416ac -[UINavigationController setNavigationBarHidden:animated:] + 156
34 SwiftUI 0x19cadace8 NavigationBridge_PhoneTV.hostingControllerWillAppear(transitionCoordinator:animated:) + 876
35 SwiftUI 0x19c53fc60 _UIHostingView.viewControllerWillAppear(transitionCoordinator:animated:) + 48
36 SwiftUI 0x19cb7fd20 UIHostingController.viewWillAppear(_:) + 116
37 SwiftUI 0x19cb7fc3c #objc UIHostingController.viewWillAppear(_:) + 40
38 UIKitCore 0x198210a4c -[UIViewController _setViewAppearState:isAnimating:] + 604
39 UIKitCore 0x1982111d0 -[UIViewController __viewWillAppear:] + 116
40 UIKitCore 0x19813f7e8 -[UINavigationController _startCustomTransition:] + 1344
41 UIKitCore 0x198153bb0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 700
42 UIKitCore 0x198154fe0 -[UINavigationController __viewWillLayoutSubviews] + 164
43 UIKitCore 0x198137e78 -[UILayoutContainerView layoutSubviews] + 224
44 UIKitCore 0x198dd6398 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2468
45 QuartzCore 0x1992dbdf4 -[CALayer layoutSublayers] + 288
46 QuartzCore 0x1992e2398 CA::Layer::layout_if_needed(CA::Transaction*) + 520
47 QuartzCore 0x1992ed6e8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 140
48 QuartzCore 0x199238d7c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 416
49 QuartzCore 0x199262f40 CA::Transaction::commit() + 728
50 QuartzCore 0x1992641f0 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
51 CoreFoundation 0x195fe087c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
52 CoreFoundation 0x195fdaf50 __CFRunLoopDoObservers + 604
53 CoreFoundation 0x195fdb498 __CFRunLoopRun + 960
54 CoreFoundation 0x195fdaba0 CFRunLoopRunSpecific + 572
55 GraphicsServices 0x1acd43598 GSEventRunModal + 160
56 UIKitCore 0x1988cc2f4 -[UIApplication _run] + 1052
57 UIKitCore 0x1988d1874 UIApplicationMain + 164
58 SwiftUI 0x19ca5a5dc closure #1 in KitRendererCommon(_:) + 108
59 SwiftUI 0x19ca5a56c runApp<A>(_:) + 176
60 SwiftUI 0x19c62bd18 static App.main() + 96
61 ProgressioniOS 0x10077f06c static ProgressionApp.$main() (<compiler-generated>)
62 ProgressioniOS 0x10077f39c main (ProgressionApp.swift)
63 libdyld.dylib 0x195cb9568 start + 4
Any thoughts appreciated.
Hey StackOverflow detectives.
I've been pulling my hair out for a few months trying to figure out the crashes which happen at a line never exists.
In the crash log below, CustomClass.swift does exist but the line 25 doesn't.
What would be the true reason for this crash?
Hint: we run heavy processing and allocate a lot of memory (about 700MB) in the background that was written in c++, which is in OUR_CUSTOM_FRAMEWORK below.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001934c6df0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001933e6930 pthread_kill + 228 (pthread.c:1458)
2 libsystem_c.dylib 0x0000000193374ba4 abort + 104 (abort.c:110)
3 libsystem_malloc.dylib 0x00000001933d7fdc malloc_vreport + 564 (malloc_printf.c:183)
4 libsystem_malloc.dylib 0x00000001933d81a4 malloc_report + 64 (malloc_printf.c:192)
5 libsystem_malloc.dylib 0x00000001933cbd1c free + 436 (malloc.c:1733)
6 [OUR_CUSTOM_FRAMEWORK] 0x000000010324ccf8 0x1031a4000 + 691448
7 libsystem_c.dylib 0x0000000193355164 __cxa_finalize_ranges + 416 (atexit.c:284)
8 libsystem_c.dylib 0x00000001933554a0 exit + 28 (exit.c:81)
9 UIKitCore 0x000000019782eb88 -[UIApplication _terminateWithStatus:] + 508 (UIApplication.m:6735)
10 UIKitCore 0x0000000196f97718 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 128 (_UISceneLifecycleMultiplexer.m:765)
11 UIKitCore 0x0000000196f9737c -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 220 (_UISceneLifecycleMultiplexer.m:418)
12 UIKitCore 0x0000000197824ac4 -[UIApplication workspaceShouldExit:withTransitionContext:] + 216 (UIApplication.m:3725)
13 FrontBoardServices 0x000000019893bcf8 -[FBSUIApplicationWorkspaceShim workspaceShouldExit:withTransitionContext:] + 88 (FBSUIApplicationWorkspace.m:144)
14 FrontBoardServices 0x0000000198968d68 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke_2 + 80 (FBSWorkspaceScenesClient.m:281)
15 FrontBoardServices 0x000000019894debc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240 (FBSWorkspace.m:357)
16 FrontBoardServices 0x0000000198968cf4 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke + 140 (FBSWorkspaceScenesClient.m:278)
17 libdispatch.dylib 0x000000019338033c _dispatch_client_callout + 20 (object.m:495)
18 libdispatch.dylib 0x00000001933830d4 _dispatch_block_invoke_direct + 264 (queue.c:466)
19 FrontBoardServices 0x000000019898f6c4 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48 (FBSSerialQueue.m:173)
20 FrontBoardServices 0x000000019898f370 -[FBSSerialQueue _queue_performNextIfPossible] + 432 (FBSSerialQueue.m:216)
21 FrontBoardServices 0x000000019898f8dc -[FBSSerialQueue _performNextFromRunLoopSource] + 32 (FBSSerialQueue.m:247)
22 CoreFoundation 0x000000019365baf4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1922)
23 CoreFoundation 0x000000019365ba48 __CFRunLoopDoSource0 + 84 (CFRunLoop.c:1956)
24 CoreFoundation 0x000000019365b198 __CFRunLoopDoSources0 + 196 (CFRunLoop.c:1992)
25 CoreFoundation 0x0000000193655f38 __CFRunLoopRun + 796 (CFRunLoop.c:2882)
26 CoreFoundation 0x00000001936558f4 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
27 GraphicsServices 0x000000019da6c604 GSEventRunModal + 164 (GSEvent.c:2246)
28 UIKitCore 0x0000000197829358 UIApplicationMain + 1944 (UIApplication.m:4823)
29 [APPNAME] 0x0000000100d45128 main + 68 (CustomClass.swift:25)
30 libdyld.dylib 0x00000001934d12dc start + 4
I get assertion failure error when try to rotate sprite, i guess. The game sim run well exception sometime this error happen. I don't known why?
and this my Log file:
Assertion failure in -[CCSprite rotation], /Users/SCN/Desktop/Stick-ninja-test/Stick-ninja-test/libs/cocos2d/CCNode.m:207
2015-03-24 08:39:42.207 Fish-hunt[548:a0b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CCNode#rotation. RotationX != RotationY. Don't know which one to return'
* First throw call stack:
(
0 CoreFoundation 0x02c1b5e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x022678b6 objc_exception_throw + 44
2 CoreFoundation 0x02c1b448 +[NSException raise:format:arguments:] + 136
3 Foundation 0x019c2fee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
4 Fish-hunt 0x000f4f8c -[CCNode rotation] + 236
5 Fish-hunt 0x00084dd5 -[GameLayer update:] + 7621
6 Fish-hunt 0x000e46af -[CCScheduler update:] + 447
7 Fish-hunt 0x000e4e01 -[CCDirectorIOS drawScene] + 225
8 Fish-hunt 0x000e68e4 -[CCDirectorDisplayLink mainLoop:] + 52
9 QuartzCore 0x0130db8a _ZN2CA7Display15DisplayLinkItem8dispatchEv + 48
10 QuartzCore 0x0130da46 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 310
11 QuartzCore 0x0130df6b _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123
12 CoreFoundation 0x02bd9bd6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 22
13 CoreFoundation 0x02bd95bd __CFRunLoopDoTimer + 1181
14 CoreFoundation 0x02bc1628 __CFRunLoopRun + 1816
15 CoreFoundation 0x02bc0ac3 CFRunLoopRunSpecific + 467
16 CoreFoundation 0x02bc08db CFRunLoopRunInMode + 123
17 GraphicsServices 0x0396b9e2 GSEventRunModal + 192
18 GraphicsServices 0x0396b809 GSEventRun + 104
19 UIKit 0x00360d3b UIApplicationMain + 1225
20 Fish-hunt 0x00099a46 main + 134
21 Fish-hunt 0x00002a05 start + 53
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Would you tell my why? thanks
I know you got the answer, but you have not mentioned how you resolved it. So I am giving how I resolved the same for other user having the same problem.
If you are using only setRotation() and getRotation(). check the value at some point in setRotation() is invalid like NaN or someother value which is not valid. Cocos2d does not give error while setting but after that when you do getRotation(), it gives the error.
I'm using wxWidgets, and I have a wxTreeCtrl set up with a root and a single child. I'm setting client data on the child and it works fine until the window closes, at which point I get a bus error, which I'm assuming is coming from wxWidgets attempting to delete my client data.
Here's my client data struct:
struct MapPtrCtr {
Map* map;
MapPtrCtr(Map* map) : map(map) {}
};
Here's how I set the client data (note that here, map is std::shared_ptr<Map>):
wxTreeItemId childNode = mapTree->AppendItem(node, map->getTitle());
mapTree->SetItemData(childNode, (wxTreeItemData*) new MapPtrCtr(map.get()));
Here's the error I get:
Process: AromatherapyMapEditor [43832]
Path: /Users/USER/*/AromatherapyMapEditor
Identifier: AromatherapyMapEditor
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [805]
Responsible: Terminal [798]
User ID: 501
Date/Time: 2015-03-16 13:38:02.964 -0400
OS Version: Mac OS X 10.10.1 (14B25)
Report Version: 11
Anonymous UUID: 3887BB6D-7783-EBA5-C86C-FACE1C21094E
Sleep/Wake UUID: 9C9670EA-BBC7-4046-B544-F1CE3F184398
Time Awake Since Boot: 84000 seconds
Time Since Wake: 12000 seconds
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fb920f1ae80
VM Regions Near 0x7fb920f1ae80:
MALLOC_TINY 00007fb920d00000-00007fb920f00000 [ 2048K] rw-/rwx SM=PRV
--> MALLOC_TINY 00007fb920f00000-00007fb921000000 [ 1024K] rw-/rwx SM=COW
MALLOC_SMALL 00007fb921000000-00007fb921800000 [ 8192K] rw-/rwx SM=COW
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x00007fb920f1ae80 0 + 140433098387072
1 libwx_osx_cocoau_core-3.0.dylib 0x00000001075f6a26 wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl*) + 94
2 libwx_osx_cocoau_core-3.0.dylib 0x00000001075fabe2 wxGenericTreeCtrl::Delete(wxTreeItemId const&) + 264
3 libwx_osx_cocoau_core-3.0.dylib 0x00000001075fac64 wxGenericTreeCtrl::DeleteAllItems() + 40
4 libwx_osx_cocoau_core-3.0.dylib 0x00000001075f925c wxGenericTreeCtrl::~wxGenericTreeCtrl() + 102
5 libwx_osx_cocoau_core-3.0.dylib 0x000000010759f96b wxTreeCtrl::~wxTreeCtrl() + 15
6 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5da0 wxWindowBase::Destroy() + 40
7 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5e96 wxWindowBase::DestroyChildren() + 20
8 libwx_osx_cocoau_core-3.0.dylib 0x0000000107438d79 wxWindow::~wxWindow() + 215
9 libwx_osx_cocoau_core-3.0.dylib 0x00000001075effeb wxSplitterWindow::~wxSplitterWindow() + 15
10 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5da0 wxWindowBase::Destroy() + 40
11 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5e96 wxWindowBase::DestroyChildren() + 20
12 libwx_osx_cocoau_core-3.0.dylib 0x0000000107435121 wxNonOwnedWindow::~wxNonOwnedWindow() + 45
13 AromatherapyMapEditor 0x000000010739f913 MapeditFrame::~MapeditFrame() + 259 (frame.h:24)
14 AromatherapyMapEditor 0x000000010739e1f5 MapeditFrame::~MapeditFrame() + 21 (frame.h:24)
15 AromatherapyMapEditor 0x000000010739e219 MapeditFrame::~MapeditFrame() + 25 (frame.h:24)
16 libwx_baseu-3.0.dylib 0x000000010795ec72 wxAppConsoleBase::DeletePendingObjects() + 74
17 libwx_baseu-3.0.dylib 0x000000010795ebd3 wxAppConsoleBase::ProcessIdle() + 85
18 libwx_osx_cocoau_core-3.0.dylib 0x00000001074dcef6 wxAppBase::ProcessIdle() + 22
19 libwx_osx_cocoau_core-3.0.dylib 0x000000010746be5a wxApp::ProcessIdle() + 26
20 libwx_baseu-3.0.dylib 0x0000000107984faa wxEventLoopBase::ProcessIdle() + 28
21 libwx_baseu-3.0.dylib 0x0000000107a0d661 wxCFEventLoop::CommonModeObserverCallBack(__CFRunLoopObserver*, int) + 69
22 com.apple.CoreFoundation 0x00007fff8db02d87 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
23 com.apple.CoreFoundation 0x00007fff8db02ce0 __CFRunLoopDoObservers + 368
24 com.apple.CoreFoundation 0x00007fff8daf4f1a __CFRunLoopRun + 1178
25 com.apple.CoreFoundation 0x00007fff8daf4838 CFRunLoopRunSpecific + 296
26 com.apple.HIToolbox 0x00007fff926dd43f RunCurrentEventLoopInMode + 235
27 com.apple.HIToolbox 0x00007fff926dd1ba ReceiveNextEventCommon + 431
28 com.apple.HIToolbox 0x00007fff926dcffb _BlockUntilNextEventMatchingListInModeWithFilter + 71
29 com.apple.AppKit 0x00007fff8b6906d1 _DPSNextEvent + 964
30 com.apple.AppKit 0x00007fff8b68fe80 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
31 com.apple.AppKit 0x00007fff8b683e23 -[NSApplication run] + 594
32 libwx_osx_cocoau_core-3.0.dylib 0x00000001074bdd8c wxGUIEventLoop::OSXDoRun() + 106
33 libwx_baseu-3.0.dylib 0x0000000107a0db35 wxCFEventLoop::DoRun() + 39
34 libwx_baseu-3.0.dylib 0x0000000107984ed8 wxEventLoopBase::Run() + 88
35 libwx_baseu-3.0.dylib 0x000000010795ea04 wxAppConsoleBase::MainLoop() + 128
36 libwx_osx_cocoau_core-3.0.dylib 0x000000010746bea8 wxApp::OnRun() + 26
37 libwx_baseu-3.0.dylib 0x00000001079b33ae wxEntry(int&, wchar_t**) + 71
38 AromatherapyMapEditor 0x000000010738d706 main + 38 (main.cpp:15)
39 libdyld.dylib 0x00007fff916bf5c9 start + 1
Any suggestions? I'm not sure how to properly use wxTreeItemData because there's very little documentation on it. The docs say to make sure to initialize the struct with new, and I do, so I'm not sure why there's a problem.
That was quick. I figured out how to properly use wxTreeItemData: you have to subclass it, not just cast to it. The following client data class works:
class MapPtrCtr : public wxTreeItemData {
public:
Map* map;
MapPtrCtr(Map* map) : map(map) {}
};