xplshn / pelf

Pack an ELF. Turn your binaries into single-file executables [.AppBundle|.blob], similar to AppImages and compatible with AppDirs. LIBC-independent, works on *BSDs.
BSD 3-Clause "New" or "Revised" License
12 stars 1 forks source link

Segmentation fault when trying to run the mpv bundle #2

Closed Samueru-sama closed 2 months ago

Samueru-sama commented 3 months ago

Hi, cool project, I wanted to test the mpv appbundle but it segfaults when launched.

~/ ./mpv_amd64LinuxGlibc.small.AppBundle
Segmentation fault
~/ ./mpv_amd64LinuxGlibc.AppBundle
Segmentation fault

This is on Artix linux, the rickroll bundle works.

xplshn commented 3 months ago

Oh, that may be an issue with your Glibc version... I used Void Linux Glibc to generate the Glibc bundles, what's your Glibc version? Have you tried updating it? You can also try using: USE_SYSTEM_LIBRARIES=1 SHOW_DISCARDPROCESS=1 ./mpv_amd64LinuxGlibc.small.AppBundle

Samueru-sama commented 2 months ago

what's your Glibc version?

GNU C Library (GNU libc) stable release version 2.39. which is the same as on voidlinux.

USE_SYSTEM_LIBRARIES=1 SHOW_DISCARDPROCESS=1 ./mpv_amd64LinuxGlibc.small.AppBundle

Thanks it works! Here is the whole output just in case it is needed:

ld-linux-x86-64.so.2 found in system. Using the system's library.
libEGL.so.1 found in system. Using the system's library.
libFLAC.so.12 found in system. Using the system's library.
libGLdispatch.so.0 found in system. Using the system's library.
libOpenCL.so.1 found in system. Using the system's library.
libSDL2-2.0.so.0 found in system. Using the system's library.
libSPIRV.so found in system. Using the system's library.
libSvtAv1Enc.so.1 not found in system. Using the bundl
ed library.
libX11-xcb.so.1 found in system. Using the system's library.
libX11.so.6 found in system. Using the system's library.
libXau.so.6 found in system. Using the system's library.
libXcursor.so.1 found in system. Using the system's library.
libXdmcp.so.6 found in system. Using the system's library.
libXext.so.6 found in system. Using the system's library.
libXfixes.so.3 found in system. Using the system's library.
libXi.so.6 found in system. Using the system's library.
libXpresent.so.1 not found in system. Using the bundl
ed library.
libXrandr.so.2 found in system. Using the system's library.
libXrender.so.1 found in system. Using the system's library.
libXss.so.1 found in system. Using the system's library.
libXv.so.1 found in system. Using the system's library.
libacl.so.1 found in system. Using the system's library.
libaom.so.3 found in system. Using the system's library.
libarchive.so.13 found in system. Using the system's library.
libasound.so.2 found in system. Using the system's library.
libass.so.9 found in system. Using the system's library.
libasyncns.so.0 found in system. Using the system's library.
libavcodec.so.58 not found in system. Using the bundl
ed library.
libavdevice.so.58 not found in system. Using the bundl
ed library.
libavfilter.so.7 not found in system. Using the bundl
ed library.
libavformat.so.58 not found in system. Using the bundl
ed library.
libavresample.so.4 not found in system. Using the bundl
ed library.
libavutil.so.56 not found in system. Using the bundl
ed library.
libblkid.so.1 found in system. Using the system's library.
libbluray.so.2 found in system. Using the system's library.
libbrotlicommon.so.1 found in system. Using the system's library.
libbrotlidec.so.1 found in system. Using the system's library.
libbs2b.so.0 found in system. Using the system's library.
libbz2.so.1 found in system. Using the system's library.
libc.so.6 found in system. Using the system's library.
libcairo.so.2 found in system. Using the system's library.
libcdio.so.19 found in system. Using the system's library.
libcdio_cdda.so.2 found in system. Using the system's library.
libcdio_paranoia.so.2 found in system. Using the system's library.
libcelt0.so.2 not found in system. Using the bundl
ed library.
libcrypto.so.3 found in system. Using the system's library.
libdatrie.so.1 found in system. Using the system's library.
libdav1d.so.7 found in system. Using the system's library.
libdb-5.3.so found in system. Using the system's library.
libdbus-1.so.3 found in system. Using the system's library.
libdecor-0.so.0 not found in system. Using the bundl
ed library.
libdl.so.2 found in system. Using the system's library.
libdrm.so.2 found in system. Using the system's library.
libdvdcss.so.2 not found in system. Using the bundl
ed library.
libdvdnav.so.4 found in system. Using the system's library.
libdvdread.so.8 found in system. Using the system's library.
libexpat.so.1 found in system. Using the system's library.
libffi.so.7 not found in system. Using the bundl
ed library.
libfftw3.so.3 found in system. Using the system's library.
libfontconfig.so.1 found in system. Using the system's library.
libfreetype.so.6 found in system. Using the system's library.
libfribidi.so.0 found in system. Using the system's library.
libgbm.so.1 found in system. Using the system's library.
libgcc_s.so.1 found in system. Using the system's library.
libgdk_pixbuf-2.0.so.0 found in system. Using the system's library.
libgio-2.0.so.0 found in system. Using the system's library.
libglib-2.0.so.0 found in system. Using the system's library.
libgmodule-2.0.so.0 found in system. Using the system's library.
libgmp.so.10 found in system. Using the system's library.
libgnutls.so.30 found in system. Using the system's library.
libgobject-2.0.so.0 found in system. Using the system's library.
libgomp.so.1 found in system. Using the system's library.
libgraphite2.so.3 found in system. Using the system's library.
libharfbuzz.so.0 found in system. Using the system's library.
libhogweed.so.6 found in system. Using the system's library.
libicudata.so.73 not found in system. Using the bundl
ed library.
libicuuc.so.73 not found in system. Using the bundl
ed library.
libidn2.so.0 found in system. Using the system's library.
libjack.so.0 found in system. Using the system's library.
libjpeg.so.8 found in system. Using the system's library.
liblcms2.so.2 found in system. Using the system's library.
liblua5.2.so.5.2 not found in system. Using the bundl
ed library.
liblz4.so.1 found in system. Using the system's library.
liblzma.so.5 found in system. Using the system's library.
libm.so.6 found in system. Using the system's library.
libmbedcrypto.so.3 not found in system. Using the bundl
ed library.
libmodplug.so.1 found in system. Using the system's library.
libmount.so.1 found in system. Using the system's library.
libmp3lame.so.0 found in system. Using the system's library.
libmpg123.so.0 found in system. Using the system's library.
libnettle.so.8 found in system. Using the system's library.
libogg.so.0 found in system. Using the system's library.
libopus.so.0 found in system. Using the system's library.
libp11-kit.so.0 found in system. Using the system's library.
libpango-1.0.so.0 found in system. Using the system's library.
libpangocairo-1.0.so.0 found in system. Using the system's library.
libpangoft2-1.0.so.0 found in system. Using the system's library.
libpcre2-8.so.0 found in system. Using the system's library.
libpipewire-0.3.so.0 found in system. Using the system's library.
libpixman-1.so.0 found in system. Using the system's library.
libplacebo.so.338 found in system. Using the system's library.
libpng16.so.16 found in system. Using the system's library.
libpostproc.so.55 not found in system. Using the bundl
ed library.
libpthread.so.0 found in system. Using the system's library.
libpulse.so.0 found in system. Using the system's library.
libpulsecommon-16.1.so not found in system. Using the bundl
ed library.
libresolv.so.2 found in system. Using the system's library.
librist.so.4 not found in system. Using the bundl
ed library.
librt.so.1 found in system. Using the system's library.
librtmp.so.1 not found in system. Using the bundl
ed library.
librubberband.so.2 found in system. Using the system's library.
libsamplerate.so.0 found in system. Using the system's library.
libshaderc_shared.so.1 found in system. Using the system's library.
libsharpyuv.so.0 found in system. Using the system's library.
libsndfile.so.1 found in system. Using the system's library.
libsndio.so.7 not found in system. Using the bundl
ed library.
libspeex.so.1 found in system. Using the system's library.
libsrt.so.1.5 found in system. Using the system's library.
libstartup-notification-1.so.0 found in system. Using the system's library.
libstdc++.so.6 found in system. Using the system's library.
libswresample.so.3 not found in system. Using the bundl
ed library.
libswscale.so.5 not found in system. Using the bundl
ed library.
libtasn1.so.6 found in system. Using the system's library.
libthai.so.0 found in system. Using the system's library.
libtheoradec.so.1 found in system. Using the system's library.
libtheoraenc.so.1 found in system. Using the system's library.
libuchardet.so.0 not found in system. Using the bundl
ed library.
libunistring.so.2 not found in system. Using the bundl
ed library.
libv4l2.so.0 found in system. Using the system's library.
libv4lconvert.so.0 found in system. Using the system's library.
libva-drm.so.2 found in system. Using the system's library.
libva-wayland.so.2 found in system. Using the system's library.
libva-x11.so.2 found in system. Using the system's library.
libva.so.2 found in system. Using the system's library.
libvdpau.so.1 found in system. Using the system's library.
libvidstab.so.1.1 not found in system. Using the bundl
ed library.
libvmaf.so.1 not found in system. Using the bundl
ed library.
libvorbis.so.0 found in system. Using the system's library.
libvorbisenc.so.2 found in system. Using the system's library.
libvpx.so.8 not found in system. Using the bundl
ed library.
libvulkan.so.1 found in system. Using the system's library.
libwayland-client.so.0 found in system. Using the system's library.
libwayland-cursor.so.0 found in system. Using the system's library.
libwayland-egl.so.1 found in system. Using the system's library.
libwayland-server.so.0 found in system. Using the system's library.
libwebp.so.7 found in system. Using the system's library.
libwebpmux.so.3 found in system. Using the system's library.
libx264.so.157 not found in system. Using the bundl
ed library.
libx265.so.199 not found in system. Using the bundl
ed library.
libxcb-cursor.so.0 found in system. Using the system's library.
libxcb-dri3.so.0 found in system. Using the system's library.
libxcb-ewmh.so.2 found in system. Using the system's library.
libxcb-icccm.so.4 found in system. Using the system's library.
libxcb-image.so.0 found in system. Using the system's library.
libxcb-randr.so.0 found in system. Using the system's library.
libxcb-render-util.so.0 found in system. Using the system's library.
libxcb-render.so.0 found in system. Using the system's library.
libxcb-shape.so.0 found in system. Using the system's library.
libxcb-shm.so.0 found in system. Using the system's library.
libxcb-util.so.1 found in system. Using the system's library.
libxcb-xfixes.so.0 found in system. Using the system's library.
libxcb-xinerama.so.0 found in system. Using the system's library.
libxcb-xkb.so.1 found in system. Using the system's library.
libxcb.so.1 found in system. Using the system's library.
libxkbcommon-x11.so.0 found in system. Using the system's library.
libxkbcommon.so.0 found in system. Using the system's library.
libxml2.so.2 found in system. Using the system's library.
libxvidcore.so.4 found in system. Using the system's library.
libz.so.1 found in system. Using the system's library.
libzstd.so.1 found in system. Using the system's library.
mpv 0.38.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on May 27 2024 15:00:05
libplacebo version: v6.338.2
FFmpeg version: 4.4.4
FFmpeg library versions:
   libavutil       56.70.100
   libavcodec      58.134.100
   libavformat     58.76.100
   libswscale      5.9.100
   libavfilter     7.110.100
   libswresample   3.9.100

Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file

 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

I'll be closing the issue since I can now test it and I know that this mpv is only for demonstration.

Btw what are you thoughts on https://github.com/mgord9518/shappimage ? Seems like it is very similar to this project.

xplshn commented 2 months ago

Btw what are you thoughts on https://github.com/mgord9518/shappimage ? Seems like it is very similar to this project.

Seems like it works the same way as PELF, except that PELF and .AppBundles do run on *BSDs without having to install any new program.

The idea here is to improve on what .AppImages do, first by gaining all of the features of .AppImages, then improving them until we can outperform them.

xplshn commented 2 months ago

@Samueru-sama You seem experienced with .AppImages and familiar with how they work, do you see anything obvious that can be improved? Apart from the fact that we use tar and extract to /tmp, (which is something that I WANT/NEED to correct)

And, on that note, if you do know any archive format that is supported on the 2 major Unix platforms (Linuxes, *BSDs) and that can be mounted too, I'd love to know about it... The plan is to have the extract behavior be a fallback for systems that don't have FUSE or any way to mount the archive content, so as to avoid writting/reading from disk/ram as much as possible and instead do things in a transparent way, like .AppImages.

Samueru-sama commented 2 months ago

do you see anything obvious that can be improved?

Yes what is that terminal font my dude


Now, I actually like the idea that you are using tar instead of fuse, that's a big issue that appimages have and I know there's a static runtime that solves the issue but still most appimages don't use it yet. appimages can still use the --appimage-extract-and-run flag (and there is also a env variable that sets it for all) but that is something that the user has to do instead of being automatic when there isn't a working fuse on the system.

Also when you use --appimage-extract-and-run the contents of the appimage are still on TMPDIR even when the appimage is no longer being used, while appbundles don't have this issue and that's great!

So yeah the fallback idea is very good.

I would really try to depend little as possible on external packages, because on linux you can't really rely on anything, even the most basic stuff, fedora recently replaced wget for wget2 which are not compatible with each other and they didn't even consult the devs of wget2 about that.

Also I know very little about the BSDs, however consider switching to using zstd compression instead of gzip as it has higher compression ratios and faster decompression speeds and it should be supported on BSD systems I hope.

Also this is more of a request, but try to keep some level of compatibility with appimages, that is for example that similar flags have similar effects. Like for example I'm not sure right now if I can extract the .desktop from an appbundle using a single command, with appimages that is --appimage-extract *.desktop so something similar like --appbundle-extract *.desktop would be very nice and sorry if this is possible already.

Also this part of the description:

Helpers to pack QT and other programs made with intricate toolkits probably won't be supported

I don't think that's actually needed to do that if keep some level of compatibility with what appimages do, that is use linuxdeploy-qt to make the AppDir and then you make the appbundle out of it, it should be possible.

But if you want to still keep this hackable which I really like, maybe take a look at this linuxdeploy that is used by the suyu emulator: https://github.com/lat9nq/deploy/blob/main/linux/deploy-linux.sh

xplshn commented 2 months ago

Thanks for the suggestions. As for AppDir support, I will consider it, since that way we could benfitiate from all the hard work the AppImages community has made, as for ZSTD, that could an "edition" of PELF, since the cli tool doesn't come preinstalled in OpenBSD. I will check out LinuxDeploy once I'm home.

--pbundle_desktop returns the .desktop file encoded with base64.

Thanks! Really appreciate the support!