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

Enable ptrace capability in container based builds #9033

Closed
iphydf opened this Issue Jan 10, 2018 · 12 comments

Comments

Projects
None yet
9 participants
@iphydf

iphydf commented Jan 10, 2018

Result of it not being available: https://travis-ci.org/TokTok/c-toxcore/jobs/326064366#L2510

==16113==LeakSanitizer has encountered a fatal error.
==16113==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==16113==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

Context: google/sanitizers#764

Solution: add --cap-add SYS_PTRACE to the docker invocation.

@BanzaiMan BanzaiMan added the team blue label Jan 10, 2018

primiano pushed a commit to catapult-project/perfetto that referenced this issue Jan 10, 2018

[Patchset 1] Use sudo: true for ASAN and LSAN.
This is to work around
travis-ci/travis-ci#9033

Bug:
Change-Id: Ib6397c1caef1503809a707cfbcdb5015c612d429
@primiano

This comment has been minimized.

primiano commented Jan 10, 2018

I think this is causing some similar issue to our sanitizers:
https://travis-ci.org/catapult-project/perfetto/jobs/327231465

which I think were working fine until few days ago

Is there any other option other than adding sudo: true, that seems to slow down containers startup time.

primiano pushed a commit to catapult-project/perfetto that referenced this issue Jan 10, 2018

[Patchset 2] Use sudo: true for ASAN and LSAN.
This is to work around
travis-ci/travis-ci#9033

Bug: 71795056
Change-Id: Ib6397c1caef1503809a707cfbcdb5015c612d429

primiano pushed a commit to catapult-project/perfetto that referenced this issue Jan 10, 2018

Use sudo: true for ASAN and LSAN.
This is to work around
travis-ci/travis-ci#9033

Bug: 71795056
Change-Id: Ib6397c1caef1503809a707cfbcdb5015c612d429

justinmk added a commit to justinmk/neovim that referenced this issue Jan 10, 2018

ci/travis: require "sudo" for ASAN_UBSAN build
Workaround for this fun new issue:

    ==27404==LeakSanitizer has encountered a fatal error.
    ==27404==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
    ==27404==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
    Failed: E /build|logs :: Runtime errors detected.

travis-ci/travis-ci#9033
google/sanitizers#764
@tlyu

This comment has been minimized.

tlyu commented Jan 10, 2018

I'm seeing the same issue. The same commit worked 2 days ago and fails today. I increased verbosity and got:

circuit_timeout: [forking] ==11975==Could not attach to thread 11974 (errno 1).
==11975==Failed suspending threads.
==11974==LeakSanitizer has encountered a fatal error.
==11974==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==11974==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

full log of working build:
https://api.travis-ci.org/v3/job/326495564/log.txt
full log of failing build (with the increased LSAN verbosity):
https://api.travis-ci.org/v3/job/327432797/log.txt

@iboB

This comment has been minimized.

iboB commented Jan 12, 2018

Same issue here

==5899==LeakSanitizer has encountered a fatal error.
==5899==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==5899==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

https://travis-ci.org/iboB/dynamix/jobs/328246310

The exact same source was passing a couple of days ago

@verri

This comment has been minimized.

verri commented Jan 14, 2018

iboB added a commit to iboB/dynamix that referenced this issue Jan 14, 2018

Naios added a commit to Naios/continuable that referenced this issue Jan 29, 2018

j123b567 added a commit to j123b567/scpi-parser that referenced this issue Jan 29, 2018

Fix ASAN unit tests for travis
Fix Sanitizer enabled builds for Travis until travis-ci/travis-ci#9033 is fixed

paboldin added a commit to paboldin/libcare that referenced this issue Jan 30, 2018

travis: use VM for now
Attaching even to a children process is broken in travis's Docker.
Use VM until travis-ci/travis-ci#9033
is fixed.

Signed-off-by: Pavel Boldin <pboldin@cloudlinux.com>

daviddrysdale added a commit to daviddrysdale/c-ares that referenced this issue Jan 31, 2018

travis: use VM not container for {L,A}SAN builds
As per travis-ci/travis-ci#9033, container
based builds do not currently allow ptrace, which is used by LSAN and
ASAN.

@gnzlbg gnzlbg referenced this issue Feb 1, 2018

Open

Add travis ci #7

@gnzlbg

This comment has been minimized.

gnzlbg commented Feb 1, 2018

Have the same problem with Rust and LSan enabled :/

@gnzlbg

This comment has been minimized.

gnzlbg commented Feb 1, 2018

Is there another workaround beyond enabling sudo: true or sudo: required ? I have tried it here but it is not fixing this issue for me: https://travis-ci.org/gnzlbg/rust-san/jobs/336182849#L972

daviddrysdale added a commit to c-ares/c-ares that referenced this issue Feb 4, 2018

