-
Notifications
You must be signed in to change notification settings - Fork 13.3k
on Linux, empty program panics if procfs is not mounted #22642
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
Comments
I found that I can work around this by defining my own entry point:
|
Hm this is somewhat worrisome. It seems overly restrictive, but on the other hand it looks like the failure in question is our detection of the stack start of the main thread in setting up the first guard page. I forget how reliable it is that linux sets up a guard page for us, and it would be tough to remove for now at least. |
@alexcrichton could the code skip guard page creation when /proc is unavailable (as detected by pthread_getattr_np failing)? That seems better than failing to work at all, doesn't it? |
Perhaps yes, I'd want to have a chance to look more into it though. |
Has there been any update regarding this issue? For an AI competition we want to isolate our processes and not mounting proc inside the chroot has served well for any other languages. Is there a workaround possible in code or compilation flags? |
@phsmit: You can work around the problem in code by defining your own entry point with the Unfortunately, that's not an adequate solution in all situations, e.g. if you want to run |
This can fail on linux for various reasons, such as the /proc filesystem not being mounted. There are already many cases where we can't set up stack guards, so just don't worry about this case and communicate that no guard was enabled. I've confirmed that this allows the compiler to run in a chroot without /proc mounted. Closes rust-lang#22642
This can fail on linux for various reasons, such as the /proc filesystem not being mounted. There are already many cases where we can't set up stack guards, so just don't worry about this case and communicate that no guard was enabled. I've confirmed that this allows the compiler to run in a chroot without /proc mounted. Closes #22642
The program
pub main(){}
fails if procfs is not mounted:It seems that the problem is a call to
pthread_getattr_np()
which tries to read/proc/self/maps
and fails.The text was updated successfully, but these errors were encountered: