Bad alloc


I have an application in opengl in which I create lots of framebuffer objects (more then 600 fbos)

When I try to delete them in my deconstructor the application crashes with this error message:

 *** glibc detected *** free(): invalid pointer: 0x087df9e8 *** 

deletion code:

glDeleteFramebuffersEXT(1, &m_fb);

The crash happens after I already deleted a couple of hundred of the fbos (always 226 to be precise).

But that’s not all, when I run the program a couple of times, I get this message:

 X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  128 (GLX)
  Minor opcode of failed request:  27 ()
  Serial number of failed request:  29
  Current serial number in output stream:  30 

Is this because some fbos are still locked on the GPU because they wheren’t properly deleted?
Restarting X fixes the problem, but when I run the program 3 times it returns.

Does anyone know what is happening here?
I’m using the 1.0-7664 drivers on a GeForce 6800

Thanks in advance

I might be totally wrong as I never used FBO. But let’s try.

Isn’t there any limit on the FBO you can create ? Doesn’t the spec tells about that ?
Also, as for almost any things, FBO are not ‘grattis’, they consume some amount of memory. I don’t know the nature of FBO, but since they are frame buffer, the memory for each one could be somewhat huge (about 1MB I guess). So, 600 FBO will tend to use 600 MB (if not more !).

Why do you want to use so much FBO at once ??

Hope that can helps.

Well, I’m performing some general purpose programming where each column of a matrix is stored in a texture.

I solved the problem by creating my inital data in an stl vector instead of standard c++ arrays. This has absolutely northing to do with OpengL I know, and I have no explanation for it. But know I can create more than 2000 fbos without problems.

Thanks for your suggestion though.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.