travis: use VM not container for {L,A}SAN builds (#177)
As per travis-ci/travis-ci#9033, container
based builds do not currently allow ptrace, which is used by LSAN and
ASAN.

iboB added a commit to iboB/dynamix that referenced this issue Feb 6, 2018

mptre added a commit to mptre/pick that referenced this issue Feb 11, 2018

travis: enable sudo for now
Work-around for permission issue with Clang sanitizers[0].

[0] travis-ci/travis-ci#9033

joto added a commit to mapbox/vtzero that referenced this issue Feb 21, 2018

Use VM-based instead of container-based system.
Hopefully fixes "Could not attach to thread" problems for builds with
LeakSanitizer.
See travis-ci/travis-ci#9033
@nwellnhof

This comment has been minimized.

nwellnhof commented Feb 22, 2018

It would be nice if we could at least get an answer whether there are intentions to get this fixed. Otherwise, everyone can switch over to sudo: true for good.

@BanzaiMan

This comment has been minimized.

Member

BanzaiMan commented Feb 22, 2018

Hello. This is not something we are prioritizing to investigate. If you need this capability in the near future, please use sudo: required. Thanks.

nwellnhof added a commit to nwellnhof/libxml2 that referenced this issue Apr 16, 2018

onqtam added a commit to onqtam/doctest that referenced this issue May 9, 2018

martinjrobins added a commit to OxfordRSE/template-project-cpp that referenced this issue May 10, 2018

onqtam added a commit to onqtam/doctest that referenced this issue May 10, 2018

@stale

This comment has been minimized.

stale bot commented May 23, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 24 hours. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label May 23, 2018

@stale stale bot closed this May 24, 2018

@segfaulthunter

This comment has been minimized.

segfaulthunter commented May 24, 2018

This has not been resolved but is still applicable. We would still like to eventually go back to sudo: false.

@gnzlbg

This comment has been minimized.

gnzlbg commented May 24, 2018

@BanzaiMan could you reopen this?

@BanzaiMan

This comment has been minimized.

Member

BanzaiMan commented May 24, 2018

As I indicated back in February, this is highly unlikely to be addressed in the foreseeable future. It seems to me that documenting this may be OK (though I think this is too specific to mention in our docs; e.g., https://docs.travis-ci.com/user/reference/overview/#Virtualization-environments), but I don't think having this open serves a lot of people.

josephlr added a commit to josephlr/phc-winner-argon2 that referenced this issue Jun 2, 2018

Fix Travis failures
Argon2 by default runs Travis CI in a containerized environment
https://docs.travis-ci.com/user/reference/overview/#Container-based

This is faster and works fine for most things. However, P-H-C#89 added ASAN
to the test cases. As ASAN requires the SYS_PTRACE capability, when
Travis/Docker permissions changed earlier this year, our tests stoped
working. See travis-ci/travis-ci#9033

The solution is just to run ASAN in a VM (sudo=true).

josephlr added a commit to josephlr/phc-winner-argon2 that referenced this issue Jun 2, 2018

Fix Travis failures
Argon2 by default runs Travis CI in a containerized environment
https://docs.travis-ci.com/user/reference/overview/#Container-based

This is faster and works fine for most things. However, P-H-C#89 added ASAN
to the test cases. As ASAN requires the SYS_PTRACE capability, when
Travis/Docker permissions changed earlier this year, our tests stoped
working. See travis-ci/travis-ci#9033

The solution is just to run ASAN in a VM (sudo=true). This test takes so
long normally that the cost to startup a VM is relativly small.

josephlr added a commit to josephlr/phc-winner-argon2 that referenced this issue Jun 2, 2018

Fix Travis failures
Argon2 by default runs Travis CI in a containerized environment
https://docs.travis-ci.com/user/reference/overview/#Container-based

This is faster and works fine for most things. However, P-H-C#89 added ASAN
to the test cases. As ASAN requires the SYS_PTRACE capability, when
Travis/Docker permissions changed earlier this year, our tests stoped
working. See travis-ci/travis-ci#9033

The solution is just to run ASAN in a VM (sudo=true). This test takes so
long normally that the cost to startup a VM is relativly small.

squeek502 added a commit to squeek502/d2itemreader that referenced this issue Jun 21, 2018

dschlaep added a commit to DrylandEcology/SOILWAT2 that referenced this issue Jul 13, 2018

Fix travis yml for `*_severe` targets
We want to run the `*_severe` debug and test targets; thus, we need to enable ptrace capability for (L/A)SAN which is currently not possible
with container-based builds on travis-ci

TODO: revert to `sudo: false` (i.e., container-based builds) once the following are fixed/made possible
 - google/sanitizers#764
 - travis-ci/travis-ci#9033

vbuchhold added a commit to RoutingKit/RoutingKit that referenced this issue Jul 20, 2018

nwellnhof added a commit to nwellnhof/libxslt that referenced this issue Jul 24, 2018

nwellnhof added a commit to nwellnhof/libxslt that referenced this issue Jul 24, 2018

jibsen added a commit to jibsen/brieflz that referenced this issue Sep 8, 2018

jibsen added a commit to jibsen/brieflz that referenced this issue Sep 11, 2018

jibsen added a commit to jibsen/brieflz that referenced this issue Sep 13, 2018

FelixPetriconi added a commit to FelixPetriconi/libraries that referenced this issue Nov 3, 2018

@offa offa referenced this issue Nov 13, 2018

Closed

Clang / GCC Leak Sanitizer fails on Travis #129

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