LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.78k stars 1.14k forks source link

OpenGL error messages at startup cause error messages #1599

Closed smoe closed 1 year ago

smoe commented 2 years ago

Here are the steps I follow to reproduce the issue:

  1. install Debian bullseye
  2. run linuxcnc
  3. press "OK" (cancel is fine)

This is what I expected to happen:

no idea, it is the first time I started this

This is what happened instead:

$ linuxcnc LINUXCNC - 2.9.0~pre0 Machine configuration directory is '/home/moeller/linuxcnc/configs/sim.axis-1' Machine configuration file is 'axis_mm.ini' Starting LinuxCNC... Found file(lib): /usr/share/linuxcnc/hallib/core_sim.hal Note: Using POSIX non-realtime Found file(lib): /usr/share/linuxcnc/hallib/sim_spindle_encoder.hal Found file(lib): /usr/share/linuxcnc/hallib/axis_manualtoolchange.hal Found file(lib): /usr/share/linuxcnc/hallib/simulated_home.hal PYTHON: exception during 'this' export: TypeError: 'Boost.Python.class' object is not iterable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "", line 1007, in _find_and_load

File "", line 986, in _find_and_load_unlocked

File "", line 666, in _load_unlocked

File "", line 565, in module_from_spec

File "", line 763, in create_module

SystemError: _PyEval_EvalFrameDefault returned a result with an error set

link (updating variable file): Datei oder Verzeichnis nicht gefunden note: MAXV max: 53.340 units/sec 3200.400 units/min note: LJOG max: 53.340 units/sec 3200.400 units/min note: LJOG default: 30.480 units/sec 1828.800 units/min note: jog_order='XYZ' note: jog_invert=set() PYTHON: exception during 'this' export: TypeError: No Python class registered for C++ class Interp

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 "/usr/bin/axis", line 3979, in commands.set_view_p() File "/usr/bin/axis", line 2181, in set_view_p o.set_view_p() File "/usr/lib/python3/dist-packages/glnav.py", line 448, in set_view_p glRotateScene(self, 1.0, mid[0], mid[1], mid[2], 0, 0, 0, 0) File "/usr/lib/python3/dist-packages/glnav.py", line 116, in glRotateScene mat = glGetDoublev(GL_MODELVIEW_MATRIX) 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 668, in wrapperCall cArgs = tuple(calculate_cArgs( pyArgs )) File "/usr/lib/python3/dist-packages/OpenGL/wrapper.py", line 471, in calculate_cArgs yield converter( pyArgs, index, self ) File "/usr/lib/python3/dist-packages/OpenGL/converters.py", line 251, in call return super( SizedOutputOrInput,self ).call( pyArgs, index, baseOperation ) File "/usr/lib/python3/dist-packages/OpenGL/converters.py", line 196, in call return self.arrayType.zeros( self.getSize(pyArgs) ) File "/usr/lib/python3/dist-packages/OpenGL/arrays/arraydatatype.py", line 177, in zeros return cls.returnHandler().zeros( dims, typeCode or cls.typeConstant ) File "/usr/lib/python3/dist-packages/OpenGL/arrays/arraydatatype.py", line 80, in get_output_handler self.output_handler = self.handler_by_plugin_name( preferred ) File "/usr/lib/python3/dist-packages/OpenGL/arrays/arraydatatype.py", line 67, in handler_by_plugin_name return plugin.load() File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 16, in load return importByName( self.import_path ) File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 38, in importByName module = import( ".".join(moduleName), {}, {}, moduleName) File "/usr/lib/python3/dist-packages/OpenGL/arrays/numpymodule.py", line 12, in import numpy File "/usr/lib/python3/dist-packages/numpy/init.py", line 150, in from . import core File "/usr/lib/python3/dist-packages/numpy/core/init.py", line 22, in from . import multiarray File "/usr/lib/python3/dist-packages/numpy/core/multiarray.py", line 12, in from . import overrides File "/usr/lib/python3/dist-packages/numpy/core/overrides.py", line 7, in from numpy.core._multiarray_umath import ( TypeError: ("'Boost.Python.class' object is not iterable", 'Failure in cConverter <OpenGL.converters.SizedOutputOrInput object at 0x7fda4a4b9cc0>', (GL_MODELVIEW_MATRIX, <object object at 0x7fda4afecd40>), 1, <OpenGL.platform.baseplatform.glGetDoublev object at 0x7fda4a48c280>) Shutting down and cleaning up LinuxCNC... task: 1763 cycles, min=0.000007, max=0.005435, avg=0.001065, 0 latency excursions (> 10x expected cycle time of 0.001000s) Note: Using POSIX non-realtime

Information about my hardware and software:

No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux bookworm/sid Release: unstable Codename: sid

Linux x230 5.15.0-3-amd64 #1 SMP Debian 5.15.15-2 (2022-01-30) x86_64 GNU/Linux

A recent master, the bug has been reported also for the RPi.

Just the linuxcnc application started from the home directory - KDE.

Nothing attached. Just a blank laptop, not even running a realtime module.

SebKuzminsky commented 2 years ago

The linuxcnc logs you've included indicate that this bug is in the Axis GUI.

Are you running bullseye (like it says at the top) or bookworm/sid (like it says in the lsb_release output)? From your kernel i'm guessing bookworm/sid.

I can not reproduce this on my bullseye machine.

I've got libboost-python1.74.0 (1.74.0-9) and python3.9 (3.9.2-1), in case that's relevant...

smoe commented 2 years ago

You are right. My laptop runs unstable. That is interesting observation. It is libboost-python1.74-dev and both python 3.9 and python 3.10 for me. Once we continue the process to upload to Debian then any such failure would be the first impression for the folks on unstable (and likely also bookworm if we allow the package to migrate there).

smoe commented 2 years ago

Packages should not reside longer in unstable than 5 days, so except for the very latest uploads bookworm(==testing) and sid (==unstable) are the same. The release of bullseye indeed is six months ago now, but we get anything backported to bullseye only when it has reached testing. Should you happen to have an immediate idea about what I could do to help figuring out what the problem is - please tell me.

anubhav-cs commented 2 years ago

I just happened to run across this issue while looking to debug a Boost C++ library. I was able to reproduce this for my application - it arises when I import a boost python extension in python3.9 which was built using libboostpython310. As such, it works fine with python3.10. I rebuilt the module using libboostpython39 and now it works fine with both 3.9 and 3.10.

smoe commented 2 years ago

@anubhav-cs Thank you for your detective work and for spreading the news. I do not yet know what the consequence for LinuxCNC should be.

smoe commented 2 years ago

I fail to get it to run, still.

smoe commented 2 years ago

Above PR got a nice comment by @dwrobel pointing to Python 3.10 only systems for which there is no problem.

smoe commented 1 year ago

The error surfaces again, this time in reaction to an OpenGL context.

note: LJOG     max: 53.340 units/sec 3200.400 units/min
note: LJOG default: 30.480 units/sec 1828.800 units/min
note: jog_order='XYZ'
note: jog_invert=set()
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 "/usr/bin/axis", line 3964, in <module>
    get_coordinate_font(vars.dro_large_font.get())
  File "/usr/bin/axis", line 3842, in get_coordinate_font
    glnav.use_pango_font(coordinate_font, 0, 128)
  File "/usr/lib/python3/dist-packages/glnav.py", line 65, in use_pango_font
    glBitmap(0, 0, 0, 0, 0, h-d, ''.encode())
  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 700, in wrapperCall
    raise err
  File "/usr/lib/python3/dist-packages/OpenGL/wrapper.py", line 693, in wrapperCall
    result = wrappedOperation( *cArguments )
  File "/usr/lib/python3/dist-packages/OpenGL/platform/baseplatform.py", line 415, in __call__
    return self( *args, **named )
  File "/usr/lib/python3/dist-packages/OpenGL/error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.error.GLError: GLError(
        err = 1285,
        description = b'out of memory',
        baseOperation = glBitmap,
        pyArgs = (0, 0, 0, 0, 0, 14.0, b''),
        cArgs = (0, 0, 0, 0, 0, 14.0, b''),
        cArguments = (0, 0, 0, 0, 0, 14.0, b'')
)
Shutting down and cleaning up LinuxCNC...
task: 1849 cycles, min=0.000011, max=0.005185, avg=0.001068, 0 latency excursions (> 10x expected cycle time of 0.001000s)
Note: Using POSIX realtime
LinuxCNC terminated with an error.  You can find more information in the log:
    /home/moeller/linuxcnc_debug.txt
and
    /home/moeller/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal

So, the display of the error is what triggers the bigger error message. Ideas anyone?

This is with Debian unstable, both the official Debian package and a freshly rebuilt one. Could trigger the error with AXIS and GMOCCAP, not with TkLinuxCNC.

smoe commented 1 year ago
moeller@x230:~/Github/linuxcnc$ cat ~/linuxcnc_print.txt 
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
INIFILE=/home/moeller/linuxcnc/configs/sim.axis/axis_mm.ini
VERSION=1.1
PARAMETER_FILE=sim_mm.var
TPMOD=
HOMEMOD=
TASK=milltask
HALUI=halui
DISPLAY=axis
COORDINATES=X Y Z
KINEMATICS=trivkins
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Starting TASK program: milltask
Starting DISPLAY program: axis
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
moeller@x230:~/Github/linuxcnc$ cat ~/linuxcnc_debug.txt 
91930
91976
Stopping realtime threads
Unloading hal components
smoe commented 1 year ago

I could apparently fix this by

diff --git a/lib/python/glnav.py b/lib/python/glnav.py
index 4c3ffe4279..392d7a061c 100644
--- a/lib/python/glnav.py
+++ b/lib/python/glnav.py
@@ -62,7 +62,7 @@ def use_pango_font(font, start, count, will_call_prepost=False):
         context.restore()
         w, h = int(w / Pango.SCALE), int(h / Pango.SCALE)
         glNewList(base+i, GL_COMPILE)
-        glBitmap(0, 0, 0, 0, 0, h-d, ''.encode())
+        #TEST#glBitmap(0, 0, 0, 0, 0, h-d, ''.encode())
         #glDrawPixels(0, 0, 0, 0, 0, h-d, '');
         if not will_call_prepost:
             pango_font_pre()
@@ -73,7 +73,7 @@ def use_pango_font(font, start, count, will_call_prepost=False):
             except Exception as e:
                 print("glnav Exception ",e)

-        glBitmap(0, 0, 0, 0, w, -h+d, ''.encode())
+        #TEST#glBitmap(0, 0, 0, 0, w, -h+d, ''.encode())
         if not will_call_prepost:
             pango_font_post()
         glEndList()

but do not really know what I am doing (not doing) with that patch.

smoe commented 1 year ago

@hansu could you please have a look? This fixes both AXIS and GMOCCAPY for me on Debian unstable and likely also the bookworm-based LiveCD.

hansu commented 1 year ago

I am a bit confused. Does this occur when you running Bookworm or Bullseye?

smoe commented 1 year ago

I have not tried Bullseye. But I get that error with the self-created bookworm-based LiveCD (or an error very much like it) and what I reported here was with my Debian unstable (sid, which is just 5 days ahead of bookworm, typically) laptop.

hansu commented 1 year ago

I encounter no problems running AXIS on a fresh Bookworm install. But there are problems

smoe commented 1 year ago

Judging from the logs, is that forum-reported error prior or post the problem I had reported? I had the hunch that it looks like prior but that cannot be since AXIS is working for you. Hm.

hansu commented 1 year ago

Not sure if this is related to you OpenGL error.

But the error I get when running configure seems related to https://github.com/LinuxCNC/linuxcnc/pull/1619

smoe commented 1 year ago

Hm. Python 11 is among the versions checked. We should at some point skype and share screens. That live usb distro is another means that I thought we should use more for such debugging.

petterreinholdtsen commented 1 year ago

I ran into this error to. I can trigger it every time on my updated Bookworm installation.

Here is the relevant part of the output from linuxcnc:

xhc-hb04.tcl: Using existing outpin signame: spindle-vel-cmd-rps-abs note: MAXV max: 500.000 units/sec 30000.000 units/min note: LJOG max: 500.000 units/sec 30000.000 units/min note: LJOG default: 500.000 units/sec 30000.000 units/min note: jog_order='XYZ' note: jog_invert=set() 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 "/usr/bin/axis", line 3960, in get_coordinate_font(vars.dro_large_font.get()) File "/usr/bin/axis", line 3838, in get_coordinate_font glnav.use_pango_font(coordinate_font, 0, 128) File "/usr/lib/python3/dist-packages/glnav.py", line 65, in use_pango_font glBitmap(0, 0, 0, 0, 0, h-d, ''.encode()) 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 700, in wrapperCall raise err File "/usr/lib/python3/dist-packages/OpenGL/wrapper.py", line 693, in wrapperCall result = wrappedOperation( cArguments ) File "/usr/lib/python3/dist-packages/OpenGL/platform/baseplatform.py", line 415, in call return self( args, named ) File "/usr/lib/python3/dist-packages/OpenGL/error.py", line 230, in glCheckError raise self._errorClass( OpenGL.error.GLError: GLError( err = 1285, description = b'out of memory', baseOperation = glBitmap, pyArgs = (0, 0, 0, 0, 0, 14.0, b''), cArgs = (0, 0, 0, 0, 0, 14.0, b''), cArguments = (0, 0, 0, 0, 0, 14.0, b'') ) Shutting down and cleaning up LinuxCNC...

-- Happy hacking Petter Reinholdtsen

petterreinholdtsen commented 1 year ago

[Petter Reinholdtsen]

I ran into this error to. I can trigger it every time on my updated Bookworm installation.

To rule out memory fragmentation, I rebooted the machine in question to see if the error went away, and it stayed the same.

Sebastian mentioned on IRC that this might be related to the existance of two different versions of python installed. I got both python3.10 and python3.11 installed. Trying to remove either of them will also remove linuxcnc-uspace (and others like freecad), so just removing the "redundant" python version do not seem like the correct solution. The output of 'apt-mark showmanual' in the machine in question list these packages: "acpid apt-file emacs etckeeper firmware-amd-graphics firmware-linux-free firmware-misc-nonfree firmware-realtek freecad ifupdown iputils-ping isenkram-cli libnss-myhostname linux-image-rt-amd64 linuxcnc-uspace locales lsof lvm2 memtest86+ nano needrestart nullmailer openssh-client openssh-server popularity-contest procps sitesummary-client sudo task-english task-xfce-desktop tmux unattended-upgrades vim-tiny". I hope others can reproduce the problem in Bookworm by installing the same set of packages.

-- Happy hacking Petter Reinholdtsen

ve7it commented 1 year ago

I had a similar opengl out of memory error on the linuxcnc-sim package for arch linux. It turns out if you have intel builtin graphics, they have broken the latest libraries. I fixed my system by installing mesa-amber and lib32-mesa-amber packages to support my 2013 vintage i7 box.

This may help with the opengl out of memory errors on intel graphics systems.

see below for discussion: https://aur.archlinux.org/packages/linuxcnc-sim

cheers Lawrence VE7IT

On 1/6/23 13:22, petterreinholdtsen wrote:

I ran into this error to. I can trigger it every time on my updated Bookworm installation.

Here is the relevant part of the output from linuxcnc:

xhc-hb04.tcl: Using existing outpin signame: spindle-vel-cmd-rps-abs note: MAXV max: 500.000 units/sec 30000.000 units/min note: LJOG max: 500.000 units/sec 30000.000 units/min note: LJOG default: 500.000 units/sec 30000.000 units/min note: jog_order='XYZ' note: jog_invert=set() 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 "/usr/bin/axis", line 3960, in get_coordinate_font(vars.dro_large_font.get()) File "/usr/bin/axis", line 3838, in get_coordinate_font glnav.use_pango_font(coordinate_font, 0, 128) File "/usr/lib/python3/dist-packages/glnav.py", line 65, in use_pango_font glBitmap(0, 0, 0, 0, 0, h-d, ''.encode()) 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 700, in wrapperCall raise err File "/usr/lib/python3/dist-packages/OpenGL/wrapper.py", line 693, in wrapperCall result = wrappedOperation( cArguments ) File "/usr/lib/python3/dist-packages/OpenGL/platform/baseplatform.py", line 415, in call return self( args, named ) File "/usr/lib/python3/dist-packages/OpenGL/error.py", line 230, in glCheckError raise self._errorClass( OpenGL.error.GLError: GLError( err = 1285, description = b'out of memory', baseOperation = glBitmap, pyArgs = (0, 0, 0, 0, 0, 14.0, b''), cArgs = (0, 0, 0, 0, 0, 14.0, b''), cArguments = (0, 0, 0, 0, 0, 14.0, b'') ) Shutting down and cleaning up LinuxCNC...

-- Happy hacking Petter Reinholdtsen

— Reply to this email directly, view it on GitHub https://github.com/LinuxCNC/linuxcnc/issues/1599#issuecomment-1374146728, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF7T6QECRIFR3URPPI3VALWRCEIVANCNFSM5OHTXREQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

petterreinholdtsen commented 1 year ago

[Lawrence Glaister]

I had a similar opengl out of memory error on the linuxcnc-sim package for arch linux. It turns out if you have intel builtin graphics, they have broken the latest libraries. I fixed my system by installing mesa-amber and lib32-mesa-amber packages to support my 2013 vintage i7 box.

I am on Debian and indeed lspci show this VGA entry on my HP ProDesk 600 G2 SFF from 2015:

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)

I find no mesa-amber related package from Debian, but find it in <URL: https://archlinux.org/packages/extra/x86_64/mesa-amber/ >. I guess it might have a different name in Debian.p

I guess this should be reported as a bug against some driver package. Just need to track down which. :)

see below for discussion: https://aur.archlinux.org/packages/linuxcnc-sim

Thank you a lot of this pointer.

-- Happy hacking Petter Reinholdtsen

petterreinholdtsen commented 1 year ago

[Petter Reinholdtsen]

I am on Debian and indeed lspci show this VGA entry on my HP ProDesk 600 G2 SFF from 2015:

In case this was related to the amount of video memory, I tested visiting the BIOS setup and changing the amount reserved from 32 MB to 512 MB, without any change.

-- Happy hacking Petter Reinholdtsen

smoe commented 1 year ago

@petterreinholdtsen , can you confirm that commenting out those two lines as described in https://github.com/LinuxCNC/linuxcnc/issues/1599#issuecomment-1365303941 does fix it?

petterreinholdtsen commented 1 year ago

[Steffen Möller]

@petterreinholdtsen , can you confirm that commenting out those two lines as described in https://github.com/LinuxCNC/linuxcnc/issues/1599#issuecomment-1365303941 does fix it?

Not really. I have no idea what those lines do nor what the effect is from commenting them out. Do you know this?

Are you just talking about avoiding the crash when you say 'fix it'? I did not test so far, as I want to understand where the error is. I guess some intel related X driver, but am unsure.

-- Happy hacking Petter Reinholdtsen

smoe commented 1 year ago

 

The glBitmap expects a pointer to a bitmap https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glBitmap.xml and that last argument apparently fails to get converted. The max effect of commenting out that invocation that I see is that the bitmap is not shown. Over here everthing looked just fine without those bitmaps. If that is indeed the problem then we can likely find a way to derive a minimal program to discuss with others outside of LinuxCNC, so I would very much like to get a confirmation that this is indeed the culprit and nothing else.

 

Gesendet: Montag, 09. Januar 2023 um 10:47 Uhr Von: "petterreinholdtsen" @.> An: "LinuxCNC/linuxcnc" @.> Cc: "Steffen Möller" @.>, "State change" @.> Betreff: Re: [LinuxCNC/linuxcnc] OpenGL error messages at startup cause error messages (Issue #1599)

 

[Steffen Möller]

@petterreinholdtsen , can you confirm that commenting out those two lines as described in https://github.com/LinuxCNC/linuxcnc/issues/1599#issuecomment-1365303941 does fix it?

Not really. I have no idea what those lines do nor what the effect is from commenting them out. Do you know this?

Are you just talking about avoiding the crash when you say 'fix it'? I did not test so far, as I want to understand where the error is. I guess some intel related X driver, but am unsure.

 

 

Message ID: @.***>

antbarney commented 1 year ago

I have also started hitting this recently, on my system a cheap Intel Celeron based Mini PC running bookworm + LCNC 2.9

I did comment out those 2 glBitmap references and this allows Axis to load successfully. This system was working up until earlier last week, so my guess is there was some update that triggered things, but I did not pay attention when doing updates to know what was recently updated/installed.

The glBitmap expects a pointer to a bitmap https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glBitmap.xml and that last argument apparently fails to get converted. The max effect of commenting out that invocation that I see is that the bitmap is not shown. Over here everthing looked just fine without those bitmaps. If that is indeed the problem then we can likely find a way to derive a minimal program to discuss with others outside of LinuxCNC, so I would very much like to get a confirmation that this is indeed the culprit and nothing else.   Gesendet: Montag, 09. Januar 2023 um 10:47 Uhr Von: "petterreinholdtsen" @.> An: "LinuxCNC/linuxcnc" @.> Cc: "Steffen Möller" @.>, "State change" @.> Betreff: Re: [LinuxCNC/linuxcnc] OpenGL error messages at startup cause error messages (Issue #1599)   [Steffen Möller] @petterreinholdtsen , can you confirm that commenting out those two lines as described in #1599 (comment) does fix it? Not really. I have no idea what those lines do nor what the effect is from commenting them out. Do you know this? Are you just talking about avoiding the crash when you say 'fix it'? I did not test so far, as I want to understand where the error is. I guess some intel related X driver, but am unsure.     Message ID: @.***>

smoe commented 1 year ago

The error message is also reported on https://stackoverflow.com/questions/56767373/how-to-blit-a-png-image-as-an-image-overlay-in-pyopengl but I fail to understand the (the relevance of the) answer.

petterreinholdtsen commented 1 year ago

[Anthony Barney]

I have also started hitting this recently, on my system a cheap Intel Celeron based Mini PC running bookworm + LCNC 2.9

Perhaps you can find likely candidates causing this by looking in /var/log/dpkg.log or /var/log/apt/history.log? My test machine had been left alone for too long for me to find any useful information in those files. -- Happy hacking Petter Reinholdtsen

smoe commented 1 year ago

It is some unknown difference between bookworm and bullseye. I have just brought https://github.com/LinuxCNC/linuxcnc/pull/2259 on its way, suggesting to introduce FIXMEs and see how it goes.

jethornton commented 1 year ago

I also started having this problem on bookworm after an update the other day.

jethornton commented 1 year ago

I updated my repo, checked out 2.9, commented out the two calls to glBitmap, built a deb then installed it and now on Bookworm Axis loads.

antbarney commented 1 year ago

what I do notice is that, yes this gets Axis to start and run the DRO on the preview tab looks to be broken. Screenshot at 2023-01-11 16-04-11

antbarney commented 1 year ago

[Anthony Barney] I have also started hitting this recently, on my system a cheap Intel Celeron based Mini PC running bookworm + LCNC 2.9 Perhaps you can find likely candidates causing this by looking in /var/log/dpkg.log or /var/log/apt/history.log? My test machine had been left alone for too long for me to find any useful information in those files. -- Happy hacking Petter Reinholdtsen

this machine was roughly in the same boat, there was a large number of updates that got installed at once and can't find anything useful in those files either.

NTULINUX commented 1 year ago

I posted this to the mailing list, didn't see this issue until now. Same problem here on Gentoo:

LINUXCNC - 2.10.0~pre0 Machine configuration directory is '/home/ntu/linuxcnc/configs/sim.axis-2' Machine configuration file is 'axis.ini' Starting LinuxCNC... linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod Note: Using POSIX non-realtime Found file(lib): /usr/share/linuxcnc/hallib/core_sim.hal Found file(lib): /usr/share/linuxcnc/hallib/sim_spindle_encoder.hal Found file(lib): /usr/share/linuxcnc/hallib/axis_manualtoolchange.hal Found file(lib): /usr/share/linuxcnc/hallib/simulated_home.hal Found file(lib): /usr/share/linuxcnc/hallib/check_xyz_constraints.hal note: MAXV max: 5.000 units/sec 300.000 units/min note: LJOG max: 5.000 units/sec 300.000 units/min note: LJOG default: 0.250 units/sec 15.000 units/min note: jog_order='XYZ' note: jog_invert=set() Traceback (most recent call last): File "/usr/lib/python3.10/site-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 "/usr/bin/axis", line 3964, in get_coordinate_font(vars.dro_large_font.get()) File "/usr/bin/axis", line 3842, in get_coordinate_font glnav.use_pango_font(coordinate_font, 0, 128) File "/usr/lib/python3.10/site-packages/glnav.py", line 65, in use_pango_font glBitmap(0, 0, 0, 0, 0, h-d, ''.encode()) File "/usr/lib/python3.10/site-packages/OpenGL/latebind.py", line 47, in call return self._finalCall( *args, named ) File "/usr/lib/python3.10/site-packages/OpenGL/wrapper.py", line 700, in wrapperCall raise err File "/usr/lib/python3.10/site-packages/OpenGL/wrapper.py", line 693, in wrapperCall result = wrappedOperation( cArguments ) File "/usr/lib/python3.10/site-packages/OpenGL/platform/baseplatform.py", line 415, in call return self( args, named ) File "/usr/lib/python3.10/site-packages/OpenGL/error.py", line 230, in glCheckError raise self._errorClass( OpenGL.error.GLError: GLError( err = 1285, description = b'out of memory', baseOperation = glBitmap, pyArgs = (0, 0, 0, 0, 0, 13.0, b''), cArgs = (0, 0, 0, 0, 0, 13.0, b''), cArguments = (0, 0, 0, 0, 0, 13.0, b'') ) Shutting down and cleaning up LinuxCNC... task: 477 cycles, min=0.000004, max=0.001061, avg=0.001017, 0 latency excursions (> 10x expected cycle time of 0.001000s) Note: Using POSIX non-realtime LinuxCNC terminated with an error. You can find more information in the log:

rodw-au commented 1 year ago

This should be resolved by #2264 if you are running on the Default Debian Desktop which runs on Wayland. Alternatively use XFCE or select Xorg on the login screen Works on my a couple of systems and my Chromebook with Debian Bullseye which has been broken for over 12 months. It only has Wayland.

antbarney commented 1 year ago

I have tried the fixes in #2264 by downgrading python3-opengl to 3.1.5 well I am sure that is fixing the problem noted in that issue which is related to the missing getGLUTFontPointer functions. it does not appear to fix/help with the "out of memory" error I am others have been seeing.

smoe commented 1 year ago

I'll prepare a bug report on Debian for python3-opengl that fails to find the freeglut library because of what I understand to be the missing symbolic link. I have minimal script for that. Is there another minimal script for the "out of memory" error?

antbarney commented 1 year ago

I'll prepare a bug report on Debian for python3-opengl that fails to find the freeglut library because of what I understand to be the missing symbolic link. I have minimal script for that. Is there another minimal script for the "out of memory" error?

Not that I have found yet. Only "work around" is to comment out the glBitmap calls in glnav.py but that breaks the DRO on the preview panel in Axis.

petterreinholdtsen commented 1 year ago

[Anthony Barney]

Not that I have found yet. Only "work around" is to comment out the glBitmap calls in glnav.py but that breaks the DRO on the preview panel in Axis.

I tried downgrading python3-opengl to 3.1.5+dfsg-3 and installing the needed freeglut3 library (used version 2.8.1-6 from snapshot), as well as setting the PYOPENGL_PLATFORM=x11 environment variable, on my test Bookworm machine. Sadly the axis GUI still fail in the call to

glnav.use_pango_font(coordinate_font, 0, 128)

with this error:

OpenGL.error.GLError: GLError( err = 1285, description = b'out of memory', baseOperation = glBitmap, pyArgs = (0, 0, 0, 0, 0, 14.0, b''), cArgs = (0, 0, 0, 0, 0, 14.0, b''), cArguments = (0, 0, 0, 0, 0, 14.0, b'') )

This make me believe there are several OpenGL issues at the moment, and this one (#1599) must be different from #2264.

-- Happy hacking Petter Reinholdtsen

SebKuzminsky commented 1 year ago

I think this issue talks about a number of problems, but the OpenGL "glBitmap out of memory" problem should be fixed by @jepler's #2328. That fix is in 2.9 and master/2.10 now.

I'm closing this issue as fixed, please open new issues if any problems remain.

smoe commented 1 year ago

The Debian soft freeze is on the 12th, i.e. in three days. To shorten a discussion with our FTPmasters, do you think you can make it a possibility to update the LinuxCNC package until ... basically now? We still have that transition time to testing, which nibbles on the freeze date.

rodw-au commented 1 year ago

Has anyone checked a Gmocappy sim works? I am getting this error on a RIP build this morning on Bullseye with wayland. I'm sure it is broken on Bookworm to. Traceback (most recent call last): File "/home/rod/linuxcnc-dev/lib/python/gladevcp/hal_gremlin.py", line 277, in realize gremlin.Gremlin.realize(self, widget) File "/home/rod/linuxcnc-dev/lib/python/rs274/glcanon.py", line 395, in inner self.activate() File "/home/rod/linuxcnc-dev/lib/python/gremlin.py", line 224, in activate if(not GLX.glXMakeCurrent(self.xdisplay, self.xwindow_id, self.context)): File "/usr/lib/python3/dist-packages/OpenGL/platform/baseplatform.py", line 415, in __call__ return self( *args, **named ) ctypes.ArgumentError: argument 2: <class 'TypeError'>: wrong type

Following this error, Gmocappy displays a number of error windows before finally displaying a broken screen. gremlin.py appears to be the culprit. A number of other messages display showing for example 73: DeprecationWarning: Gtk.ColorButton.set_color is deprecated

SebKuzminsky commented 1 year ago

The following sim configs currently fail to start in Bookworm (with X11, not Wayland), according to https://github.com/SebKuzminsky/linuxcnc-config-test:

222 configs, 203 passed, 18 failed
Failed configs:
FAIL: axis/profile_axis.ini
FAIL: axis/remap/rack-toolchange/racktoolchange.ini
FAIL: axis/remap/manual-toolchange-with-tool-length-switch/manualtoolchange.ini
FAIL: craftsman/craftsmancnc.ini
FAIL: gscreen/gscreen_custom/9axis.ini
FAIL: gscreen/gscreen_custom/gaxis_no_plot.ini
FAIL: gscreen/gscreen_custom/gscreen_gaxis.ini
FAIL: gscreen/gscreen_custom/industrial.ini
FAIL: gscreen/gscreen_custom/tester_metric.ini
FAIL: gscreen/gscreen_custom/tester.ini
FAIL: gscreen/industrial_lathe_wear/industrial_lathe_wear.ini
FAIL: gscreen/silverdragon/silverdragon.ini
FAIL: gscreen/spartan/spartan.ini
FAIL: qtdragon/qtdragon_multi_joint/qtdragon_xyyz.ini
FAIL: qtvcp_screens/qtdragon/qtdragon_xyyz.ini
FAIL: qtvcp_screens/qtvcp_custom/qtdefault_ngc.ini
FAIL: qtvcp_screens/qtvcp_experimental/qtdefault_ngc.ini
FAIL: qtvcp_screens/woodpecker/woodpecker_xyzya.ini

Note: this test does not detect failure of configs that start but throw up error windows instead of functional GUIs.

hansu commented 1 year ago

Has anyone checked a Gmocappy sim works?

I can run Gmoccapy from a RIP build on Bookworm with Wayland (with freeglut3 installed manually)

jepler commented 1 year ago

I tried one of the gscreens, it's not opengl

gtk-builder-error-quark: /home/jepler/src/linuxcnc/share/gscreen/skins/9_axis/9_axis.glade:2778:51 Invalid property: GtkStatusbar.has_resize_grip (11)
**** Gscreen GLADE ERROR:    With main screen xml file: /home/jepler/src/linuxcnc/share/gscreen/skins/9_axis/9_axis.glade

seems to be the fatal error.

jepler commented 1 year ago

.. the statusbar grip functionality seems to be removed in gtk3, it was present in gtk2.

rodw-au commented 1 year ago

Doesn't the comment from Hans mean freeglut3 should be added to the dependencies in bookworm?

phillc54 commented 1 year ago

I think the use of glut was removed here

SebKuzminsky commented 1 year ago

That's right, LinuxCNC doesn't use GLUT any more.

Also, freeglut is not in Bookworm, it's transitioned to libglut (which we also don't need). https://packages.debian.org/freeglut

rodw-au commented 1 year ago

So if gmocappy is broken in bookworm because it's not been updated, should it even be included in bookworm? It will be a while before I can test it in bookworm. We can't send broken code out to the masses