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

MAP_FIXED_NOREPLACE undeclared #2488

Open
xinranwang17 opened this issue Sep 27, 2024 · 5 comments
Open

MAP_FIXED_NOREPLACE undeclared #2488

xinranwang17 opened this issue Sep 27, 2024 · 5 comments

Comments

@xinranwang17
Copy link

I encoutered ‘MAP_FIXED_NOREPLACE’ undeclared when I build from source on branch criu-dev .

It seems it requires higher version of glibc, but I am not able to upgrade my glibc.

Can anyone can help on this?

$ldd --version
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

I found it is related to commit 6d4eeb75a711625f8b34cfe660bae9f032dd7741, can anyone help on this?
@liuchao173

@adrianreber
Copy link
Member

glibc 2.17 is from 2012. Over 12 years old.

We try to support well known operating systems with a long lifetime like CentOS 7 for example. But at some point we have to drop support for really old things. We also dropped python2 support at some point.

It sounds unlikely that we will support really old things like flinch 2.17.

Which OS do you use that has such an old glibc?

@avagin
Copy link
Member

avagin commented Sep 27, 2024

@xinranwang17 The fix is simple:

diff --git a/compel/src/lib/infect.c b/compel/src/lib/infect.c
index 1e3ffb967..a7ef34a83 100644
--- a/compel/src/lib/infect.c
+++ b/compel/src/lib/infect.c
@@ -809,6 +809,10 @@ static void parasite_memfd_close(struct parasite_ctl *ctl, int fd)
                pr_err("Can't close memfd\n");
 }
 
+#ifndef MAP_FIXED_NOREPLACE
+#define MAP_FIXED_NOREPLACE 0x100000
+#endif
+
 static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size, int remote_prot)
 {
        void *where = (void *)ctl->ictx.syscall_ip + BUILTIN_SYSCALL_SIZE;

but I agree with @adrianreber, it is unclear whether we need to support so old glibc...

@xinranwang17
Copy link
Author

xinranwang17 commented Sep 29, 2024

@adrianreber thanks for the information, I am using an internal os which has fixed glibc version.
@avagin thanks, I will try this fix. Btw, is it possible to build criu from source in docker, and use the built binary directly on my host? Is there any limitation in this case?

@rst0git
Copy link
Member

rst0git commented Sep 30, 2024

is it possible to build criu from source in docker, and use the built binary directly on my host?

We run most of our CI tests in Docker containers. For example, you can use make docker-build to create a container image that includes all build dependencies and compiled CRIU binary. However, this binary is dynamically linked and will only work inside the container. We currently do not have a straightforward way of building a statically linked criu binary that can run in a different environment without the required shared libraries.

Copy link

A friendly reminder that this issue had no activity for 30 days.

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

4 participants