“文件太多";Nexus 5/6棒棒糖错误 [英] "Too Many Files" Error On Nexus 5/6 Lollipop

查看:52
本文介绍了“文件太多";Nexus 5/6棒棒糖错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用cocos2dx-2.2.2.进行游戏项目.

当我执行一些操作(从文件中读取纹理并显示对话框)时,应用程序可能会强制关闭或屏幕将冻结(尽管网络线程仍在运行).

它偶尔发生在联系上,但很少在其他设备上发生.

日志如下:

  12-29 15:23:01.169:E/Surface(2128):queueBuffer:到SurfaceTexture -22的错误排队缓冲区12-29 15:23:01.169:W/Adreno-EGLSUB(2128):< SwapBuffers:1340> ;:未能排队缓冲12-29 15:23:01.169:W/Adreno-EGL(2128):< qeglDrvAPI_eglSwapBuffers:3809> ;: EGL_BAD_SURFACE12-29 15:23:01.204:E/Parcel(2128):Parcel :: writeDupFileDescriptor失败:12-29 15:23:01.204:E/Parcel(2128):fd = 1002标志= 0 err = 0(成功)12-29 15:23:01.204:E/Parcel(2128):dupFd = -1 dupErr = 24(打开的文件太多)标志= -1 err = 9(错误的文件编号)12-29 15:23:01.204:E/Parcel(175):dup在Parcel :: read中失败,fd 0之112-29 15:23:01.204:E/Parcel(175):dup(-2147483647)= -1 [错误:9(错误的文件号)]12-29 15:23:01.204:E/Parcel(175):fcntl(-2147483647,F_GETFD)= -1 [错误号:9(错误的文件号)]12-29 15:23:01.204:E/Parcel(175):固定0x0类型012-29 15:23:01.216:D/宗地(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 ::包裹*,无符号整数)+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 ::包裹*,无符号整数)+60)12-29 15:23:01.216:D/包裹(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/包裹(175):#08 pc 00023a5b/system/lib/libbinder.so12-29 15:23:01.216:D/宗地(175):#09 pc 000104d5/system/lib/libutils.so(android :: Thread :: _ threadLoop(void *)+ 112)12-29 15:23:01.216:D/包裹(175):#10 pc 00010045/system/lib/libutils.so12-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 9上使用).您是否正确关闭了要打开的FD?那是我的问题.

在我的特定情况下:1)我正在使用以下方法打开OpenSL的音频文件:

  AAssetManager_open 

2)使用

获取FD

  AAsset_openFileDescriptor 

3)在AAsset上调用 AAsset_close ,并使用FD.

问题在于没有相应的AAsset_closeFileDescriptor,也没有提及关闭FD.我最初写代码的时候觉得很奇怪,但是认为这是由以后的方法来处理的.但是,我的直觉是正确的,并且所有要做的就是在播放音频文件时打开越来越多的FD,但是直到达到内部限制时才释放它们.

我使用的解决方法是致电:

  close(fd); 

当我用完FD之后.您可以在

中找到close

  #include< fcntl.h> 

I'm currently working on a game project using cocos2dx-2.2.2.

When I do some operation(read textures from file and show a dialog), the application may force close or the screen will freeze(the network thread is still running though).

It happens on nexus occasionaly, but rarely happens on other devices.

the log is as follow:

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)

Any ideas where could possibly go wrong?

解决方案

That looks remarkably similar to the error I was getting. Mine was not specific to nexus (although I fixed it working on a Nexus 9). Are you properly closing a FD you are opening? That was my issue.

In my specific scenario: 1) I was opening audio files for OpenSL with:

AAssetManager_open

2) getting a FD with

AAsset_openFileDescriptor

3) calling AAsset_close on the AAsset, and using the FD.

The problem is there is no corresponding AAsset_closeFileDescriptor, nor mention of closing the FD. I thought it was odd when I originally wrote the code, but assumed that was handled by later methods. However my gut was right and all it was doing was opening more and more FD for audio files as I played them, but never releasing them until an internal limit was hit.

The fix I use is to call:

close(fd);

When I am done with the FD. You can find close in

#include <fcntl.h>

这篇关于“文件太多";Nexus 5/6棒棒糖错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