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

setarch not working in docker #12

Open
exastion opened this issue Feb 3, 2021 · 6 comments
Open

setarch not working in docker #12

exastion opened this issue Feb 3, 2021 · 6 comments

Comments

@exastion
Copy link

exastion commented Feb 3, 2021

In an unprivileged Docker container, setarch is not allowed to run.
From #9 it seems setarch isn't the best tool anyway.

@extrawurst
Copy link

I am running into the same issue. I was hoping to be able to use iai in my ci like advertised in the readme but I guess it does not work because gitlab ci uses docker containers to run the CI in :(

@extrawurst
Copy link

@exastion what would be an alternative to setarch? the freebsd solution does not work for other linux distros, right?

@exastion
Copy link
Author

exastion commented Feb 7, 2021

@extrawurst I haven't looked into it further.

I guess one solution would be to put ASLR disabling behind a feature flag, so that setarch could be skipped for CI builds.

@bheisler
Copy link
Owner

Hey, thanks for the bug report, and thanks for the patience.

Yeah, I didn't know setarch was so restricted. Disabling ASLR is helpful for stability of the measurements. Unfortunately, it sounds as if it's not possible to disable it in docker, so having some option to prevent Iai from trying to enable it is probably necessary.

@bheisler
Copy link
Owner

I've pushed a version to the main branch that adds an environment variable (IAI_ALLOW_ASLR) that you can set. I'm not really sure an environment variable is the right way to configure this, but this is much lighter-weight than bringing in a CLI parsing library like clap. I was kinda hoping I could get away with not needing configuration of any sort in Iai. Anyway, let me know if this works for you folks.

@extrawurst
Copy link

@bheisler I finally had time to check this out: it works like a charm! lets have a release please :)
it is part of my CI now: https://github.com/extrawurst/ip2country

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

3 participants