On Tue, Jan 4, 2011 at 7:31 PM, Merrill, Andrew <MerrillA@...> 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
> File "C:\Users\merrilla\Documents\Python\3d\crash-test.py", line 62, in
> File "C:\Users\merrilla\Documents\Python\3d\crash-test.py", line 49, in
> glInterleavedArrays(GL_C3F_V3F, 0, None)
> File "C:\Python26\lib\site-packages\OpenGL\latebind.py", line 45, in
> return self._finalCall( *args, **named )
> File "C:\Python26\lib\site-packages\OpenGL\wrapper.py", line 1217, in
> 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
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
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
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.
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> PyOpenGL Homepage
> PyOpenGL-Users mailing list
Alejandro Segovia Azapian
Director, Algorithmia: Visualization & Acceleration