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

Executing kcov in a docker image fails #151

Closed
Ragnaroek opened this Issue Sep 20, 2016 · 8 comments

Comments

Projects
None yet
2 participants
@Ragnaroek

Ragnaroek commented Sep 20, 2016

I'm currently trying to build a docker image for kcov (https://github.com/Ragnaroek/kcov_docker). Compiling from source works fine, but executing kcov on a RUST executable fails:

kcov --exclude-pattern=/.cargo,/usr/lib --verify target/cov target/debug/trellis-c0ed8d40a93cd721
Can't set personality: Operation not permitted
kcov: error: Can't start/attach to target/debug/trellis-c0ed8d40a93cd721
Child hasn't stopped: ff00
kcov: error: Can't start/attach to target/debug/trellis-c0ed8d40a93cd721

Any hints what goes wrong here?

@SimonKagstrom

This comment has been minimized.

Show comment
Hide comment
@SimonKagstrom

SimonKagstrom Sep 22, 2016

Owner

Not sure, but perhaps it's similar to a travis fix I had to make for attaching to already running processes, 00b65c3?

Owner

SimonKagstrom commented Sep 22, 2016

Not sure, but perhaps it's similar to a travis fix I had to make for attaching to already running processes, 00b65c3?

@SimonKagstrom

This comment has been minimized.

Show comment
Hide comment
@SimonKagstrom

SimonKagstrom Sep 22, 2016

Owner

Or actually, it's more likely related to this docker issue:

http://emacs.stackexchange.com/questions/22665/building-emacs-in-a-docker-container

kcov uses the personality syscall (to be able to run PIE executables without address space randomization), and it seems like docker is disabling personality().

Nice initiative by the way, I've been meaning to do something similar myself (Issue #115), but still hasn't gotten round to it.

Owner

SimonKagstrom commented Sep 22, 2016

Or actually, it's more likely related to this docker issue:

http://emacs.stackexchange.com/questions/22665/building-emacs-in-a-docker-container

kcov uses the personality syscall (to be able to run PIE executables without address space randomization), and it seems like docker is disabling personality().

Nice initiative by the way, I've been meaning to do something similar myself (Issue #115), but still hasn't gotten round to it.

@Ragnaroek

This comment has been minimized.

Show comment
Hide comment
@Ragnaroek

Ragnaroek Sep 23, 2016

Well that was a good hint. Got it working now. The trick is to set the correct security settings like here:
docker run -it --rm --security-opt seccomp=unconfined -v $(pwd):/source kcov

I will add some more documentation to the repo and maybe we could publish the image on the docker hub?

Ragnaroek commented Sep 23, 2016

Well that was a good hint. Got it working now. The trick is to set the correct security settings like here:
docker run -it --rm --security-opt seccomp=unconfined -v $(pwd):/source kcov

I will add some more documentation to the repo and maybe we could publish the image on the docker hub?

@SimonKagstrom

This comment has been minimized.

Show comment
Hide comment
@SimonKagstrom

SimonKagstrom Sep 24, 2016

Owner

Good to hear that you got it working!

Publishing it on dockerhub sounds like a splendid idea, thanks for the
work! This would have taken me much more time since I'm not used to docker
yet.

On Sep 23, 2016 21:42, "Michael Bohn" notifications@github.com wrote:

Well that was a good hint. Got it working now. The trick is to set the
correct security settings like here:
docker run -it --rm --security-opt seccomp=unconfined -v $(pwd):/source
kcov

I will add some more documentation to the repo and maybe we could publish
the image on the docker hub?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#151 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWyZzAhnEAhGr3Gz8q413kuCuzc6xz1ks5qtCuSgaJpZM4KCCKx
.

Owner

SimonKagstrom commented Sep 24, 2016

Good to hear that you got it working!

Publishing it on dockerhub sounds like a splendid idea, thanks for the
work! This would have taken me much more time since I'm not used to docker
yet.

On Sep 23, 2016 21:42, "Michael Bohn" notifications@github.com wrote:

Well that was a good hint. Got it working now. The trick is to set the
correct security settings like here:
docker run -it --rm --security-opt seccomp=unconfined -v $(pwd):/source
kcov

I will add some more documentation to the repo and maybe we could publish
the image on the docker hub?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#151 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWyZzAhnEAhGr3Gz8q413kuCuzc6xz1ks5qtCuSgaJpZM4KCCKx
.

@Ragnaroek

This comment has been minimized.

Show comment
Hide comment
@Ragnaroek

Ragnaroek Sep 27, 2016

And there is the "final" version:
https://github.com/Ragnaroek/kcov_docker

https://hub.docker.com/r/ragnaroek/kcov/

If you want I can add you as a collaborator to the docker repository with full access.

I think this issue can now be closed?

Ragnaroek commented Sep 27, 2016

And there is the "final" version:
https://github.com/Ragnaroek/kcov_docker

https://hub.docker.com/r/ragnaroek/kcov/

If you want I can add you as a collaborator to the docker repository with full access.

I think this issue can now be closed?

@SimonKagstrom

This comment has been minimized.

Show comment
Hide comment
@SimonKagstrom

SimonKagstrom Sep 28, 2016

Owner

Yep, closing it!

Collaboratorness for me would be a bonus, although I'm not sure I'll contribute much in a while (still being a docker newbie).

Thanks for the very good work!

Owner

SimonKagstrom commented Sep 28, 2016

Yep, closing it!

Collaboratorness for me would be a bonus, although I'm not sure I'll contribute much in a while (still being a docker newbie).

Thanks for the very good work!

@Ragnaroek

This comment has been minimized.

Show comment
Hide comment
@Ragnaroek

Ragnaroek Sep 28, 2016

Ok, send me you dockerhub username and I will add you!

Ragnaroek commented Sep 28, 2016

Ok, send me you dockerhub username and I will add you!

@SimonKagstrom

This comment has been minimized.

Show comment
Hide comment
@SimonKagstrom

SimonKagstrom Sep 29, 2016

Owner

I'll get back once I manage to login :-).

Owner

SimonKagstrom commented Sep 29, 2016

I'll get back once I manage to login :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment