Qtplasmac 1.0.98 error on shutdown python segmentation fault

More
09 Oct 2021 19:48 - 09 Oct 2021 19:50 #222678 by rodw
End of dmesg (full output attached):
[code][32455.084568] qtvcp[30362]: segfault at 10 ip 000000000053bfa9 sp 00007ffd13016760 error 4 in python3.9[41f000+288000]
[32455.084766] Code: 2f 01 0f 84 f1 00 00 00 48 8b 7b 18 48 85 ff 0f 84 4f 94 ef ff 48 83 2f 01 0f 84 f2 00 00 00 48 8d 7b f0 4c 8b 1d 4f e6 3f 00 <49> 8b 53 10 8b 8a 94 02 00 00 85 c9 7e 09 83 e9 01 89 8a 94 02 00
[32661.934036] qtvcp[31040]: segfault at 10 ip 000000000053bfa9 sp 00007fffcd3b4280 error 4 in python3.9[41f000+288000]
[32661.934066] Code: 2f 01 0f 84 f1 00 00 00 48 8b 7b 18 48 85 ff 0f 84 4f 94 ef ff 48 83 2f 01 0f 84 f2 00 00 00 48 8d 7b f0 4c 8b 1d 4f e6 3f 00 <49> 8b 53 10 8b 8a 94 02 00 00 85 c9 7e 09 83 e9 01 89 8a 94 02 00

Not sure where to go here. The only reference I could find is to a known in issue in Python
bugs.python.org/issue43664
which still causes a fault if run from the command line.
I have no idea if its relevant.

This is on Debian Bullseye using a deb install from compiled debs. The config carried across from an earlier QTplasmac one and I copied the config across on a USB stick using a EXT4 partition to preserve symlinks. QTPlasmac upgraded the config on first open.

If you run from a desktop shortcut it causes the error window to display which is disconcerting.

Looks like a qtvcp issue but I thought I'd start here......
 

File Attachment:

File Name: dmesg.txt
File Size:84 KB
[/code]
Attachments:
Last edit: 09 Oct 2021 19:50 by rodw.

Please Log in or Create an account to join the conversation.

More
12 Nov 2021 03:30 - 12 Nov 2021 03:44 #226178 by phillc54
If it is any consolation I get the same shutdown errors in a run in place install with MX-Linux 21 (Debian11 spinoff). There are no such issues with MX-Linux 19 (Debian10 spinoff). The only difference is the python version, MX21 is python3.9.2 and MX19 is python3.7.3

Terminal:
/home/phill/linuxcnc-dev/scripts/linuxcnc: line 930: 25129 Segmentation fault      $EMCDISPLAY -ini "$INIFILE" $EMCDISPLAYARGS $EXTRA_ARGS


dmesg:
[ 1573.723631] qtvcp[25129]: segfault at 10 ip 000000000053bfa9 sp 00007ffe5400e3a0 error 4 in python3.9[41f000+288000]
[ 1573.723643] Code: 2f 01 0f 84 f1 00 00 00 48 8b 7b 18 48 85 ff 0f 84 4f 94 ef ff 48 83 2f 01 0f 84 f2 00 00 00 48 8d 7b f0 4c 8b 1d 4f e6 3f 00 <49> 8b 53 10 8b 8a 94 02 00 00 85 c9 7e 09 83 e9 01 89 8a 94 02 00
Last edit: 12 Nov 2021 03:44 by phillc54.

Please Log in or Create an account to join the conversation.

More
12 Nov 2021 12:37 #226218 by bevins

Please Log in or Create an account to join the conversation.

More
13 Nov 2021 03:27 #226274 by rodw
It would be good to get a resolution on Python 3.9 as Bookworm (Debian 12) is coming!
All this installation crap we go through now will be over then!
sudo apt-get install linuxcnc

preempt_rt as a dependency!

Please Log in or Create an account to join the conversation.

More
07 Dec 2021 01:07 #228489 by Blonney
Hello,
I came across the same error with qtdragon and qtplasmac derivatives in LCNC 2.9.0~pre0, both on Debian 10 and 11. In my setup, the issue is caused by version 0.5 of python-espeak, which SEGFAULTs with Python 3, as noted by the developer of the newer (albeit mildly backwards incompatible) version 0.6.3 pypi.org/project/python-espeak/ and as noted before in this topic.
A simple workaround, if LinuxCNC speech synthesis is not needed, is to stop using espeak, for instance, by inserting
raise ValueError('Intentional exception to skip espeak import')
immediately above the line
from espeak import espeak
in file "/usr/lib/python3/dist-packages/qtvcp/lib/audio_player.py".

A more elaborate solution, which preserves speech in LinuxCNC, is to install "python-espeak 0.6.3" and adapt the audio_player.py file to the new python-espeak API. Attached is an updated "audio_player.py" file, only partially tested on a Raspberry Pi 4B w/8GB running LinuxCNC 2.9.0~pre0 on Debian 11 Linux 5.10.82-rt58-v8+ #2 SMP PREEMPT_RT aarch64.
Two shaky points are worth mentioning about the attached file. First, the espeak library is calling the 'speak_finished' callback function with the 'msg_terminated' event while 'speaker' is still playing; to prevent it from speaking over itself, I included a sleep-based wait to make sure playing stops before new text is synthesized. Second, the new API does not seem to expose stop() or cancel() functions, so in 'speak_cancel' a call is made to 'espeak.core.stop()', which is a bit awkward and hasn't been properly tested. Perhaps after more validation and cleanup the enclosed audio_player.py might be pulled to the repo if LinuxCNC/QtVCP maintainers so see fit.
I hope these workarounds may be helpful for others to get rid of the inelegant post-shutdown error dialog.
Attachments:

Please Log in or Create an account to join the conversation.

More
07 Dec 2021 09:10 #228513 by rodw
Great to see a solution emerging. It would be good if you could post your solution on this issue which will get the attention of the developers
github.com/LinuxCNC/linuxcnc/issues/1379

We were actually discussing this issue today. We thought it was related to python sip and they released a new version a few days ago. I tried upgrading it and it made no difference.

Please Log in or Create an account to join the conversation.

More
08 Dec 2021 02:04 #228587 by cmorley
Should be able to remove the espeak package from your system, to confirm the fix.

Please Log in or Create an account to join the conversation.

More
09 Dec 2021 03:21 - 09 Dec 2021 03:38 #228682 by phillc54
I removed all espeak packages including the python3-espeak modue and I still have the segfault on closing LinuxCNC.

EDIT: I take that back, I rebuilt and there is no segfault.
Last edit: 09 Dec 2021 03:38 by phillc54.

Please Log in or Create an account to join the conversation.

More
11 Dec 2021 08:03 #228855 by rodw
Awesome work team. Thanks for the resolution!

Please Log in or Create an account to join the conversation.

More
13 Dec 2021 00:13 #228968 by Blonney
Glad to give a tiny little something back to this great community!

Please Log in or Create an account to join the conversation.

Moderators: snowgoer540
Time to create page: 0.212 seconds
Powered by Kunena Forum