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

fix: update LD_LIBRARY_PATH for crashing python plugins #290

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

frenchwr
Copy link

@frenchwr frenchwr commented Nov 4, 2024

Currently python-based plug-ins (15 in total) are crashing with messages like the following:

Querying plug-in: '/snap/gimp/x2/usr/lib/x86_64-linux-gnu/gimp/3.0/plug-ins/test-file-plug-ins/test-file-plug-ins.py'
GIMP-WARNING: gimp-2.99: gimp_wire_read(): unexpected EOF
Terminating plug-in: '/snap/gimp/x2/usr/lib/x86_64-linux-gnu/gimp/3.0/plug-ins/test-file-plug-ins/test-file-plug-ins.py'
.
.

Specifically, the python plug-ins are seg faulting, which can be seen by shelling into the snap and running a minimum example:

/snap/gimp/x1$ python3
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version("Gimp", "3.0")
>>> gi.require_version("GimpUi", "3.0")
>>> gi.require_version("Gtk", "3.0")
>>> from gi.repository import Gimp
Segmentation fault (core dumped)

Updating the LD_LIBRARY_PATH resolves this issue by providing the correct libs (those that GIMP are built against) at runtime.

Snapshots after deploying the fix

  • 134 plug-ins available from the plug-in browser (compared to 120 previously)

Screenshot from 2024-11-04 15-20-20

  • Python Fu Plugin Menu

Screenshot from 2024-11-04 16-09-00

  • One of the Python plug-ins (Python console) launched from the GIMP menu (Filters -> Development -> Python Fu -> Python Console)

Screenshot from 2024-11-04 16-08-39

@jnsgruk
Copy link
Member

jnsgruk commented Nov 5, 2024

Nice, thanks!

@jnsgruk jnsgruk merged commit 0e173a7 into snapcrafters:preview Nov 5, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants