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

Binary built with GH actions doesn't run on other systems #159

Closed
mammo0 opened this issue Oct 15, 2020 · 11 comments
Closed

Binary built with GH actions doesn't run on other systems #159

mammo0 opened this issue Oct 15, 2020 · 11 comments

Comments

@mammo0
Copy link

mammo0 commented Oct 15, 2020

Hello,

as demanded by @JonathonReinhart I will open a new issue for my problem. It might be related to #86 and/or #129.

My goal is to build a Python application with Pyinstaller and afterwards make it portable with staticx. Everything works fine on my local machine. But then I tried to automate the build process with GitHub actions. Their runners run by default on Ubuntu 18.04.

Here is the build log of:

Pyinstaller (version 4.0):

42 INFO: PyInstaller: 4.0
42 INFO: Python: 3.6.11
295 INFO: Platform: Linux-5.4.0-1026-azure-x86_64-with-debian-buster-sid
451 INFO: UPX is available.
454 INFO: Extending PYTHONPATH with paths
['/home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui',
 '/home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui']
462 INFO: checking Analysis
462 INFO: Building Analysis because Analysis-00.toc is non existent
462 INFO: Initializing module dependency graph...
463 INFO: Caching module graph hooks...
469 INFO: Analyzing base_library.zip ...
3513 INFO: Caching module dependency graph...
3590 INFO: running Analysis Analysis-00.toc
3615 INFO: Analyzing /home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui/nord_nm_gui.py
3756 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-urllib3.packages.six.moves.py'.
4874 INFO: Processing pre-safe import module hook six.moves from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
6285 INFO: Processing module hooks...
6286 INFO: Loading module hook 'hook-certifi.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
6288 INFO: Loading module hook 'hook-cryptography.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
6464 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6572 INFO: Loading module hook 'hook-PyQt5.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6609 WARNING: Hidden import "sip" not found!
6610 INFO: Loading module hook 'hook-importlib_metadata.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6611 INFO: Loading module hook 'hook-xml.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6658 INFO: Loading module hook 'hook-encodings.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6720 INFO: Loading module hook 'hook-keyring.backends.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6877 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6941 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks'...
6988 INFO: Looking for ctypes DLLs
6991 INFO: Analyzing run-time hooks ...
6996 INFO: Including run-time hook '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pyqt5.py'
6998 INFO: Including run-time hook '/home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_certifi.py'
7006 INFO: Looking for dynamic libraries
8975 INFO: Looking for eggs
8975 INFO: Using Python library /home/runner/.pyenv/versions/3.6.11/lib/libpython3.6m.so.1.0
8981 INFO: Warnings written to /home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui/build/nord_nm_gui/warn-nord_nm_gui.txt
9020 INFO: Graph cross-reference written to /home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui/build/nord_nm_gui/xref-nord_nm_gui.html
9038 INFO: Appending 'datas' from .spec
9043 INFO: checking PYZ
9043 INFO: Building PYZ because PYZ-00.toc is non existent
9043 INFO: Building PYZ (ZlibArchive) /home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui/build/nord_nm_gui/PYZ-00.pyz
9622 INFO: Building PYZ (ZlibArchive) /home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui/build/nord_nm_gui/PYZ-00.pyz completed successfully.
9633 INFO: checking PKG
9634 INFO: Building PKG because PKG-00.toc is non existent
9634 INFO: Building PKG (CArchive) PKG-00.pkg
55590 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
55598 INFO: Bootloader /home/runner/.local/share/virtualenvs/NordVPN-NetworkManager-Gui-CPZTWrAn/lib/python3.6/site-packages/PyInstaller/bootloader/Linux-64bit/run_d
55598 INFO: checking EXE
55598 INFO: Building EXE because EXE-00.toc is non existent
55598 INFO: Building EXE from EXE-00.toc
55599 INFO: Appending archive to ELF section in EXE /home/runner/work/NordVPN-NetworkManager-Gui/NordVPN-NetworkManager-Gui/dist/nord_nm_gui
56167 INFO: Building EXE from EXE-00.toc completed successfully.

and staticx (version 0.12.0): https://pastebin.com/tUF1dLFz

If I try to execute the built binary on my local PC (Arch Linux), I get the following error message:

$ ./nord_nm_gui                                                              
STATICX [11671]: Version 0.12.0
STATICX [11671]: Temporary bundle dir: /tmp/staticx-chGhnL
STATICX [11671]: Found archive at offset 0x2321E (74142004 bytes)
STATICX [11671]: Archive is XZ-compressed
STATICX [11671]: Extracting tar archive to /tmp/staticx-chGhnL
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libGL.so.1 -> libGL.so.1.0.0
-rw-r--r-- root     root        567624 May 10 14:17 2019 libGL.so.1.0.0
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libpthread.so.0 -> libpthread-2.27.so
-rwxr-xr-x root     root        144976 Jun  4 19:25 2020 libpthread-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libm.so.6 -> libm-2.27.so
-rw-r--r-- root     root       1700792 Jun  4 19:25 2020 libm-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libc.so.6 -> libc-2.27.so
-rwxr-xr-x root     root       2030544 Jun  4 19:25 2020 libc-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libdl.so.2 -> libdl-2.27.so
-rw-r--r-- root     root         14560 Jun  4 19:25 2020 libdl-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 ld-linux-x86-64.so.2 -> ld-2.27.so
-rwxr-xr-x root     root        170960 Jun  4 19:25 2020 ld-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libxcb.so.1 -> libxcb.so.1.1.0
-rw-r--r-- root     root        162232 Jun 21 12:52 2018 libxcb.so.1.1.0
lrw-r--r-- root     root             0 Jan  1  1:00 1970 librt.so.1 -> librt-2.27.so
-rw-r--r-- root     root         31680 Jun  4 19:25 2020 librt-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libresolv.so.2 -> libresolv-2.27.so
-rw-r--r-- root     root        101168 Jun  4 19:25 2020 libresolv-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libutil.so.1 -> libutil-2.27.so
-rw-r--r-- root     root         10592 Jun  4 19:25 2020 libutil-2.27.so
-rwx------ 1001      994          9464 Oct 15 19:12 2020 libnssfix.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libnss_files.so.2 -> libnss_files-2.27.so
-rw-r--r-- root     root         47568 Jun  4 19:25 2020 libnss_files-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libnss_dns.so.2 -> libnss_dns-2.27.so
-rw-r--r-- root     root         26936 Jun  4 19:25 2020 libnss_dns-2.27.so
-rwxr-xr-x 1001      994      74032384 Oct 15 19:12 2020 nord_nm_gui
lrw-r--r-- root     root             0 Jan  1  1:00 1970 .staticx.prog -> nord_nm_gui
lrw-r--r-- root     root             0 Jan  1  1:00 1970 .staticx.interp -> ld-linux-x86-64.so.2
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libz.so.1 -> libz.so.1.2.11
-rw-r--r-- root     root        116960 May 23 13:32 2017 libz.so.1.2.11
STATICX [11671]: Successfully extracted archive to /tmp/staticx-chGhnL
STATICX [11671]: Patching user program /tmp/staticx-chGhnL/nord_nm_gui
STATICX [11671]: Current program interpreter: "i...(256 times)"
STATICX [11671]: Set new interpreter: "/tmp/staticx-chGhnL/.staticx.interp"
STATICX [11671]: Current RPATH (0x318): "r...(256 times)"
STATICX [11671]: Set new RPATH: "/tmp/staticx-chGhnL"
STATICX [11671]: Setting env var: STATICX_BUNDLE_DIR=/tmp/staticx-chGhnL
STATICX [11671]: Setting env var: STATICX_PROG_PATH=<path_to_prog>/nord_nm_gui
STATICX [11671]: Ready to run child process with new argv:
STATICX [11671]:   [0] = "/tmp/staticx-chGhnL/nord_nm_gui"
STATICX [11672]: Child process started; ready to call execv()
[11672] PyInstaller Bootloader 3.x
[11672] LOADER: executable is /tmp/staticx-chGhnL/nord_nm_gui
[11672] LOADER: homepath is /tmp/staticx-chGhnL
[11672] LOADER: _MEIPASS2 is NULL
[11672] LOADER: archivename is /tmp/staticx-chGhnL/nord_nm_gui
[11672] LOADER: Extracting binaries
[11672] LOADER: Executing self as child
[11672] LOADER: set _MEIPASS2 to /tmp/_MEIvAUnbd
[11672] LOADER: LD_LIBRARY_PATH=/tmp/_MEIvAUnbd
[11672] LOADER: Registering signal handlers
[11673] PyInstaller Bootloader 3.x
[11673] LOADER: executable is /tmp/staticx-chGhnL/nord_nm_gui
[11673] LOADER: homepath is /tmp/staticx-chGhnL
[11673] LOADER: _MEIPASS2 is /tmp/_MEIvAUnbd
[11673] LOADER: archivename is /tmp/staticx-chGhnL/nord_nm_gui
[11673] LOADER: Already in the child - running user's code.
[11673] LOADER: Python library: /tmp/_MEIvAUnbd/libpython3.6m.so.1.0
[11673] Error loading Python lib '/tmp/_MEIvAUnbd/libpython3.6m.so.1.0': dlopen: /tmp/staticx-chGhnL/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/libpthread.so.0)
[11672] LOADER: Restoring signal handlers
[11672] LOADER: freeing args
[11672] LOADER: returning child exit status 255
[11672] LOADER: Back to parent (RC: 255)
[11672] LOADER: Doing cleanup
[11672] LOADER: Freeing archive status for /tmp/staticx-chGhnL/nord_nm_gui
STATICX [11671]: Child process terminated with wstatus=65280
STATICX [11671]: Removing temporary bundle dir /tmp/staticx-chGhnL
STATICX [11671]: Child exited with status 255

My local PC uses the libc version 2.32. The build system uses 2.27.

@JonathonReinhart
Copy link
Owner

JonathonReinhart commented Oct 16, 2020

I think this issue might be related to #108 (comment). That issue manifested as:

[20050] Error loading Python lib '/tmp/_MEImkQu0d/libpython3.8.so.1.0': dlopen: /lib/x86_64-linux-gnu/libpthread.so.0: symbol __libc_dl_error_tsd version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

I indicated in #108 (comment), that the behavior may be different as of 0.12.0, but given that /usr/lib/libpthread.so.0 is loaded (when it shouldn't be!), I'm guessing #138 was not effective in this case.

I'm looking into this.

@JonathonReinhart JonathonReinhart added the needs investigation Issues that require further investigation before action label Oct 16, 2020
@JonathonReinhart
Copy link
Owner

In your pastebin output, I see that staticx added libpthread-2.27.so from the build system, like it should have:

2020-10-15T08:00:38.9975208Z DEBUG:root:Adding libpthread.so.0 to archive
2020-10-15T08:00:38.9977995Z INFO:root:    Adding Symlink libpthread.so.0 => libpthread-2.27.so
2020-10-15T08:00:38.9980228Z INFO:root:    Adding /lib/x86_64-linux-gnu/libpthread-2.27.so as libpthread-2.27.so

And I see that staticx extracted it at runtime:

lrw-r--r-- root     root             0 Jan  1  1:00 1970 libpthread.so.0 -> libpthread-2.27.so
-rwxr-xr-x root     root        144976 Jun  4 19:25 2020 libpthread-2.27.so

And NODEFLIB should be in effect...

So I'm really confused about why /usr/lib/libpthread.so.0 (the system library) was loaded.

[11673] Error loading Python lib '/tmp/_MEIvAUnbd/libpython3.6m.so.1.0': dlopen: /tmp/staticx-chGhnL/libc.so.6: version `GLIBC_2.32' not found (required by /usr/lib/libpthread.so.0)

I'll have to look into Ubuntu 18.04's libpython, as well as PyInstaller.

@mammo0
Copy link
Author

mammo0 commented Oct 16, 2020

Thanks for your effort! :)

If you need any support, please let me know.

@JonathonReinhart
Copy link
Owner

I tried reproducing this using a simple test, but was unable. I built a PyInstalled app and then ran it through Staticx, all in an Ubuntu 18.04 docker image. I then ran it in an Arch Linux image without issue. I confirmed the GLIBC versions were as you mentioned.

Can you provide a link to your project and a failing binary file?

@mammo0
Copy link
Author

mammo0 commented Oct 18, 2020

The corresponding project is: https://github.com/mammo0/NordVPN-NetworkManager-Gui

In the latest release you can find the binary that produced the output from above: https://github.com/mammo0/NordVPN-NetworkManager-Gui/releases/tag/20201015-1712_72ea624

To build this you need to have pyenv and Pipenv installed. You can also have a look at the GH workflow file for installing the dependencies on Ubuntu 18.04: https://github.com/mammo0/NordVPN-NetworkManager-Gui/blob/master/.github/workflows/build.yml

@JonathonReinhart
Copy link
Owner

JonathonReinhart commented Oct 18, 2020

Somehow, when PyInstaller bootloader loads libpython3.6m.so.1.0, both RPATH and NODEFLIB are being ignored!

Running with LD_DEBUG=libs:

[74] PyInstaller Bootloader 3.x
[74] LOADER: executable is /tmp/staticx-lCljiB/nord_nm_gui
[74] LOADER: homepath is /tmp/staticx-lCljiB
[74] LOADER: _MEIPASS2 is /tmp/_MEIUi07iC
[74] LOADER: archivename is /tmp/staticx-lCljiB/nord_nm_gui
[74] LOADER: Already in the child - running user's code.
[74] LOADER: Python library: /tmp/_MEIUi07iC/libpython3.6m.so.1.0
        74:	find library=libpthread.so.0 [0]; searching
        74:	 search path=/tmp/_MEIUi07iC/tls/x86_64/x86_64:/tmp/_MEIUi07iC/tls/x86_64:/tmp/_MEIUi07iC/tls/x86_64:/tmp/_MEIUi07iC/tls:/tmp/_MEIUi07iC/x86_64/x86_64:/tmp/_MEIUi07iC/x86_64:/tmp/_MEIUi07iC/x86_64:/tmp/_MEIUi07iC		(LD_LIBRARY_PATH)
        74:	  trying file=/tmp/_MEIUi07iC/tls/x86_64/x86_64/libpthread.so.0
        74:	  trying file=/tmp/_MEIUi07iC/tls/x86_64/libpthread.so.0
        74:	  trying file=/tmp/_MEIUi07iC/tls/x86_64/libpthread.so.0
        74:	  trying file=/tmp/_MEIUi07iC/tls/libpthread.so.0
        74:	  trying file=/tmp/_MEIUi07iC/x86_64/x86_64/libpthread.so.0
        74:	  trying file=/tmp/_MEIUi07iC/x86_64/libpthread.so.0
        74:	  trying file=/tmp/_MEIUi07iC/x86_64/libpthread.so.0
        74:	  trying file=/tmp/_MEIUi07iC/libpthread.so.0
        74:	 search path=/home/runner/.pyenv/versions/3.6.11/lib/tls/x86_64/x86_64:/home/runner/.pyenv/versions/3.6.11/lib/tls/x86_64:/home/runner/.pyenv/versions/3.6.11/lib/tls/x86_64:/home/runner/.pyenv/versions/3.6.11/lib/tls:/home/runner/.pyenv/versions/3.6.11/lib/x86_64/x86_64:/home/runner/.pyenv/versions/3.6.11/lib/x86_64:/home/runner/.pyenv/versions/3.6.11/lib/x86_64:/home/runner/.pyenv/versions/3.6.11/lib	(RUNPATH from file /tmp/_MEIUi07iC/libpython3.6m.so.1.0)
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/tls/x86_64/x86_64/libpthread.so.0
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/tls/x86_64/libpthread.so.0
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/tls/x86_64/libpthread.so.0
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/tls/libpthread.so.0
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/x86_64/x86_64/libpthread.so.0
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/x86_64/libpthread.so.0
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/x86_64/libpthread.so.0
        74:	  trying file=/home/runner/.pyenv/versions/3.6.11/lib/libpthread.so.0
        74:	 search cache=/etc/ld.so.cache
        74:	  trying file=/usr/lib/libpthread.so.0

Full log: ld_debug.txt


Ugh, I think I've found the problem: https://github.com/bminor/glibc/blob/glibc-2.27/elf/dl-load.c#L1945-L1979

      /* When the object has the RUNPATH information we don't use any
	 RPATHs.  */

The wrapped executable has been patched as expected, with NODEFLIB and RPATH:

Dynamic section at offset 0x270 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libnssfix.so]
 0x000000006ffffffb (FLAGS_1)            Flags: NODEFLIB
 0x000000000000000f (RPATH)              Library rpath: [/tmp/staticx-KgGBeh]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x401540
 0x000000000000000d (FINI)               0x4054f
...

But the problem is that the bundled libpython3.6m.so.1.0 has RUNPATH set to /home/runner/.pyenv/versions/3.6.11/lib:

Dynamic section at offset 0x2a24d0 contains 30 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libutil.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libpython3.6m.so.1.0]
 0x000000000000001d (RUNPATH)            Library runpath: [/home/runner/.pyenv/versions/3.6.11/lib]
 0x000000000000000c (INIT)               0x5c210
 0x000000000000000d (FINI)               0x21483c
...

and because of this, its libpthread dependency ends up bypassing my RPATH/NODEFLIB directives, and ends up being resolved by the system's version in /usr/lib/, which does not agree with the libc.so already loaded.

At a minimum, it looks like staticx needs to implement some sort of RUNPATH/RPATH auditing / stripping... (Edit: Added. See #188)

Edit: RPATH/RUNPATH stripping won't work because these problematic libraries exist in the PyInstaller archive. Auditing is possible, but do we really want to just fail?

Idea: What if we use patch_elf(add_needed...) to cause the bundled user program to explicitly depend on all of the libraries added to the bundle by the hooks? The idea is to cause them to be loaded from our rpath before they're needed by a dependency (which could use RUNPATH and ruin everything). Ugh, this probably won't work unless we enforce some kind of dependency-based load order.......


It looks like pyenv used to suggest rpath: pyenv/pyenv#65

@JonathonReinhart
Copy link
Owner

Did this bug exist prior to mammo0/NordVPN-NetworkManager-Gui@ca4b50f?

@mammo0
Copy link
Author

mammo0 commented Oct 19, 2020

Oh, looks like it's really complicated...

Did this bug exist prior to mammo0/NordVPN-NetworkManager-Gui@ca4b50f?

To test this I created a new branch and let GH build everything without pyenv. The default Python version in the runner is 3.6.9. The build log: 4_Build.txt

The built binary: https://github.com/mammo0/NordVPN-NetworkManager-Gui/releases/tag/20201019-0807_debug_staticx_13bc371
Now I'm getting another error when trying to start the binary on my local PC:

./nord_nm_gui                                                              
STATICX [32009]: Version 0.12.0
STATICX [32009]: Temporary bundle dir: /tmp/staticx-fcphkm
STATICX [32009]: Found archive at offset 0x2321E (69164864 bytes)
STATICX [32009]: Archive is XZ-compressed
STATICX [32009]: Extracting tar archive to /tmp/staticx-fcphkm
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libGL.so.1 -> libGL.so.1.0.0
-rw-r--r-- root     root        567624 May 10 14:17 2019 libGL.so.1.0.0
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libpthread.so.0 -> libpthread-2.27.so
-rwxr-xr-x root     root        144976 Jun  4 19:25 2020 libpthread-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libm.so.6 -> libm-2.27.so
-rw-r--r-- root     root       1700792 Jun  4 19:25 2020 libm-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libc.so.6 -> libc-2.27.so
-rwxr-xr-x root     root       2030544 Jun  4 19:25 2020 libc-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libdl.so.2 -> libdl-2.27.so
-rw-r--r-- root     root         14560 Jun  4 19:25 2020 libdl-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 ld-linux-x86-64.so.2 -> ld-2.27.so
-rwxr-xr-x root     root        170960 Jun  4 19:25 2020 ld-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libxcb.so.1 -> libxcb.so.1.1.0
-rw-r--r-- root     root        162232 Jun 21 12:52 2018 libxcb.so.1.1.0
lrw-r--r-- root     root             0 Jan  1  1:00 1970 librt.so.1 -> librt-2.27.so
-rw-r--r-- root     root         31680 Jun  4 19:25 2020 librt-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libresolv.so.2 -> libresolv-2.27.so
-rw-r--r-- root     root        101168 Jun  4 19:25 2020 libresolv-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libutil.so.1 -> libutil-2.27.so
-rw-r--r-- root     root         10592 Jun  4 19:25 2020 libutil-2.27.so
-rwx------ 1001      974          9464 Oct 19  9:42 2020 libnssfix.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libnss_files.so.2 -> libnss_files-2.27.so
-rw-r--r-- root     root         47568 Jun  4 19:25 2020 libnss_files-2.27.so
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libnss_dns.so.2 -> libnss_dns-2.27.so
-rw-r--r-- root     root         26936 Jun  4 19:25 2020 libnss_dns-2.27.so
-rwxr-xr-x 1001      974      68989368 Oct 19  9:42 2020 nord_nm_gui
lrw-r--r-- root     root             0 Jan  1  1:00 1970 .staticx.prog -> nord_nm_gui
lrw-r--r-- root     root             0 Jan  1  1:00 1970 .staticx.interp -> ld-linux-x86-64.so.2
lrw-r--r-- root     root             0 Jan  1  1:00 1970 libz.so.1 -> libz.so.1.2.11
-rw-r--r-- root     root        116960 May 23 13:32 2017 libz.so.1.2.11
STATICX [32009]: Successfully extracted archive to /tmp/staticx-fcphkm
STATICX [32009]: Patching user program /tmp/staticx-fcphkm/nord_nm_gui
STATICX [32009]: Current program interpreter: "i...(256 times)"
STATICX [32009]: Set new interpreter: "/tmp/staticx-fcphkm/.staticx.interp"
STATICX [32009]: Current RPATH (0x318): "r...(256 times)"
STATICX [32009]: Set new RPATH: "/tmp/staticx-fcphkm"
STATICX [32009]: Setting env var: STATICX_BUNDLE_DIR=/tmp/staticx-fcphkm
STATICX [32009]: Setting env var: STATICX_PROG_PATH=<path_to_binary>/nord_nm_gui
STATICX [32009]: Ready to run child process with new argv:
STATICX [32009]:   [0] = "/tmp/staticx-fcphkm/nord_nm_gui"
STATICX [32011]: Child process started; ready to call execv()
[32011] PyInstaller Bootloader 3.x
[32011] LOADER: executable is /tmp/staticx-fcphkm/nord_nm_gui
[32011] LOADER: homepath is /tmp/staticx-fcphkm
[32011] LOADER: _MEIPASS2 is NULL
[32011] LOADER: archivename is /tmp/staticx-fcphkm/nord_nm_gui
[32011] LOADER: Extracting binaries
[32011] LOADER: Executing self as child
[32011] LOADER: set _MEIPASS2 to /tmp/_MEI7ooNfg
[32011] LOADER: LD_LIBRARY_PATH=/tmp/_MEI7ooNfg
[32011] LOADER: Registering signal handlers
[32012] PyInstaller Bootloader 3.x
[32012] LOADER: executable is /tmp/staticx-fcphkm/nord_nm_gui
[32012] LOADER: homepath is /tmp/staticx-fcphkm
[32012] LOADER: _MEIPASS2 is /tmp/_MEI7ooNfg
[32012] LOADER: archivename is /tmp/staticx-fcphkm/nord_nm_gui
[32012] LOADER: Already in the child - running user's code.
[32012] LOADER: Python library: /tmp/_MEI7ooNfg/libpython3.6m.so.1.0
[32012] LOADER: Loaded functions from Python library.
[32012] LOADER: Manipulating environment (sys.path, sys.prefix)
[32012] LOADER: sys.prefix is /tmp/_MEI7ooNfg
[32012] LOADER: Pre-init sys.path is /tmp/_MEI7ooNfg/base_library.zip:/tmp/_MEI7ooNfg
[32012] LOADER: Setting runtime options
[32012] LOADER: Initializing python
[32012] LOADER: Overriding Python's sys.path
[32012] LOADER: Post-init sys.path is /tmp/_MEI7ooNfg/base_library.zip:/tmp/_MEI7ooNfg
[32012] LOADER: Setting sys.argv
[32012] LOADER: setting sys._MEIPASS
[32012] LOADER: importing modules from CArchive
[32012] LOADER: extracted struct
[32012] LOADER: callfunction returned...
[32012] LOADER: extracted pyimod01_os_path
[32012] LOADER: callfunction returned...
[32012] LOADER: extracted pyimod02_archive
[32012] LOADER: callfunction returned...
[32012] LOADER: extracted pyimod03_importers
[32012] LOADER: callfunction returned...
[32012] LOADER: Installing PYZ archive with Python modules.
[32012] LOADER: PYZ archive: PYZ-00.pyz
[32012] LOADER: Running pyiboot01_bootstrap.py
[32012] LOADER: Running pyi_rth_pyqt5.py
[32012] LOADER: Running pyi_rth_certifi.py
[32012] LOADER: Running nord_nm_gui.py
Gtk-Message: 09:44:27.612: Failed to load module "canberra-gtk-module"
/usr/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_set_name
Failed to load module: /usr/lib/gio/modules/libgvfsdbus.so

(nord_nm_gui:32012): GdkPixbuf-WARNING **: 09:44:27.626: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': Datei oder Verzeichnis nicht gefunden

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 4: unknown element "description"
Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf
Fontconfig warning: FcPattern object width does not accept value [75 100)
[32011] LOADER: Restoring signal handlers
[32011] LOADER: freeing args
[32011] LOADER: re-raising child signal 11
STATICX [32009]: Child process terminated with wstatus=139
STATICX [32009]: Removing temporary bundle dir /tmp/staticx-fcphkm
STATICX [32009]: Child terminated due to signal 11
[1]    32009 segmentation fault (core dumped)  ./nord_nm_gui

Seems like some GDK library is not found.

@JonathonReinhart
Copy link
Owner

FYI: I merged #172 which will at least detect this problem during staticx build, rather than on the target machine.

Also, I subsequently started to move Staticx itself from Travis to GH Actions (#194) and my new code is (properly) detecting this error:

Making staticx executable ($STATICX_FLAGS=):
staticx: /tmp/staticx-pyi-3bnt72x1/_bisect.cpython-35m-x86_64-linux-gnu.so uses unsupported DT_RUNPATH ('/opt/hostedtoolcache/Python/3.5.10/x64/lib').
See https://github.com/JonathonReinhart/staticx/issues/188

In this case it seems that actions/setup-python@v1 and its hostedtoolcache Python builds are partly to blame.

@mammo0
Copy link
Author

mammo0 commented Oct 4, 2021

Thank you for putting so much effort into this :)

@JonathonReinhart
Copy link
Owner

With the problematic RPATH/RUNPATH detection in place, I think I am going to close this issue. If you guys think there is anything I am missing that is not captured by other open issues, please comment and I will consider re-opening. Thanks.

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

No branches or pull requests

2 participants