hbirchtree / coffeecutie

A C++ game engine/rendering engine
MIT License
5 stars 0 forks source link

Android app runs out of surfaces #261

Closed hbirchtree closed 6 years ago

hbirchtree commented 6 years ago

Error is:

E Parcel  : fcntl(F_DUPFD_CLOEXEC) failed in Parcel::read, i is 0, fds[i] is 90, fd_count is 1, error: Unknown error 2147483647
E Surface : queueBuffer: error queuing buffer to SurfaceTexture, -22
I Adreno  : QueueBuffer: queueBuffer failed
E Coffee  : Got EGL error on swap: 0x3000

App is now explicitly killed when the bug occurs.

hbirchtree commented 6 years ago

Turns out that file handles were running out, because some weren't closed

Agericube commented 5 years ago

Hello, I have the quite the same issue but I can't found what's make the error. I have values that I display on graphic but randomly sometimes my app crashes after certain amount of time (30 secondes, 5 minutes, sometimes never it depends) Someone have an idea ?

Error :

E/Parcel: fcntl(F_DUPFD_CLOEXEC) failed in Parcel::read, i is 0, fds[i] is 0, fd_count is 1, error: Unknown error 2147483647 E/BufferQueueProducer: queueBuffer: fence is NULL E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -22 I/OpenGLRenderer: Checking abandoned swapBuffers I/OpenGLRenderer: Surface query width is 1920 A/OpenGLRenderer: Encountered EGL error 12291 EGL_BAD_ALLOC during rendering A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 21619 (RenderThread), pid 21591

hbirchtree commented 5 years ago

Hey @Agericube, From my understanding of the problem, the application is running out of POSIX file handles. Android's native EGL implementation uses POSIX file handles for communication with the OS, and creates new ones on each frame being rendered.

In the case of this project, file handles were created (and not closed) at a slow enough rate that it wouldn't occur in seconds, but after 5 to 20 minutes (depending on the application).

Is your application using Android NDK's native_app_glue?

Agericube commented 5 years ago

Thank you for your quick answer @hbirchtree , it is very helpful !!

And no, my application doesn't use Android NDK's native_app_glue, why ?