makehumancommunity / makehuman

This is the main repository for the MakeHuman application as such.
http://www.makehumancommunity.org
Other
1.18k stars 244 forks source link

Segmentation fault on startup under Wayland #233

Open chuuko opened 9 months ago

chuuko commented 9 months ago

Issue MakeHuman crashes upon startup with a segmentation fault when run on Wayland. Expected behavior MakeHuman starts up without any issue System information System: Ubuntu 22.04.3 MH version: latest master branch revision (reported as 1.2.1) Python version: 3.10.12 Qt version: 5.15.3 Display server: Wayland Log


VERSION: HEAD:c28443c2
SHORT VERSION: alpha
LONG VERSION: 1.2.0 alpha (HEAD:c28443c2)
BASEMESH VERSION: hm08
IS BUILT (FROZEN): No
IS RELEASE VERSION: No
DEFAULT ENCODING: utf-8
FILESYSTEM ENCODING: utf-8
STDOUT ENCODING: utf-8
LOCALE PREFERRED ENCODING: UTF-8
WORKING DIRECTORY: /home/user/makehuman-master/makehuman
HOME LOCATION: /home/user/Documents
PYTHON PATH: ./:./lib:./apps:./shared:./apps/gui:./core:/home/user/makehuman-master/makehuman:/usr/lib/python310.zip:/usr/lib/python3.10:/usr/lib/python3.10/lib-dynload:/usr/local/lib/python3.10/dist-packages:/usr/local/lib/python3.10/dist-packages/fildem-2.0.1-py3.10.egg:/usr/lib/python3/dist-packages
DLL PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
SYS.VERSION: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
SYS.PLATFORM: linux
SYS.EXECUTABLE: /usr/bin/python3
PLATFORM.MACHINE: x86_64
PLATFORM.PROCESSOR: x86_64
PLATFORM.UNAME.RELEASE: 6.2.0-26-generic
PLATFORM.LINUX_DISTRIBUTION: Ubuntu 22.04 Jammy Jellyfish
NUMPY.VERSION: 1.21.5
Loaded libGL.so => libGL.so.1 <CDLL 'libGL.so.1', handle 564add053cb0 at 0x7f89dfb868c0>
No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
Loaded libGLU.so => libGLU.so.1 <CDLL 'libGLU.so.1', handle 564add07af00 at 0x7f89dfb870d0>
QT.VERSION: 5.15.3
QT.JPG_SUPPORT: supported
QT.SVG_SUPPORT: supported
QT.PLUGIN_PATH: /usr/lib/x86_64-linux-gnu/qt5/plugins:/usr/bin
QT.PLUGIN_PATH_ENV: 
QT.CONF: NOT PRESENT
PYOPENGL.VERSION: 3.1.5
NOSHADERS: not set
NOSAMPLEBUFFERS: not set
GL.VENDOR: Intel
GL.RENDERER: Mesa Intel(R) UHD Graphics 600 (GLK 2)
GL.VERSION: 4.6 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~22.04.1
4.60
GLSL.VERSION: 4.60
GL.EXTENSION: GL_ARB_multisample not available (0x samples)
Creating new texture for image data/textures/texture_notfound.png.
GL.EXTENSION: GL_ARB_texture_non_power_of_two not available
initTexture: 256, 256, False
Setting language to english
Setting language to english
Initializing default theme first.
Theme default version 1.2.0
Loaded theme data/themes/default.mht
Using Qt system style oxygen
Loading human
Loading binary mesh data/3dobjs/base.npz.
NPZ-File: maxmimum number of faces for one vertex: 5
Loading material from file data/skins/default.mhmat
Shader: adding built-in uniform b'gl_NormalMatrix'
Shader: adding built-in uniform b'gl_ModelViewProjectionMatrix'
VectorUniform(AdditiveShading) = [0.]
VectorUniform(AdditiveShading) = [0.]
Loaded vertex weights MakeHuman weights from file /home/user/makehuman-master/makehuman/data/rigs/default_weights.mhw
Loading scene
Loading scene file: data/scenes/default.mhscene
Loading main GUI
Assigning setting loaddir value /home/user/Documents/makehuman/v1py3/models that was loaded before the setting was declared.
Assigning setting savedir value /home/user/Documents/makehuman/v1py3/models that was loaded before the setting was declared.
Assigning setting exportdir value /home/user/Documents/makehuman/v1py3/exports that was loaded before the setting was declared.
Loading plugins
Importing plugin 0_modeling_0_modifiers
Imported plugin 0_modeling_0_modifiers
Loading plugin 0_modeling_0_modifiers
Loading modifiers from data/modifiers/modeling_modifiers.json
Attempting to load targets from NPZ file.
1258 targets loaded from NPZ file succesfully.
Loaded 249 modifiers from file data/modifiers/modeling_modifiers.json
Loaded 249 modifier descriptions from file data/modifiers/modeling_modifiers_desc.json
Loaded plugin 0_modeling_0_modifiers
Importing plugin 0_modeling_1_bodyshapes
Imported plugin 0_modeling_1_bodyshapes
Loading plugin 0_modeling_1_bodyshapes
Loading modifiers from data/modifiers/bodyshapes_modifiers.json
missing target bodyshapes-bodyshapes-elvs-fem-apple
missing target bodyshapes-bodyshapes-elvs-fem-diamond
missing target bodyshapes-bodyshapes-elvs-fem-full-hourglass
missing target bodyshapes-bodyshapes-elvs-fem-neat-hourglass
missing target bodyshapes-bodyshapes-elvs-fem-invert-triangle
missing target bodyshapes-bodyshapes-elvs-fem-lean-column
missing target bodyshapes-bodyshapes-elvs-fem-rectangle
missing target bodyshapes-bodyshapes-elvs-fem-triangle
missing target bodyshapes-bodyshapes-elvs-fem-adrenal
missing target bodyshapes-bodyshapes-elvs-fem-liver
missing target bodyshapes-bodyshapes-elvs-fem-ovary
missing target bodyshapes-bodyshapes-elvs-fem-thyroid
missing target bodyshapes-bodyshapes-elvs-man-apple
missing target bodyshapes-bodyshapes-elvs-man-rectangle
missing target bodyshapes-bodyshapes-elvs-man-lean-column
missing target bodyshapes-bodyshapes-elvs-man-triangle
missing target bodyshapes-bodyshapes-elvs-man-invert-triangle
missing target bodyshapes-bodyshapes-elvs-man-trapezoid
missing target bodyshapes-bodyshapes-elvs-man-adrenal
missing target bodyshapes-bodyshapes-elvs-man-liver
missing target bodyshapes-bodyshapes-elvs-man-gonadal
missing target bodyshapes-bodyshapes-elvs-man-thyroid
Loaded 22 modifiers from file data/modifiers/bodyshapes_modifiers.json
Loaded 22 modifier descriptions from file data/modifiers/bodyshapes_modifiers_desc.json
Loaded plugin 0_modeling_1_bodyshapes
Importing plugin 0_modeling_8_random
Imported plugin 0_modeling_8_random
Loading plugin 0_modeling_8_random
Loaded plugin 0_modeling_8_random
Importing plugin 0_modeling_9_custom_targets
Imported plugin 0_modeling_9_custom_targets
Loading plugin 0_modeling_9_custom_targets
Loaded plugin 0_modeling_9_custom_targets
Importing plugin 0_modeling_a_measurement
Imported plugin 0_modeling_a_measurement
Loading plugin 0_modeling_a_measurement
Loading modifiers from data/modifiers/measurement_modifiers.json
Loaded 20 modifiers from file data/modifiers/measurement_modifiers.json
Loaded 20 modifier descriptions from file data/modifiers/measurement_modifiers_desc.json
Loaded plugin 0_modeling_a_measurement
Importing plugin 0_modeling_background
Imported plugin 0_modeling_background
Loading plugin 0_modeling_background
Loaded plugin 0_modeling_background
Importing plugin 1_convert_model_tags
Imported plugin 1_convert_model_tags
Loading plugin 1_convert_model_tags
Loaded plugin 1_convert_model_tags
Importing plugin 1_mhapi
Imported plugin 1_mhapi
Loading plugin 1_mhapi
Loaded plugin 1_mhapi
Importing plugin 2_foot_posing
Imported plugin 2_foot_posing
Loading plugin 2_foot_posing
Loaded plugin 2_foot_posing
Importing plugin 2_posing_expression
Imported plugin 2_posing_expression
Loading plugin 2_posing_expression
Loaded plugin 2_posing_expression
Importing plugin 3_libraries_animation
Imported plugin 3_libraries_animation
Loading plugin 3_libraries_animation
Loaded plugin 3_libraries_animation
Importing plugin 3_libraries_clothes_chooser
Imported plugin 3_libraries_clothes_chooser
Loading plugin 3_libraries_clothes_chooser
Loaded plugin 3_libraries_clothes_chooser
Importing plugin 3_libraries_eye_chooser
Imported plugin 3_libraries_eye_chooser
Loading plugin 3_libraries_eye_chooser
According to mh.getSysDataPath here's high poly eyes data/eyes/high-poly/high-poly.mhclo
Selecting proxy file "data/eyes/high-poly/high-poly.mhclo" from eyes library.
Loading binary proxy data/eyes/high-poly/high-poly.mhpxy.
Loading proxy file: data/eyes/high-poly/high-poly.mhpxy.
Loading material from file /home/user/makehuman-master/makehuman/data/eyes/materials/brown.mhmat
Shader: adding built-in uniform b'gl_NormalMatrix'
Shader: adding built-in uniform b'gl_ModelViewProjectionMatrix'
VectorUniform(AdditiveShading) = [0.]
VectorUniform(AdditiveShading) = [0.]
Loading binary mesh /home/user/makehuman-master/makehuman/data/eyes/high-poly/high-poly.npz.
NPZ-File: maxmimum number of faces for one vertex: 4
remapping weights for proxy HighPolyEyes
remapping weights for HighPolyEyes took 0.06212 seconds
Loaded plugin 3_libraries_eye_chooser
Importing plugin 3_libraries_eyebrows
Imported plugin 3_libraries_eyebrows
Loading plugin 3_libraries_eyebrows
Loaded plugin 3_libraries_eyebrows
Importing plugin 3_libraries_eyelashes
Imported plugin 3_libraries_eyelashes
Loading plugin 3_libraries_eyelashes
Loaded plugin 3_libraries_eyelashes
Importing plugin 3_libraries_material_chooser
Imported plugin 3_libraries_material_chooser
Loading plugin 3_libraries_material_chooser
Loaded plugin 3_libraries_material_chooser
Importing plugin 3_libraries_polygon_hair_chooser
Imported plugin 3_libraries_polygon_hair_chooser
Loading plugin 3_libraries_polygon_hair_chooser
Loaded plugin 3_libraries_polygon_hair_chooser
Importing plugin 3_libraries_pose
Imported plugin 3_libraries_pose
Loading plugin 3_libraries_pose
Loaded plugin 3_libraries_pose
Importing plugin 3_libraries_proxy_chooser
Imported plugin 3_libraries_proxy_chooser
Loading plugin 3_libraries_proxy_chooser
Loaded plugin 3_libraries_proxy_chooser
Importing plugin 3_libraries_skeleton
Imported plugin 3_libraries_skeleton
Loading plugin 3_libraries_skeleton
Loaded plugin 3_libraries_skeleton
Importing plugin 3_libraries_teeth
Imported plugin 3_libraries_teeth
Loading plugin 3_libraries_teeth
Loaded plugin 3_libraries_teeth
Importing plugin 3_libraries_tongue
Imported plugin 3_libraries_tongue
Loading plugin 3_libraries_tongue
Loaded plugin 3_libraries_tongue
Importing plugin 4_rendering_9_viewer
Imported plugin 4_rendering_9_viewer
Loading plugin 4_rendering_9_viewer
Loaded plugin 4_rendering_9_viewer
Importing plugin 4_rendering_opengl
Imported plugin 4_rendering_opengl
Loading plugin 4_rendering_opengl
Assigning setting rendering_width value 800 that was loaded before the setting was declared.
Assigning setting rendering_height value 600 that was loaded before the setting was declared.
Assigning setting GL_RENDERER_SSS value False that was loaded before the setting was declared.
Assigning setting GL_RENDERER_AA value True that was loaded before the setting was declared.
Loaded plugin 4_rendering_opengl
Importing plugin 4_rendering_scene
Imported plugin 4_rendering_scene
Loading plugin 4_rendering_scene
Setting rendering_width is already declared. Adding it again has no effect.
Setting rendering_height is already declared. Adding it again has no effect.
Loaded plugin 4_rendering_scene
Importing plugin 5_settings_0_settings
Imported plugin 5_settings_0_settings
Loading plugin 5_settings_0_settings
Setting language to english
Theme makehuman version 1.2.0
Loaded theme data/themes/makehuman.mht
Loaded Qt style data/themes/makehuman.qss
Loaded plugin 5_settings_0_settings
Importing plugin 5_settings_mouse
Imported plugin 5_settings_mouse
Loading plugin 5_settings_mouse
Loaded plugin 5_settings_mouse
Importing plugin 5_settings_shortcuts
Imported plugin 5_settings_shortcuts
Loading plugin 5_settings_shortcuts
Loaded plugin 5_settings_shortcuts
Importing plugin 5_settings_userplugins
Imported plugin 5_settings_userplugins
Loading plugin 5_settings_userplugins
Loaded plugin 5_settings_userplugins
Importing plugin 6_help
Imported plugin 6_help
Loading plugin 6_help
Loaded plugin 6_help
Importing plugin 7_data
Imported plugin 7_data
Loading plugin 7_data
Loaded plugin 7_data
Importing plugin 7_example
Imported plugin 7_example
Loading plugin 7_example
Loaded plugin 7_example
Importing plugin 7_expression_mixer
Imported plugin 7_expression_mixer
Loading plugin 7_expression_mixer
Loaded plugin 7_expression_mixer
Importing plugin 7_logging
Imported plugin 7_logging
Loading plugin 7_logging
Loaded plugin 7_logging
Importing plugin 7_material_editor
Imported plugin 7_material_editor
Loading plugin 7_material_editor
Loaded plugin 7_material_editor
Importing plugin 7_profile
Imported plugin 7_profile
Loading plugin 7_profile
Loaded plugin 7_profile
Importing plugin 7_save_targets
Imported plugin 7_save_targets
Loading plugin 7_save_targets
Loaded plugin 7_save_targets
Importing plugin 7_scene_editor
Imported plugin 7_scene_editor
Loading plugin 7_scene_editor
Setting rendering_width is already declared. Adding it again has no effect.
Setting rendering_height is already declared. Adding it again has no effect.
Loaded plugin 7_scene_editor
Importing plugin 7_scripting
Imported plugin 7_scripting
Loading plugin 7_scripting
Loaded plugin 7_scripting
Importing plugin 7_shell
Imported plugin 7_shell
Loading plugin 7_shell
Loaded plugin 7_shell
Importing plugin 7_targets
Imported plugin 7_targets
Loading plugin 7_targets
Loaded plugin 7_targets
Importing plugin 8_asset_downloader
Imported plugin 8_asset_downloader
Loading plugin 8_asset_downloader
Loaded plugin 8_asset_downloader
Importing plugin 8_server_socket
Imported plugin 8_server_socket
Loading plugin 8_server_socket
Loaded plugin 8_server_socket
Importing plugin 9_export_bvh
Imported plugin 9_export_bvh
Loading plugin 9_export_bvh
Loaded plugin 9_export_bvh
Importing plugin 9_export_collada
Imported plugin 9_export_collada
Loading plugin 9_export_collada
Loaded plugin 9_export_collada
Importing plugin 9_export_fbx
Imported plugin 9_export_fbx
Loading plugin 9_export_fbx
Loaded plugin 9_export_fbx
Importing plugin 9_export_light
Imported plugin 9_export_light
Loading plugin 9_export_light
Loaded plugin 9_export_light
Importing plugin 9_export_obj
Imported plugin 9_export_obj
Loading plugin 9_export_obj
Loaded plugin 9_export_obj
Importing plugin 9_export_ogre
Imported plugin 9_export_ogre
Loading plugin 9_export_ogre
Loaded plugin 9_export_ogre
Importing plugin 9_export_stl
Imported plugin 9_export_stl
Loading plugin 9_export_stl
Loaded plugin 9_export_stl
Importing plugin 9_export_uvmap
Imported plugin 9_export_uvmap
Loading plugin 9_export_uvmap
Loaded plugin 9_export_uvmap
Importing plugin 9_massproduce
Imported plugin 9_massproduce
Loading plugin 9_massproduce
Loaded plugin 9_massproduce
Loading GUI
showing category Modelling
showing task Macro modelling
Loading theme
Theme makehuman version 1.2.0
Loaded theme data/themes/makehuman.mht
Loaded Qt style data/themes/makehuman.qss
Applying targets
Updating skeleton joint positions
Done baking animations
Loading macro targets
Loading done

libpng warning: iCCP: known incorrect sRGB profile
gl.reshape
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/OpenGL/latebind.py", line 43, in __call__
    return self._finalCall( *args, **named )
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/makehuman-master/makehuman/./lib/glmodule.py", line 243, in reshape
    updatePickingBuffer()
  File "/home/user/makehuman-master/makehuman/./lib/glmodule.py", line 155, in updatePickingBuffer
    drawMeshes(True)
  File "/home/user/makehuman-master/makehuman/./lib/glmodule.py", line 1041, in drawMeshes
    drawOrPick(pickMode, obj)
  File "/home/user/makehuman-master/makehuman/./lib/glmodule.py", line 681, in drawOrPick
    obj.pick()
  File "/home/user/makehuman-master/makehuman/./lib/object3d.py", line 290, in pick
    return glmodule.pickMesh(self, *args, **kwargs)
  File "/home/user/makehuman-master/makehuman/./lib/glmodule.py", line 652, in pickMesh
    glVertexPointer(3, GL_FLOAT, 0, obj.verts)
  File "/usr/lib/python3/dist-packages/OpenGL/latebind.py", line 47, in __call__
    return self._finalCall( *args, **named )
  File "/usr/lib/python3/dist-packages/OpenGL/wrapper.py", line 818, in wrapperCall
    storeValues(
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/arrayhelpers.py", line 156, in __call__
    contextdata.setValue( self.constant, pyArgs[self.pointerIndex] )
  File "/usr/lib/python3/dist-packages/OpenGL/contextdata.py", line 58, in setValue
    context = getContext( context )
  File "/usr/lib/python3/dist-packages/OpenGL/contextdata.py", line 40, in getContext
    raise error.Error(
OpenGL.error.Error: Attempt to retrieve context when no valid context
qt.qpa.backingstore: composeAndFlush: makeCurrent() failed
./makehuman: line 6: 261431 Segmentation fault    (core dumped) python3 makehuman.py "$@"```
joepal1976 commented 9 months ago

This seems like a problem between Qt and the OpenGL subsystem in your graphics card drivers. Can you check if any of these suggestions work? (specifically starting with the argument "--noshaders").

It looks as if you are using Mesa3d as graphics driver for your intel card. Maybe you used a more specific driver before cleaning up?

chuuko commented 9 months ago

The noshaders option didn't work and the drivers/modules for Intel GPUs are present on my system. However, I managed to find out that the segfaults happen only on Wayland. MH doesn't encounter this issue when run under an X11 session.

Aranuvir commented 6 days ago

Does Qt5/PyQt5 provide any Wayland support?

black-punkduck commented 2 days ago

latebind.py unfortunately very often returns with a NoneType, this seems to be one of the most famous messages for OpenGL. Just google for it and check how often in returns a NoneType ... :(

Here my example: .. in new version I get exactly this error after loading a character and when I want to do a render in a background-buffer. No matter what gl-Command, the first one throws an exception. After pressing render button again it works. It also renders exactly the same character when it is added as an argument like makehuman mychar.mhm

we often say that is wayland, but I think it is more a conflict between Qt5/OpenGL ... (in my version PySide6 + OpenGL).

It could be some kind of synchronization or openGL context error ... in my case the character is loaded asynchronously (QThread) like in old makehuman as well. I must block openGL as long as the load command is running otherwise the slightest change of perspective will crash the application.

But I think we also start old makehuman like this? Because this behaviour allows to change the progress bar? It would be a similarity. When you check latebind.py ... that's a stupid wrapper which does not do much.

If it is not started with a QThread the render of my "pre-loaded" character works. If I find sth. what fixes my problem, it could also fix this "wayland" one.

black-punkduck commented 19 hours ago

Unfortunately I have no wayland .. @Aranuvir can you check which command really crashes the box (in lib/glmodule, lines 229-..) ?

try:
        # Prevent a division by zero when minimising the window
        if h == 0:
            h = 1
        # Set the drawable region of the window
        glViewport(0, 0, w, h)
        # set up the projection matrix
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()

        # go back to modelview matrix so we can move the objects about
        glMatrixMode(GL_MODELVIEW)

        updatePickingBuffer()
except: 

I do not like that at all, encapsulation of a bunch of commands really helps in case of error :( Can you please try without the "try/except"?

If the glViewport command already fails it could be a missing context.

In my case (see above, same error but total different situation) I did the following:

        try:
            gl.glGetIntegerv(gl.GL_MAJOR_VERSION, '*')
        except:
            print ("idc ... try again ;)")

That might look ridiculous, but fixed my problem. So asking for a stupid integer seems to "wake up" GL again statement here would be:

glGetIntegerv(G.GL_MAJOR_VERSION, '*')