coin3d / coin

Coin3D core library
BSD 3-Clause "New" or "Revised" License
288 stars 109 forks source link

config.h.cmake.in incomplete: crash on Windows 7, AMD FirePro M4170 #153

Closed VolkerEnderlein closed 6 years ago

VolkerEnderlein commented 6 years ago

Original report by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).


Our program crashes consistently upon use of certain functions on very few installations of Windows, since using the CMake build.

Using a debug build, the assertion on row 3380 of src\glue\gl.cpp fails, for glue->glNormalPointer. After setting set COIN_DEBUG_GLGLUE=1, we see the following errors:

Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glPolygonOffset==00000000
Coin info in coin_glglue_extension_available(): extension 'GL_EXT_polygon_offset' is NOT present
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glGenTextures==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glBindTexture==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glDeleteTextures==00000000
Coin info in coin_glglue_extension_available(): extension 'GL_EXT_texture_object' is present
Coin info in cc_glglue_getprocaddress(): glGenTexturesEXT==547F14F8
Coin info in cc_glglue_getprocaddress(): glBindTextureEXT==547F13A8
Coin info in cc_glglue_getprocaddress(): glDeleteTexturesEXT==547F14E8
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glTexSubImage2D==00000000
Coin info in coin_glglue_extension_available(): extension 'GL_EXT_subtexture' is present
Coin info in cc_glglue_getprocaddress(): glTexSubImage2DEXT==547F1548
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glPushClientAttrib==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glPopClientAttrib==00000000

and

Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glVertexPointer==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glTexCoordPointer==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glNormalPointer==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glColorPointer==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glIndexPointer==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glEnableClientState==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glDisableClientState==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glInterleavedArrays==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glDrawArrays==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glDrawElements==00000000
Coin warning in coin_wgl_getprocaddress(): couldn't get hold of any workable module handle for picking up OpenGL symbols
Coin info in cc_glglue_getprocaddress(): glArrayElement==00000000

These are generated in src\glue\gl_wgl.cpp:coin_wgl_getprocaddress() and indicate that there is a problem in src\glue\dl.cpp:cc_dl_handle_with_gl_symbols().

The problem, I presume, is that if cc_dl_process_handle() fails, cc_dl_coin_handle() and cc_dl_opengl_handle() are tried, which default to using POSIX library names; unless they have actually been defined correctly in config.h. The erroneous defines in this case are

#define COIN_SYSTEM_LIBRARY_NAME "libCoin.so"
#define DYNAMIC_LIBRARY_EXTENSION ".so"
#define OPENGL_SYSTEM_LIBRARY_NAME "libGL.so"

Do grep -r OPENGL_SYSTEM_LIBRARY_NAME * in the Coin root directory to find correct defines for various platforms.

To me it seems these are not the only defines that have not yet been ported to CMake.

VolkerEnderlein commented 6 years ago

Original comment by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).


Fixed in https://bitbucket.org/Coin3D/coin/pull-requests/114/.