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

fails on travis with ASLR disable failed: EPERM #77

Closed
kdy1 opened this issue Jan 14, 2018 · 20 comments
Closed

fails on travis with ASLR disable failed: EPERM #77

kdy1 opened this issue Jan 14, 2018 · 20 comments

Comments

@kdy1
Copy link

kdy1 commented Jan 14, 2018

0.42s$ bash <(curl https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh)
cargo-tarpaulin
after_success.2
178.59s$ cargo tarpaulin --out Xml &&
    bash <(curl -s https://codecov.io/bash)
    
Building project
Launching test
ASLR disable failed: EPERM: Operation not permitted
thread 'main' panicked at 'Failed to trace: Sys(EPERM)', /checkout/src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Unexpected grab
Error while collecting coverage. EPERM: Operation not permitted
Coverage Results
#
# Omitted 
#
0.00% coverage, 0/302 lines covered
Tarpaulin finished

Travis log: https://travis-ci.org/swc-project/swc/builds/328637807#L2967

I use nightly

@kdy1
Copy link
Author

kdy1 commented Jan 14, 2018

Closing because it seems like a issue of travis.

travis-ci/travis-ci#9061

@kdy1 kdy1 closed this as completed Jan 14, 2018
@philipc
Copy link
Contributor

philipc commented Jan 14, 2018

Possible workaround is running with sudo: required so it's not using containers. I think tarpaulin could avoid needing to disable ASLR with some effort (something like https://github.com/gimli-rs/findshlibs might help).

bors bot added a commit to swc-project/swc that referenced this issue Jan 14, 2018
12: Use sudo inside travis r=kdy1 a=kdy1

See xd009642/tarpaulin#77 (comment)
@kdy1
Copy link
Author

kdy1 commented Jan 14, 2018

Oh.. that worked. Thank you.

xd009642 added a commit that referenced this issue Jan 14, 2018
Added `sudo: required` following #77
@xd009642
Copy link
Owner

@philipc thanks for the help, I'll make an issue for looking into using findshlibs to improve tarpaulin. Any input you might have would be appreciated 😄

I've also added sudo:required to the example travis.yml in the README so new users don't hit this problem as well.

@rfdonnelly
Copy link

@xd009642, I setup cargo-tarpaulin using the README on crates.io and ran into this issue since the crates.io README doesn't yet have this change. Please consider bumping the version to update the crates.io README.

BTW, I discovered cargo-tarpaulin from your recent reddit post. I was looking for a coverage solution and was turned off by the complex setup of kcov. Cargo-tarpaulin is so much slicker!

jonhoo added a commit to jonhoo/faktory-rs that referenced this issue Jan 22, 2018
@xd009642
Copy link
Owner

Thanks for the compliment 😄 I did consider releasing a patch so crates.io is up-to-date but latest stable is out Feb 4th iirc and I'm hoping to actually have some more features to merge in. And that way I don't have to do another release to get rid of the warning about stable Rust!

jonhoo added a commit to jonhoo/msql-srv that referenced this issue Feb 27, 2018
@Marwes
Copy link

Marwes commented Mar 20, 2018

Seeing this issue on travis as well https://travis-ci.org/Marwes/combine/jobs/356101326#L946 I believe a fix for this hasn't been released(?)

@rfdonnelly
Copy link

@Marwes you need sudo on Travis. Update your .travis.yml per 1b8bf6c

@Marwes
Copy link

Marwes commented Mar 20, 2018

@rfdonnelly Yeah I saw that but #77 (comment) and #77 (comment) seems to indicate that there is a solution that does not require sudo. (Going to add sudo: required but it would better if that wasn't necessary)

@rfdonnelly
Copy link

@Marwes My understanding is that there is no solution for Travis that does not require sudo.

@xd009642
Copy link
Owner

Agree with @rfdonnelly sudo is required sorry about that

@sharksforarms
Copy link

This is unfortunate, trying to use tarpaulin in my Jenkins environment, cargo does not play nice with sudo

mklein994 added a commit to mklein994/dynamic_wallpaper that referenced this issue Aug 11, 2018
This solves an issue when running code coverage:
xd009642/tarpaulin#77
@new-commer
Copy link

I encountered the same error.
I have tried using sudo. like sudo -E cargo tarpaulin , it do not work
Is there anyone can tell me how to resolve it ?

@philipc
Copy link
Contributor

philipc commented Sep 6, 2018

@new-commer You shouldn't be using sudo to run tarpaulin. The workaround is to put sudo: required in your .travis.yml. The effect of the workaround is to disable use of containers in travis. If you're not using travis, then you'll need to find some other way to disable containers.

@new-commer
Copy link

new-commer commented Sep 6, 2018

@philipc Thanks for reply . I'm not use travis , and use gitlab ci , do you have any method to resolve it ?

@philipc
Copy link
Contributor

philipc commented Sep 6, 2018

travis is like gitlab ci, so the problem is the same, but the fix will be different. The problem is that containers (such as docker) normally have ASLR enabled, but tarpaulin can't work with ASLR. You'll need to figure out either how to run tarpaulin without docker, or how to configure docker to allow tarpaulin to disable ASLR (maybe there's a seccomp setting for this, I'm not familiar with it though).

@mgeisler
Copy link
Contributor

mgeisler commented May 4, 2019

Just a note that CircleCI fails the same way: https://circleci.com/gh/mgeisler/textwrap/58. It has worked very well for me until recently.

I've raised the issue in their discussion forum: https://discuss.circleci.com/t/cargo-tarpaulin-fails/30215. Perhaps they'll be able to fix this on their side, which would give us an easy way to run Tarpaulin again.

@rdaniels6813
Copy link

Workaround on CircleCI is to use machine: true and call the docker command directly with the --security-opt seccomp=unconfined flag.

An example of this can be found here: https://github.com/bittrd/rust-hello-world/blob/f8840e431009843d7bee652265230cc3fa0f3002/.circleci/config.yml#L38

@xd009642
Copy link
Owner

@rdaniels6813 oh thanks for that I'll add a note to the README 👍

@mgeisler
Copy link
Contributor

mgeisler commented Aug 5, 2019

I ended up using the following CircleCI configuration for textwrap:

version: 2
jobs:
  build:
    machine: true
    steps:
      - checkout
      - run:
          name: Pull xd009642/tarpaulin
          command: docker pull xd009642/tarpaulin
      - run:
          name: Generate coverage report
          command: >-
            docker run --security-opt seccomp=unconfined
            -v $PWD:/volume xd009642/tarpaulin
            cargo tarpaulin --out Xml --all-features
      - run:
          name: Upload to codecov.io
          command: bash <(curl -s https://codecov.io/bash) -Z -f cobertura.xml

This way only the cargo tarpaulin step is run in the Docker container and the whole pipeline takes about 2-3 minutes on my textwrap project.

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

9 participants