SebKuzminsky / pycam

Other
342 stars 101 forks source link

Segmentation fault with libfreeglut 3.0.0 #92

Open antohami opened 6 years ago

antohami commented 6 years ago

Hi! When running with libfreeglut-3.0.0 installed, I get a segmentation fault (in the attachment). When using libGLUT-8.0.1 - it works fine. Problem on versions 6.x strace_pycam.txt

sumpfralle commented 6 years ago

Thank you for sharing this information!

Recently pycam switched from the old GTK2/OpenGL library (gtkglext) to GTK3 and GLArea. Thus the problem probably went away. But I would suggest to leave this issue open, until someone confirms that the current master branch works with freeglut-3.0.0 (I cannot test this, since I have only 2.8.1 installed).

antohami commented 6 years ago

I checked how it works from the master branch. And with libfreeglut-3.0.0 and c libGLUT I get:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pycam/Plugins/OpenGLWindow.py", line 677, in paint
    self.glsetup()
  File "/usr/lib/python2.7/site-packages/pycam/Plugins/OpenGLWindow.py", line 454, in glsetup
    GL.glShadeModel(GL.GL_SMOOTH)
  File "errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src/errorchecker.c:1218)
OpenGL.error.GLError: GLError(
    err = 1282,
    description = 'invalid operation',
    baseOperation = glShadeModel,
    cArguments = (GL_SMOOTH,)
)
sumpfralle commented 6 years ago

Thank you for taking a look at master!

I do not know too much about OpenGL (just enough for fixing trivial things). Do you think that your hardware is well supported?

Could you try to check if the following approach in pycam/Plugins/OpenGLWindow.py around line 454 works for you? (you need to take care for proper indentation)

try:
    GL.glShadeModel(GL.GL_SMOOTH)
except:
    pass

Do you see visual problems after this change?

antohami commented 6 years ago

Do you see visual problems after this change?

Yes, visual artifacts instead of the image.

Do you think that your hardware is well supported?

Radeon HD7340, Mesa 17.2.6. Support OpenGL 3.3.

Could you try to check if the following approach in pycam/Plugins/OpenGLWindow.py around line 454 works for you? (you need to take care for proper indentation)

try: GL.glShadeModel(GL.GL_SMOOTH) except: pass

Did. Another error now:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pycam/Plugins/OpenGLWindow.py", line 680, in paint
    self.glsetup()
  File "/usr/lib/python2.7/site-packages/pycam/Plugins/OpenGLWindow.py", line 460, in glsetup
    GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST)
  File "errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src/errorchecker.c:1218)
OpenGL.error.GLError: GLError(
    err = 1280,
    description = 'invalid enumerant',
    baseOperation = glHint,
    cArguments = (
        GL_PERSPECTIVE_CORRECTION_HINT,
        GL_NICEST,
    )
)

Same visual artifacts instead of the image.

sumpfralle commented 6 years ago

Radeon HD7340, Mesa 17.2.6. Support OpenGL 3.3.

I cannot judge this, but let's just assume, it is well supported.

Did. Another error now:

If you are in the mood for digging around: please add more try/except clauses around the problematic line above (and all lines that will throw errors later on).

If you manage to get it running and the visualization is somehow usable, then we could integrate these conditional operations into the code.

antohami commented 6 years ago

If you are in the mood for digging around: please add more try/except clauses around the problematic line above (and all lines that will throw errors later on).

If you manage to get it running and the visualization is somehow usable, then we could integrate these conditional operations into the code.

Did. Now just a black screen without an image. Probably, it was predictable. I will try on other computers.

sumpfralle commented 6 years ago

Just a thought: could you try to follow this recommendation: https://github.com/SebKuzminsky/pycam/issues/97#issuecomment-354177779?