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

AppImage: fix segfault #32

Merged
merged 2 commits into from
Sep 28, 2024
Merged

AppImage: fix segfault #32

merged 2 commits into from
Sep 28, 2024

Conversation

git-developer
Copy link

This PR contains several AppImage fixes, including a segmentation fault reported in #17.

GitHub release and action run are available (1 test failed because of outstanding #31).

Segmentation fault

The AppImages based on Debian Trixie and Ubuntu Noble currently cause a segmentation fault. Both distros use glibc 2.39. When building an AppImage for Trixie, the following message is shown:

Can't find string offset for section name '.note.cafe1a7e'

This message arises from LIEF, a library used to patch binary files. Debugging uncovered that the messages occur when libc.so.6 is patched. Apparently, libc contains something that LIEF is not able to handle. In 07/2024, lief-project/LIEF#1081 was merged, adding support new dynamic tags for x86_64. When lief is updated to a version containing these changes (currently available: pre-release 0.16.0.dev0), the messages are gone and no segfault occurs.

This LIEF update should be made upstream in AppImageBuilder. Until that is done, we perform it as first step when the existing AppImageBuilder Docker image is run. Since the provided GitHub action does not support such pre-processing, a customized action is used (calling the original Docker image). When the upstream Docker image and GitHub action are updated, this customization is obsolete.

The special segfault handling in the AppImage tests have been removed.

Error loading libusb-1.0

In Debian-based distros without libusb-dev, python-libusb1 fails to load libusb-1.0. The problem was reported upstream in vpelletier/python-libusb1#78. #31 covers the same problem for libudev. Until the problem is fixed upstream, a symlink is created fromlibusb-1.0.so to libusb-1.0.so.1 as workaround.

Dependencies

While debugging the problems above, it turned out that some of the currently excluded libraries are actually used (acl, attr, mount, cloudproviders). Although currently no errors are known caused by these missing libraries, it's never a good idea to mix libraries between host and AppImage. Therefore, these libs are now removed from the excludes.

libpixbufloader for SVG

In Debian Trixie, the package librsvg2-common no longer provides libpixbufloader-svg.so but libpixbufloader_svg.so (dash vs. underscore). Reported upstream as #1082676. A symlink is added as workaround.

@git-developer
Copy link
Author

@C0rn3j C0rn3j merged commit 3289a9d into C0rn3j:python3 Sep 28, 2024
1 check passed
@C0rn3j
Copy link
Owner

C0rn3j commented Sep 28, 2024

Thanks for the detailed writeup once again, merged!

Just one question, why do we need to use packaging-legacy on the default AppImage?

@git-developer
Copy link
Author

Because the AppImageBuilder uses packaging.version to compare versions of debian packages. This fails with current packaging v24 because version strings must conform to PEP 440 now. This is not the case for debian packages (e.g. 1.21.1ubuntu2.3). packaging v24 is required by latest setuptools, and setuptools is required by LIEF v0.16.0.dev0 which fixes the segfault.

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