Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfaults when closing Linuxcnc using QTvcp on Debian 11 #1379

Open
rodw-au opened this issue Nov 14, 2021 · 5 comments
Open

Segfaults when closing Linuxcnc using QTvcp on Debian 11 #1379

rodw-au opened this issue Nov 14, 2021 · 5 comments

Comments

@rodw-au
Copy link
Contributor

rodw-au commented Nov 14, 2021

Here are the steps I follow to reproduce the issue:

  1. Install Debian 12 and real time kernel
  2. build debs and Install Linuxcnc using them
  3. run Qtvcp gui from the menu
  4. Close linuxcnc and observe segfault

This forum thread refers
https://forum.linuxcnc.org/38-general-linuxcnc-questions/44225-debian-11-bullseye-segfaults-qtplasmac?start=0

This is what I expected to happen:

Linuxcnc to close gracefully without a segfault or error window

We wondered if this could be Python 3.9 related.

@rene-dev
Copy link
Member

I can confirm this issue with python3.9 on Ubuntu 21.10. with the configs/sim/qtvcp_screens/qtdragon

linuxcnc: line 930: 172401 Segmentation fault (core dumped) $EMCDISPLAY -ini "$INIFILE" $EMCDISPLAYARGS $EXTRA_ARGS
The python interpreter crashes, But I currently do not have a debug build of python.

Thread 1 "qtvcp" received signal SIGSEGV, Segmentation fault.
0x00000000008eaa20 in PyCFunction_Type ()
(gdb) bt
#0 0x00000000008eaa20 in PyCFunction_Type ()
#1 0x00007f3668fe015b in () at /usr/lib/python3/dist-packages/PyQt5/QtCore.abi3.so
#2 0x00007f36690ecf00 in () at /usr/lib/python3/dist-packages/PyQt5/sip.cpython-39-x86_64-linux-gnu.so
#3 0x00007f3668fe00bd in () at /usr/lib/python3/dist-packages/PyQt5/QtCore.abi3.so
#4 0x000000000052444f in ()
#5 0x00000000006203d4 in ()
#6 0x0000000000609a51 in ()
#7 0x0000000000609641 in Py_FinalizeEx ()
#8 0x000000000061ae9c in Py_Exit ()
#9 0x000000000060aa4f in ()
#10 0x000000000060a996 in PyErr_PrintEx ()
#11 0x0000000000607e86 in PyRun_SimpleFileExFlags ()
#12 0x00000000005fcb66 in Py_RunMain ()
#13 0x00000000005d906d in Py_BytesMain ()
#14 0x00007f366de98fd0 in __libc_start_call_main (main=main@entry=0x5d9030, argc=argc@entry=5, argv=argv@entry=0x7ffc26cbdb48) at ../sysdeps/nptl/libc_start_call_main.h:58
#15 0x00007f366de9907d in __libc_start_main_impl (main=0x5d9030, argc=5, argv=0x7ffc26cbdb48, init=, fini=, rtld_fini=, stack_end=0x7ffc26cbdb38) at ../csu/libc-start.c:409
#16 0x00000000005d8f65 in _start ()
(gdb)

@rene-dev
Copy link
Member

@c-morley
Copy link
Collaborator

Thank you for this Rene - it's beyound my skill to debug.

@rodw-au
Copy link
Contributor Author

rodw-au commented Dec 6, 2021

Just fixed a typo in the title. This was observed on Debian 11 Bullseye

@rodw-au rodw-au changed the title Segfaults when closing Linuxcnc using QTvcp on Debian 12 Segfaults when closing Linuxcnc using QTvcp on Debian 11 Dec 6, 2021
@Prismatoid
Copy link

In my case, the segmentation fault was being caused by python-espeak library (more info at https://forum.linuxcnc.org/plasmac/43880-qtplasmac-1-0-98-error-on-shutdown-python-segmentation-fault#228489).
A workaround is to drop the use of espeak in "audio_player.py" from QtVCP, but perhaps a more stable solution would be to port audio_player.py to use the new python-espeak version 0.6.3, which is not backwards compatible. A first attempt at a ported file is attached; it might be useful but it needs thorough testing (and possibly fixing) by expert users. The workaround and the preliminary solution work well in a Raspberry Pi 4B-8GB setup with LinuxCNC 2.9.0~pre0 on Debian 11 Linux 5.10.82-rt58-v8+. Glad to provide more details if needed.
audio_player.zip

jb0 pushed a commit to jb0/linuxcnc that referenced this issue Sep 15, 2022
espeak library used by qtvcp audio_player.py was causing a segfault on
exit when attempting to clear the callback function. (Issue LinuxCNC#1379)
c-morley pushed a commit that referenced this issue Oct 1, 2022
espeak library used by qtvcp audio_player.py was causing a segfault on
exit when attempting to clear the callback function. (Issue #1379)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants