iai icon indicating copy to clipboard operation
iai copied to clipboard

setarch not working in docker

Open exastion opened this issue 4 years ago • 6 comments
trafficstars

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

exastion avatar Feb 03 '21 06:02 exastion

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 avatar Feb 07 '21 13:02 extrawurst

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

extrawurst avatar Feb 07 '21 13:02 extrawurst

@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.

exastion avatar Feb 07 '21 19:02 exastion

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 avatar Feb 25 '21 22:02 bheisler

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.

bheisler avatar Feb 25 '21 22:02 bheisler

@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

extrawurst avatar Mar 14 '21 16:03 extrawurst