载入图片失败:error code is 998;模拟器oom崩溃

  • Creator 版本:2.4.4

  • 目标平台:windows系统的编辑器自带模拟器(mac系统无事)

  • 重现方式:载入图片必现

  • 首个报错:
    Simulator: Get data from file(C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//11/11432af9-fe80-4835-b637-9fcc795f93c4.png) failed, error code is 998
    Simulator: Get data from file(C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//1e/1e5e64ea-7f3e-4eb1-a6ab-93a327e1bd81.png) failed, error code is 998
    Simulator: libpng warning: iCCP: known incorrect sRGB profile
    Simulator: E/jswrapper (913): [ERROR] (f:\jenkins\workspace\creator_2d\cocos2d-x-lite\windows\cocos2d-x-lite\cocos\scripting\js-bindings\manual\jsb_global.cpp, 913): initWithImageFile: C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//11/11432af9-fe80-4835-b637-9fcc795f93c4.png failed!
    Simulator: E/jswrapper (913): [ERROR] (f:\jenkins\workspace\creator_2d\cocos2d-x-lite\windows\cocos2d-x-lite\cocos\scripting\js-bindings\manual\jsb_global.cpp, 913): initWithImageFile: C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//e1/e1d5a454-5092-4fe9-a950-3ab0790a48da.png failed!
    Simulator: E/jswrapper (316): [OOM ERROR] location: v8::ArrayBuffer::New, is heap out of memory: false
    Simulator: D/jswrapper (162): JS: [ERROR]: v8::ArrayBuffer::New is heap out of memory: false (no stack information)

  • 之前哪个版本是正常的:使用比较小的spine输出图片

求助一下,实在是不好找问题了。这个是cocos creator 2.4.4的windows模拟器报错。直接崩溃退出。但是在mac上并没观察到同样问题。

Simulator: Get data from file(C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//11/11432af9-fe80-4835-b637-9fcc795f93c4.png) failed, error code is 998
Simulator: Get data from file(C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//1e/1e5e64ea-7f3e-4eb1-a6ab-93a327e1bd81.png) failed, error code is 998

这个错误代码不知道是什么。猜测过是libpng的错误码,但是并没从libpng的源代码中搜索到,不管是十进制的998还是十六进制的3e6。

这些图片是Spine导出的很大的贴图文件,宽高有7k、8k那么高的分辨率。
之前通过检查工具,发现文件还存在格式问题:
ImageMagick读出来Expected 8 bytes; found 0 bytes问题
pngcheck检查出file doesn’t end with an IEND chunk问题
用Pillow做了修复,仍然会有同样的崩溃问题:

Simulator: libpng warning: iCCP: known incorrect sRGB profile
Simulator: E/jswrapper (913): [ERROR] (f:\jenkins\workspace\creator_2d\cocos2d-x-lite\windows\cocos2d-x-lite\cocos\scripting\js-bindings\manual\jsb_global.cpp, 913): initWithImageFile: C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//11/11432af9-fe80-4835-b637-9fcc795f93c4.png failed!
Simulator: E/jswrapper (913): [ERROR] (f:\jenkins\workspace\creator_2d\cocos2d-x-lite\windows\cocos2d-x-lite\cocos\scripting\js-bindings\manual\jsb_global.cpp, 913): initWithImageFile: C:/Project/SkyBox/BreezeGirl/Fugen/library/imports//e1/e1d5a454-5092-4fe9-a950-3ab0790a48da.png failed!
Simulator: E/jswrapper (316): [OOM ERROR] location: v8::ArrayBuffer::New, is heap out of memory: false
Simulator: D/jswrapper (162): JS: [ERROR]: v8::ArrayBuffer::New is heap out of memory: false (no stack information)

现在不明白为什么图片载入会失败,也不明白为什么会out of memory。
希望官方能够帮助一下。谢谢。我们会配合做调试和验证。