3.8.7版本iOS原生闪退,CanvasRenderingContext2DDelegateImpl

请教下这个闪退可能是什么原因?像是TTF字体的闪退,

crash.txt.zip (4.2 KB)

Crashed: com.apple.main-thread
0 CoreFoundation 0x9c40 CFRelease + 44
1 CoreGraphics 0xcce4 CGGStateRelease + 96
2 CoreGraphics 0xcc70 CGGStackReset + 52
3 CoreGraphics 0xcbdc context_finalize + 112
4 CoreFoundation 0x25ec _CFRelease + 296
5 rollgame-mobile 0x2b1b14 -[CanvasRenderingContext2DDelegateImpl dealloc] + 1642628
6 rollgame-mobile 0x2b2834 cc::CanvasRenderingContext2DDelegate::~CanvasRenderingContext2DDelegate() + 1645988
7 rollgame-mobile 0x2b406c cc::CanvasRenderingContext2D::~CanvasRenderingContext2D() + 1652188
8 rollgame-mobile 0x2b4180 cc::CanvasRenderingContext2D::~CanvasRenderingContext2D() + 1652464
9 rollgame-mobile 0x10318c <deduplicated_symbol> + 4330992012
10 rollgame-mobile 0x10c8d8 se::Object::~Object() + 4331030744
11 rollgame-mobile 0xc02a98 v8::internal::GlobalHandles::InvokeFirstPassWeakCallbacks() + 2704460
12 rollgame-mobile 0xc4b064 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) + 3000856
13 rollgame-mobile 0xc48a18 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) + 2991052
14 rollgame-mobile 0xc48630 v8::internal::Heap::HandleGCRequest() + 2990052
15 rollgame-mobile 0xbf8e98 v8::internal::StackGuard::HandleInterrupts(v8::internal::StackGuard::InterruptLevel) + 2664524
16 rollgame-mobile 0xf5d8f0 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) + 6222500

请问如何复现,是否有demo?

1赞

Crashed: com.apple.main-thread
0 CoreFoundation 0x9c40 CFRelease + 44
1 CoreGraphics 0x9130 CGGStateSetFillColor + 56
2 CoreGraphics 0x9170 CGGStateReset + 32
3 CoreGraphics 0x8f84 CGGStateCreate + 100
4 CoreGraphics 0x8e28 CGGStackCreateWithGState + 76
5 CoreGraphics 0x8d2c CGContextCreateWithDelegateAndInfo + 172
6 CoreGraphics 0x14b2c bitmap_context_create + 80
7 CoreGraphics 0x53384 CGBitmapContextCreate + 28
8 rollgame-mobile 0x2b2578 -[CanvasRenderingContext2DDelegateImpl recreateBufferWithWidth:height:] + 1644360
9 rollgame-mobile 0x2b4ccc cc::CanvasRenderingContext2D::fetchData() + 1654428
10 rollgame-mobile 0x4c53ec js_cc_ICanvasRenderingContext2D_fetchData(se::State&) + 775460
11 rollgame-mobile 0x10c3f4 jsbFunctionWrapper(v8::FunctionCallbackInfov8::Value const&, bool ()(se::State&), char const) + 4305486836
12 rollgame-mobile 0x1075e14 Builtins_CallApiCallbackGeneric + 7368172
13 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
14 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
15 rollgame-mobile 0x11a105c Builtins_GetNamedPropertyHandler + 8593460
16 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
17 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
18 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
19 rollgame-mobile 0x107248c Builtins_JSEntryTrampoline + 7353444
20 rollgame-mobile 0x1072174 Builtins_JSEntry + 7352652
21 rollgame-mobile 0xbd6ac8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2521760
22 rollgame-mobile 0xbd63d4 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) + 2519980
23 rollgame-mobile 0xb09308 v8::Object::CallAsFunction(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value
) + 1680096
24 rollgame-mobile 0x10e00c se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value> const&, se::Object*, se::Value*) + 4305494028
25 rollgame-mobile 0x10c74c jsbConstructorWrapper(v8::FunctionCallbackInfov8::Value const&, bool ()(se::State&), void ()(se::Object*), se::Class*, char const*) + 4305487692
26 rollgame-mobile 0xb47530 v8::internal::MaybeHandlev8::internal::Object v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::FunctionTemplateInfo, v8::internal::Handlev8::internal::Object, unsigned long*, int) + 1934600
27 rollgame-mobile 0xb46e14 v8::internal::Builtin_HandleApiConstruct(int, unsigned long*, v8::internal::Isolate*) + 1932780
28 rollgame-mobile 0x10f9518 Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit + 7906544
29 rollgame-mobile 0x107185c Builtins_JSBuiltinsConstructStub + 7350324
30 rollgame-mobile 0x11acdf8 Builtins_ConstructHandler + 8642000
31 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
32 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
33 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
34 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
35 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
36 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
37 rollgame-mobile 0x107248c Builtins_JSEntryTrampoline + 7353444
38 rollgame-mobile 0x1072174 Builtins_JSEntry + 7352652
39 rollgame-mobile 0xbd6ac8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2521760
40 rollgame-mobile 0xbd63d4 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) + 2519980
41 rollgame-mobile 0xb09308 v8::Object::CallAsFunction(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value
) + 1680096
42 rollgame-mobile 0x1137a4 se::ScriptEngine::callFunction(se::Object*, char const*, unsigned int, se::Value*, se::Value*) + 4305516452
43 rollgame-mobile 0x16d4f8 registerOnActiveNode(cc::Node*)::$_0::__invoke(cc::Node*, bool) + 313032
44 rollgame-mobile 0x1c2a4c cc::Node::onHierarchyChangedBase(cc::Node*) + 662556
45 rollgame-mobile 0x1c3124 cc::Node::setParent(cc::Node*, bool) + 664308
46 rollgame-mobile 0x5b4250 js_cc_Node_setParent(se::State&) + 1753992
47 rollgame-mobile 0x10c3f4 jsbFunctionWrapper(v8::FunctionCallbackInfov8::Value const&, bool ()(se::State&), char const) + 4305486836
48 rollgame-mobile 0x1075e14 Builtins_CallApiCallbackGeneric + 7368172
49 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
50 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
51 rollgame-mobile 0x10bd33c Builtins_StoreIC + 7660308
52 rollgame-mobile 0x11a19b0 Builtins_SetNamedPropertyHandler + 8595848
53 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
54 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
55 rollgame-mobile 0x111153c Builtins_ArrayForEach + 8004884
56 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
57 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
58 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
59 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
60 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
61 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
62 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
63 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
64 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
65 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
66 rollgame-mobile 0x107248c Builtins_JSEntryTrampoline + 7353444
67 rollgame-mobile 0x1072174 Builtins_JSEntry + 7352652
68 rollgame-mobile 0xbd6ac8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2521760
69 rollgame-mobile 0xbd63d4 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) + 2519980
70 rollgame-mobile 0xb09308 v8::Object::CallAsFunction(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value
) + 1680096
71 rollgame-mobile 0x10e00c se::Object::call(std::__1::vector<se::Value, std::_1::allocatorse::Value> const&, se::Object*, se::Value*) + 4305494028
72 rollgame-mobile 0x105e30 cc::EventDispatcher::dispatchTickEvent(float) + 4305460784
73 rollgame-mobile 0x21f094 cc::events::Tick::broadcast(float) + 1040996
74 rollgame-mobile 0x21eef0 cc::Engine::tick() + 1040576
75 QuartzCore 0xbe924 CA::Display::DisplayLinkItem::dispatch
(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 64
76 QuartzCore 0x9bf38 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 880
77 QuartzCore 0xaf770 CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 360
78 UIKitCore 0x7dee4 _UIUpdateSequenceRunNext + 128
79 UIKitCore 0x7d374 schedulerStepScheduledMainSectionContinue + 60
80 UpdateCycle 0x1560 UC::DriverCore::continueProcessing() + 84
81 CoreFoundation 0x68f10 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28
82 CoreFoundation 0x68e84 __CFRunLoopDoSource0 + 172
83 CoreFoundation 0x46acc __CFRunLoopDoSources0 + 232
84 CoreFoundation 0x1d6d8 __CFRunLoopRun + 820
85 CoreFoundation 0x1ca6c _CFRunLoopRunSpecificWithOptions + 532
86 GraphicsServices 0x1498 GSEventRunModal + 120
87 UIKitCore 0x9ddf8 -[UIApplication _run] + 792
88 UIKitCore 0x46e54 UIApplicationMain + 336
89 rollgame-mobile 0x15534 main + 38 (main.mm:38)
90 ??? 0x19816ee28 (缺少)

Crashed: com.apple.main-thread
0 rollgame-mobile 0x38916c cc::render::RenderData::~RenderData() + 568616
1 rollgame-mobile 0x388cf0 std::__1::vector<cc::render::RenderData, boost::container::pmr::polymorphic_allocatorcc::render::RenderData>::__move_assign(std::__1::vector<cc::render::RenderData, boost::container::pmr::polymorphic_allocatorcc::render::RenderData>&, std::__1::integral_constant<bool, false>) + 567468
2 rollgame-mobile 0x37e684 cc::render::RenderGraph::operator=(cc::render::RenderGraph&&) + 524864
3 rollgame-mobile 0x37e4a8 cc::render::NativePipeline::beginSetup() + 524388
4 rollgame-mobile 0x598c18 js_cc_render_BasicPipeline_beginSetup(se::State&) + 1641808
5 rollgame-mobile 0x10c3f4 jsbFunctionWrapper(v8::FunctionCallbackInfov8::Value const&, bool ()(se::State&), char const) + 4307321844
6 rollgame-mobile 0x1075e14 Builtins_CallApiCallbackGeneric + 7368172
7 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
8 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
9 rollgame-mobile 0x107248c Builtins_JSEntryTrampoline + 7353444
10 rollgame-mobile 0x1072174 Builtins_JSEntry + 7352652
11 rollgame-mobile 0xbd6ac8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2521760
12 rollgame-mobile 0xbd63d4 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) + 2519980
13 rollgame-mobile 0xb09308 v8::Object::CallAsFunction(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value
) + 1680096
14 rollgame-mobile 0x10e00c se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value> const&, se::Object*, se::Value*) + 4307329036
15 rollgame-mobile 0x387894 cc::render::NativePipeline::render(std::__1::vector<cc::scene::Camera*, std::__1::allocatorcc::scene::Camera*> const&) + 562256
16 rollgame-mobile 0x18ee60 cc::Root::frameMoveEnd() + 450608
17 rollgame-mobile 0x5bc76c js_cc_Root_frameMove(se::State&) + 1788068
18 rollgame-mobile 0x10c3f4 jsbFunctionWrapper(v8::FunctionCallbackInfov8::Value const&, bool ()(se::State&), char const) + 4307321844
19 rollgame-mobile 0x1075e14 Builtins_CallApiCallbackGeneric + 7368172
20 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
21 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
22 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
23 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
24 rollgame-mobile 0x1074364 Builtins_InterpreterEntryTrampoline + 7361340
25 rollgame-mobile 0x107248c Builtins_JSEntryTrampoline + 7353444
26 rollgame-mobile 0x1072174 Builtins_JSEntry + 7352652
27 rollgame-mobile 0xbd6ac8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2521760
28 rollgame-mobile 0xbd63d4 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) + 2519980
29 rollgame-mobile 0xb09308 v8::Object::CallAsFunction(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value
) + 1680096
30 rollgame-mobile 0x10e00c se::Object::call(std::__1::vector<se::Value, std::_1::allocatorse::Value> const&, se::Object*, se::Value*) + 4307329036
31 rollgame-mobile 0x105e30 cc::EventDispatcher::dispatchTickEvent(float) + 4307295792
32 rollgame-mobile 0x21f094 cc::events::Tick::broadcast(float) + 1040996
33 rollgame-mobile 0x21eef0 cc::Engine::tick() + 1040576
34 QuartzCore 0xbe924 CA::Display::DisplayLinkItem::dispatch
(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 64
35 QuartzCore 0x9bf38 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 880
36 QuartzCore 0xaf770 CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 360
37 UIKitCore 0x7dee4 _UIUpdateSequenceRunNext + 128
38 UIKitCore 0x7d374 schedulerStepScheduledMainSectionContinue + 60
39 UpdateCycle 0x1560 UC::DriverCore::continueProcessing() + 84
40 CoreFoundation 0x68f10 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28
41 CoreFoundation 0x68e84 __CFRunLoopDoSource0 + 172
42 CoreFoundation 0x46acc __CFRunLoopDoSources0 + 232
43 CoreFoundation 0x1d6d8 __CFRunLoopRun + 820
44 CoreFoundation 0x1ca6c _CFRunLoopRunSpecificWithOptions + 532
45 GraphicsServices 0x1498 GSEventRunModal + 120
46 UIKitCore 0x9ddf8 -[UIApplication _run] + 792
47 UIKitCore 0x46e54 UIApplicationMain + 336
48 rollgame-mobile 0x15534 main + 38 (main.mm:38)
49 ??? 0x19816ee28 (缺少)

3.8.8原生iOS,现在有2个闪退,堆栈就是上面的,应该是野指针了,但是不知道怎么排查哪个对象什么时候被释放了?怎么和TS层对应起来呢?

大佬们给点排查建议吧

是否必现,怎么操作的?

要玩很久,大概20分钟-2小时才有可能会出,就是还没定位到?
像是某些节点被错误释放了,但是不知道怎么定位,想请教一些定位技巧。
怎么把这个闪退的类,和节点关联起来呢?

建议启用 Address Sanitizer 然后重新debug