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

version `GLIBC_2.34' not found (required by /tmp/_MEIXfEv3a/liblzma.so.5) #230

Open
liujin1993 opened this issue Aug 10, 2022 · 7 comments

Comments

@liujin1993
Copy link

I build my python app in docker ubuntu:22.04, and run in a machine which is ubuntu16.
When executing "systemctl" in subprocess, the app report an error:

systemctl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/_MEIXfEv3a/liblzma.so.5)

My python file is:

import subprocess

print(1)
p = subprocess.Popen("systemctl status a", stdout=subprocess.PIPE, shell=True)
print(p.communicate())
@JonathonReinhart
Copy link
Owner

@liujin1993 This shouldn't happen, since staticx doesn't use LD_LIBRARY_PATH or any environment tricks that would persist into the child process.

What version of staticx are you using? How are you invoking staticx to build your app? Have you tried a debug build as noted in the docs?

@FirowMD
Copy link

FirowMD commented May 15, 2023

Same, but in my case I've copied all dependencies located at /tmp/_MEIXXXXXX to /usr/lib/. The problem is libgcc_s.so.1 requires GLIBC_2.35.
But why I've copied *.so? Origin problem is following: when I call some shell command (like os.system('awk --help')) appears an error, which informs about missing libtinfo.so.6 (located at OS, which builds binary), but local installed awk has libncurses dependency and not libtinfo. Is there an option to call child processes with new environment like we do using terminal?

@FirowMD
Copy link

FirowMD commented May 15, 2023

Solution is to use following code:

def run_cmd(s):
    subprocess.run(s.split(), env={})

run_cmd("awk --help")

@JonathonReinhart
Copy link
Owner

@FirowMD I believe your issue is related to PyInstaller and not Staticx, which does not modify the environment. See their docs where they suggest adjusting the environment for child processes: LD_LIBRARY_PATH / LIBPATH considerations

@JonathonReinhart
Copy link
Owner

Actually, @liujin1993 I think that is your issue also.

Staticx doesn't mess with LD_LIBRARY_PATH, but PyInstaller does. So when you go to execute a system binary from your Python code, you should make sure that LD_LIBRARY_PATH is not set: See LD_LIBRARY_PATH / LIBPATH considerations in the PyInstaller docs.

@FirowMD
Copy link

FirowMD commented Jun 2, 2023

@FirowMD I believe your issue is related to PyInstaller and not Staticx, which does not modify the environment. See their docs where they suggest adjusting the environment for child processes: LD_LIBRARY_PATH / LIBPATH considerations

sure, I already solved it and pasted the solution above, which removes LD_LIBRARY_PATH using env={}

@JonathonReinhart
Copy link
Owner

which removes LD_LIBRARY_PATH using env={}

There's a prescribed method in their docs, but if you want to run your child process with a completely empty environment (no PATH, TERM, HOME, etc.), then go for it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants