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

standalone binary raises error when compiled on a newer version of Linux #7

Open
mshudrak opened this issue Oct 18, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@mshudrak
Copy link
Collaborator

./scanner
[9662] Error loading Python lib '/tmp/_MEI9HTRtJ/libpython3.10.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/_MEI9HTRtJ/libpython3.10.so.1.0)

Based on this, we need to build gcp_scanner on an older system than we plan to use it on. We could also add support for StaticX.

@mshudrak mshudrak added the bug Something isn't working label Jan 18, 2023
@ro4i7
Copy link
Contributor

ro4i7 commented Mar 18, 2023

./scanner
[9662] Error loading Python lib '/tmp/_MEI9HTRtJ/libpython3.10.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/_MEI9HTRtJ/libpython3.10.so.1.0)

Based on this, we need to build gcp_scanner on an older system than we plan to use it on. We could also add support for StaticX.

Hello, @mshudrak @ZetaTwo I think, using StaticX would be a more feasible solution. It can create a self-contained binary that includes all the necessary libraries, so it can run on any Linux system, then that building the binary on an older system.

Like, we can compile the binary as normally we would do, then use StaticX to create a static binary that includes all the necessary libraries including GLIBC, and then this binary will work on a variety of systems.

Can I create PR on this, if needed?

@mshudrak
Copy link
Collaborator Author

@ro4i7 this is a great issue to work on. Feel free to send PR but don't forget to test produced binary on various systems, please.

@ro4i7
Copy link
Contributor

ro4i7 commented Mar 19, 2023

@ro4i7 this is a great issue to work on. Feel free to send PR but don't forget to test produced binary on various systems, please.

Ok, I start checking it, meanwhile, I'm creating a PR on it, is it ok?

@mshudrak
Copy link
Collaborator Author

Yes, totally ok.

@saurabhmj11
Copy link

./scanner
[9662] Error loading Python lib '/tmp/_MEI9HTRtJ/libpython3.10.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/_MEI9HTRtJ/libpython3.10.so.1.0)

The error message you're seeing suggests that the binary you're trying to run was compiled on a system that had a different version of the GNU C Library (glibc) than the one you're using now. Specifically, it looks like the binary was compiled on a system with glibc version 2.33 or higher, but the version you have installed on your current system is older than that.

One solution to this problem is to upgrade your system's glibc to a version that's compatible with the binary you're trying to run. However, upgrading glibc can be a complex and potentially risky process, so it's generally not recommended unless you know what you're doing.

Another option is to try to find a version of the binary that's compatible with your current system's glibc version. If the binary is open source, you may be able to recompile it from source on your system to ensure compatibility. Alternatively, you could try contacting the developers of the binary to see if they can provide a version that's compatible with your system.

Finally, if none of the above options work, you may need to use a virtual machine or container with an older version of Linux and glibc to run the binary. This approach can be more complicated to set up, but it can be a good way to ensure compatibility with older binaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants