Re: [PyOpenGL-Users] access violation exception from glInterleavedArrays
Brought to you by:
mcfletch
From: Alejandro S. <as...@gm...> - 2011-01-05 01:31:34
|
Hello Andrew, On Tue, Jan 4, 2011 at 7:31 PM, Merrill, Andrew <Mer...@ca...> wrote: > I am attempting to use glInterleavedArrays, and encountering intermittent > access violation exceptions. When I run my program, it will run fine most > of the time. However, some of the time it will immediately exit with the > following traceback: > > > > Traceback (most recent call last): > > File "C:\Users\merrilla\Documents\Python\3d\crash-test.py", line 67, in > <module> > > animate() > > File "C:\Users\merrilla\Documents\Python\3d\crash-test.py", line 62, in > animate > > shape.draw() > > File "C:\Users\merrilla\Documents\Python\3d\crash-test.py", line 49, in > draw > > glInterleavedArrays(GL_C3F_V3F, 0, None) > > File "C:\Python26\lib\site-packages\OpenGL\latebind.py", line 45, in > __call__ > > return self._finalCall( *args, **named ) > > File "C:\Python26\lib\site-packages\OpenGL\wrapper.py", line 1217, in > wrapperCall > > result = self.wrappedOperation( *cArguments ) > > WindowsError: exception: access violation writing 0x05F89C5C > > > > I get this error about 10-20% of the times that I run the program. If the > error occurs, it occurs immediately; I’ve never seen the program run for a > while and then produce this error. > > > > I’m using PyOpenGl 3.0.1 with Python 2.6.6 on a Windows 7 (32 bit) system. > The OpenGL version is 3.0.0. > > > > I’ve attached the program source code. > > > > If you have any ideas about what is happening here, I would greatly > appreciate any help you can provide. > >From reading your mail I got the feeling you might be provoking a segmentation fault somewhere. I've taken a look at your code and there are several things that could be causing a problem like this. Now, I wasn't able to reproduce the crash (Mac OS X 10.6.5, PyOpenGL 3.0.1), but you may want to check this things just in case. 1) When calling glInterleavedArrays, you are supplying "None" as the pointer to the beginning of the data. This might be OK, but what you really want is a pointer equal to 0x0. I would suggest importing ctypes and using c_void_p(0) instead. 2) I noticed you are using "dataArray = OpenGL.arrays.lists.ListHandler().asArray(dataList, GL_FLOAT)" to create a linear memory array with the contents of the python list with the data. You might want to try using numpy arrays instead as in "dataArray = numpy.array(dataList, dtype=numpy.float32)" and then casting the array to void*. 3) Finally, I ran into issues with VBO's myself using PyOpenGL 3.0.0. This was, apparently, becaus of a bug in that version. I would suggest you update to 3.0.1 and see if the issue persists. I've passed the Python interpreter through Valgrind while running your code and it didn't report any access violations, so this makes me lean towards #3, but I would also check the other two. Good luck! Alejandro.- ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, > and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- Alejandro Segovia Azapian Director, Algorithmia: Visualization & Acceleration http://web.algorithmia.net |