2.1.0 iOS原生包渲染层出错

  • Creator 版本:2.1.0

  • 目标平台: iOS

  • 详细报错信息,包含调用堆栈:

在 JSB_glFlushCommand里出现了handledCommandCount和commandCount不相等的错误. 如下:

Assertion failed: (handledCommandCount == commandCount), function JSB_glFlushCommand, file /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_opengl_manual.cpp, line 4856.

` #4 0x00000001023ff588 in JSB_glFlushCommand(se::State&) at /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_opengl_manual.cpp:4856

5 0x00000001023fabb8 in JSB_glFlushCommandRegistry(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) at /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_opengl_manual.cpp:4860

#6 0x0000000223813aa4 in long long JSC::APICallbackFunction::callJSC::JSCallbackFunction(JSC::ExecState*) ()
#7 0x00000002237f19d8 in llint_entry ()
#8 0x00000002237efcb4 in llint_entry ()
#9 0x00000002237efcb4 in llint_entry ()
#10 0x00000002237efcb4 in llint_entry ()
#11 0x00000002237efcb4 in llint_entry ()
#12 0x00000002237efd54 in llint_entry ()
#13 0x00000002237efcb4 in llint_entry ()
#14 0x00000002237efcb4 in llint_entry ()
#15 0x00000002237efcb4 in llint_entry ()
#16 0x00000002237efcb4 in llint_entry ()
#17 0x00000002237db7fc in vmEntryToJavaScript ()
#18 0x0000000223d0d770 in JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#19 0x0000000223eef528 in JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#20 0x0000000223820b24 in JSObjectCallAsFunction ()
#21 0x000000010220fbb0 in se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value > const&, se::Object*, se::Value*) at /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/scripting/js-bindings/jswrapper/jsc/Object.mm:498
#22 0x0000000102393068 in cocos2d::EventDispatcher::dispatchTickEvent(float) at /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/scripting/js-bindings/event/EventDispatcher.cpp:282
#23 0x0000000102189a88 in ::-MainLoop doCaller: at /Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/ios/CCApplication-ios.mm:188
#24 0x000000010387c9fc in -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] ()
#25 0x0000000220848f90 in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()
#26 0x000000021c71d4b0 in IODispatchCalloutFromCFMessage ()
#27 0x000000021c42ca8c in __CFMachPortPerform ()
#28 0x000000021c453690 in CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION ()
#29 0x000000021c452ddc in __CFRunLoopDoSource1 ()
#30 0x000000021c44dc00 in __CFRunLoopRun ()
#31 0x000000021c44d0b0 in CFRunLoopRunSpecific ()
#32 0x000000021e64d79c in GSEventRunModal ()
#33 0x0000000248dc7978 in UIApplicationMain ()
#34 0x000000010215f1a0 in main at /Users/Wayne/Documents/Workspaces/Cocos/ZClient/ZClient/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/main.m:8
#35 0x000000021bf128e0 in start ()
`

  • 重现方式:想做一个小包失败了, 目前只能在项目工程包中出现

  • 手机型号 :iPhone 7

  • 编辑器操作系统 :MacOS Mojave

  • 编辑器之前是否有其它报错 :无

  • 出现概率:必现

  • 额外线索:使用了FairyGUI

请问解决了吗

是 JSC 上跑 Promise 的 异步问题导致的,参考下这个帖子
https://forum.cocos.com/t/2-2-0-ios-bug-jsc-await-promise-mircotasks/83275

谢谢哈,但是我的问题不是这个,是有内存泄露,升到2.2.0 测试版就没了

你的问题是这个

就是链接描述的问题引起的,跟引擎无关,帖子里有提供规避方法。