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

Segmentation fault in Fedora 39 #17

Open
BoukeHaarsma23 opened this issue Jan 6, 2024 · 3 comments · Fixed by #19
Open

Segmentation fault in Fedora 39 #17

BoukeHaarsma23 opened this issue Jan 6, 2024 · 3 comments · Fixed by #19
Labels
bug Something isn't working

Comments

@BoukeHaarsma23
Copy link

BoukeHaarsma23 commented Jan 6, 2024

Hi, thanks for your hard work. It is appreciated.

I am wanting to flash a module using my linux laptop. But I am hitting an assertion here.

[bouke@Slimbook ~]$ ltchiptool -vvv gui
22:31:53: Debug: Adding duplicate image handler for 'Windows bitmap file'
22:31:53: Debug: Adding duplicate animation handler for '1' type
22:31:53: Debug: Adding duplicate animation handler for '2' type
D: Found Local data snapshot (v1.4.1) - /home/bouke/.local/lib/python3.12/site-packages/ltchiptool
D: Using v1.4.1 (/home/bouke/.local/lib/python3.12/site-packages/ltchiptool) as default
D: Using selector: EpollSelector

(ltchiptool:58704): Gtk-CRITICAL **: 22:31:53.843: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
D: Started DeviceWatcher
Segmentation fault (core dumped)

Using Fedora 39 and using all pypi packages. The GUI first starts normally, but gets this segmentation fault when switching tabs.
Using v4.10.1

Would appreciate if you could take a look. (As a suggestion maybe consider a flatpak in the future?)

@alufers
Copy link
Contributor

alufers commented Jan 30, 2024

I am also getting those crashes, the gtk_box_gadget_distribute: assertion 'size >= 0' failed line seems to be bogus, the segfaults happen in different places in the code.

I think the cause of these crashes is the fact that ltchiptool does GUI operations from multiple threads, which GTK does not like (this might also be the cause of macOS crashes).

I quickly added this piece code to a few places:

import threading
print("PluginsPanel.__init__, get_native_id=", threading.get_native_id())

And from the logs I can see that OnWorkStopped is called from a different thread (and it also manipulates the GUI):

PluginsPanel.__init__, get_native_id= 307888
StartWork get_native_id= 307888
PluginsPanel.OnWorkStopped, get_native_id= 307943

@kuba2k2 kuba2k2 added the bug Something isn't working label Jan 30, 2024
@kuba2k2
Copy link
Member

kuba2k2 commented Jan 30, 2024

Good point. That might have been not an issue on Windows, and since I'm developing on Windows I never noticed such things - all this is actually my first go at wxPython and GUI apps.

It should be possible to convert these worker thread callbacks so that they execute on main thread. I think something similar has been implemented in another class already; I'm not sure where exactly.

Something similar has been implemented here:
https://github.com/tuya-cloudcutter/cloudcutter-universal/blob/master/cloudcutter/modules/base/event.py
but that relies on AsyncIO for the entire project.

@kuba2k2
Copy link
Member

kuba2k2 commented Feb 26, 2024

Hi, this got closed automatically. If you can, let me know if the issue is solved (at least partially). Clicking on the Plugins tab is still a known issue on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants