tarpaulin: Inconsistent segfault error (non-deterministic)

On a project I’m working on, I have this inconsistent error

[ERROR tarpaulin] Failed to get test coverage! Error: Failed to run tests: A segfault occurred while executing tests
Error: "Failed to get test coverage! Error: Failed to run tests: A segfault occurred while executing tests"
##[error]The process '/usr/share/rust/.cargo/bin/cargo' failed with exit code 1

I say inconsistent because it never happens at the same time of the process. I’ve been able to reproduce locally at some point but then, launching the same cargo tarpaulin command over and over, it eventually works. Funnier, it seems that once it works, it always works (I even was able to do a cargo clean and make it work). So the error never happen consistently.

I’m working on Ubuntu 20.04 with the following (but this error also happened on our CI https://github.com/CanalTP/transit_model/pull/558/checks?check_run_id=716136628)

$> rustup --version
rustup 1.21.1 (7832b2ebe 2019-12-20)
$> cargo --version
cargo 1.43.0 (2cbe9048e 2020-05-03)
$> rustc --version
rustc 1.43.1 (8d69840ab 2020-05-04)
$> cargo tarpaulin --version
cargo-tarpaulin version: 0.13.2

I looked for similar issues but didn’t feel like the problem was the same. Sorry if this is a duplicate.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (11 by maintainers)

Commits related to this issue

Most upvoted comments

ahh capsule is good, I can recreate it reliably using it and there’s no so many traces that it’s insurmountable to display a plot 👍 I’ll start using that to investigate this issue

I’m just going to close this as it looks like we might have found the solution, but if it still doesn’t work for you feel free to reopen or raise a new issue!

Might be worth refreshing the docker cache I didn’t realise until recently the yanked 0.17 was still the latest image in docker. It’s not replaced with 0.18.0-alpha1. Also docker needs different seccomp privileges which are detailed in the README. Hopefully it’s one of those two issues 😁

@floric I tried your project a few times and it worked. How often does it fail? I’m on rust 1.50

|| Tested/Total Lines:
|| src/bin.rs: 0/2
|| src/db/change_listener.rs: 44/46
|| src/db/client.rs: 148/177
|| src/db/database.rs: 75/89
|| src/db/mod.rs: 0/8
|| src/jobs/cleanup_games.rs: 51/59
|| src/jobs/cleanup_players.rs: 50/66
|| src/jobs/mod.rs: 0/12
|| src/lib.rs: 0/9
|| src/model/card.rs: 2/15
|| src/model/game.rs: 89/113
|| src/model/player.rs: 67/77
|| src/model/proto/card.rs: 0/120
|| src/model/proto/game.rs: 48/249
|| src/model/proto/message.rs: 90/1299
|| src/model/proto/player.rs: 31/351
|| src/model/proto/task.rs: 0/160
|| src/model/task.rs: 0/9
|| src/server/app_context.rs: 36/41
|| src/server/auth.rs: 47/47
|| src/server/endpoints/active_game.rs: 0/68
|| src/server/endpoints/client_messages/auth_confirmed.rs: 68/86
|| src/server/endpoints/client_messages/game_started.rs: 77/79
|| src/server/endpoints/client_messages/name_updated.rs: 27/29
|| src/server/endpoints/games.rs: 127/135
|| src/server/logger.rs: 12/13
|| src/server/mod.rs: 0/36
|| src/server/reply.rs: 11/19
|| src/server/ws/client.rs: 12/59
|| src/server/ws/connections.rs: 34/69
|| 
32.35% coverage, 1146/3542 lines covered

Our code base changed significantly so it’s possible that any attempt to reproduce will not be reproducing under the same conditions. We are currently using grcov (because it’s also runnable on a Mac, for local development), but I’m actually curious to try tarpaulin again to see if there are changes in the coverage report. I will update once I do. Thanks!

On Wed, Sep 2, 2020, 8:47 AM Zeeshan Lakhani notifications@github.com wrote:

@xd009642 https://github.com/xd009642 @woshilapin https://github.com/woshilapin still failing for me on 0.14.3:

[ERROR tarpaulin] Failed to get test coverage! Error: Failed to run tests: A segfault occurred while executing tests Error: “Failed to get test coverage! Error: Failed to run tests: A segfault occurred while executing tests”

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xd009642/tarpaulin/issues/461#issuecomment-685825052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHMIQACMS62FPSPHLOO2LSDZSJZANCNFSM4NNJGLSQ .

I managed to recreate it once but haven’t yet figured out what causes it. Though I admit I ended up not working on tarpaulin as much the past few weeks. I’ll have a look today or tomorrow see if I can figure it out.

I also made a tarpaulin debugging tool last year which I think I’ll integrate into the code to make diagnosing issues like this easier. Right now it exists in a different repo as a harness around some of the internals and needs some updating. Once I’ve done that I might ask you if you can use that branch to generate some debug traces and send them to me

Interesting, once I finish the stuff I’m currently working on I’ll have a look and see if I can get to the bottom of it