"Too Many Files" Nexus 5/6棒棒糖上的错误
"Too Many Files" Error On Nexus 5/6 Lollipop
我目前正在使用 cocos2dx-2.2.2 进行游戏项目。
当我做一些操作(从文件中读取纹理并显示对话框)时,应用程序可能会强制关闭或屏幕冻结(尽管网络线程仍在运行)。
它偶尔发生在联结上,但很少发生在其他设备上。
日志如下:
12-29 15:23:01.169: E/Surface(2128): queueBuffer: error queuing buffer to SurfaceTexture, -22
12-29 15:23:01.169: W/Adreno-EGLSUB(2128): <SwapBuffers:1340>: failed to queueBuffer
12-29 15:23:01.169: W/Adreno-EGL(2128): <qeglDrvAPI_eglSwapBuffers:3809>: EGL_BAD_SURFACE
12-29 15:23:01.204: E/Parcel(2128): Parcel::writeDupFileDescriptor failed:
12-29 15:23:01.204: E/Parcel(2128): fd=1002 flags=0 err=0(Success)
12-29 15:23:01.204: E/Parcel(2128): dupFd=-1 dupErr=24(Too many open files) flags=-1 err=9(Bad file number)
12-29 15:23:01.204: E/Parcel(175): dup failed in Parcel::read, fd 0 of 1
12-29 15:23:01.204: E/Parcel(175): dup(-2147483647) = -1 [errno: 9 (Bad file number)]
12-29 15:23:01.204: E/Parcel(175): fcntl(-2147483647, F_GETFD) = -1 [errno: 9 (Bad file number)]
12-29 15:23:01.204: E/Parcel(175): flat 0x0 type 0
12-29 15:23:01.216: D/Parcel(175): #00 pc 0000cff1 /system/lib/libutils.so (android::CallStack::update(int, int)+52)
12-29 15:23:01.216: D/Parcel(175): #01 pc 0000d107 /system/lib/libutils.so (android::CallStack::CallStack(char const*, int)+38)
12-29 15:23:01.216: D/Parcel(175): #02 pc 00023513 /system/lib/libbinder.so (android::Parcel::read(android::Parcel::FlattenableHelperInterface&) const+246)
12-29 15:23:01.216: D/Parcel(175): #03 pc 00033035 /system/lib/libgui.so (android::BnGraphicBufferProducer::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+568)
12-29 15:23:01.216: D/Parcel(175): #04 pc 0001a6d9 /system/lib/libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+60)
12-29 15:23:01.216: D/Parcel(175): #05 pc 0001f787 /system/lib/libbinder.so (android::IPCThreadState::executeCommand(int)+582)
12-29 15:23:01.216: D/Parcel(175): #06 pc 0001f8ab /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+38)
12-29 15:23:01.216: D/Parcel(175): #07 pc 0001f8ed /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48)
12-29 15:23:01.216: D/Parcel(175): #08 pc 00023a5b /system/lib/libbinder.so
12-29 15:23:01.216: D/Parcel(175): #09 pc 000104d5 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112)
12-29 15:23:01.216: D/Parcel(175): #10 pc 00010045 /system/lib/libutils.so
12-29 15:23:01.216: D/Parcel(175): #11 pc 000162e3 /system/lib/libc.so (__pthread_start(void*)+30)
12-29 15:23:01.216: D/Parcel(175): #12 pc 000142d3 /system/lib/libc.so (__start_thread+6)
任何想法可能出错?
这看起来与我遇到的错误非常相似。我的不是特定于nexus的(尽管我在Nexus 9上修复了它)。您是否正确关闭了要打开的FD?那是我的问题。
在我的特定场景中:1)我正在打开OpenSL的音频文件:
AAssetManager_open
2) 获得 FD
AAsset_openFileDescriptor
3) 在 AA 集合上调用AAsset_close
,并使用 FD。
问题是没有相应的AAsset_closeFileDescriptor,也没有提到关闭FD。当我最初编写代码时,我认为这很奇怪,但假设这是由后来的方法处理的。然而,我的直觉是对的,它所做的只是在我播放音频文件时打开越来越多的 FD,但在达到内部限制之前从未释放它们。
我使用的修复程序是调用:
close(fd);
当我完成FD时。你可以找到附近的
#include <fcntl.h>
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- Qt驱动器下拉列表仅列出USB记忆棒
- 如何在C++的帕斯卡三角形中打印曲棍球棒的元素?
- 地板与INT棒差
- 禁用USB棒的存储功能并自动启动您的程序
- 枚举映射对重构具有鲁棒性
- 如何知道棒切割算法中杆的所有切割长度?(动态规划)
- "Too Many Files" Nexus 5/6棒棒糖上的错误
- pthread_mutex_lock __pthread_mutex_lock_full:断言失败,具有鲁棒性和0x40
- 如何将控制器模拟棒映射到鼠标
- 无法在Android棉花糖上加载本机库,但可以在棒棒糖上使用
- 鲁棒,快速复杂多边形(带孔)三角测量c/c++库与许可许可
- Android棒棒糖从本机代码c++写入SD卡
- C++、点和线在2D中的位置对舍入误差和位置具有鲁棒性