-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
Tarpaulin v0.17.0 sometimes errors with a message about a segfault when trying to build against musl #618
Comments
0.17.0 has a bug that causes segfaults: xd009642/tarpaulin#618
Note: The bug referenced in ZcashFoundation/zebra#1283 is slightly different (but possibly related). It occurs when building against glibc, and the error message is different. |
0.17.0 has a bug that causes segfaults: xd009642/tarpaulin#618
I also have the same problem. In the previous version(0.16.0), I used the following commands to successfully execute and generate unit test coverage:
but after upgrading to v0.17.0, the following errors began to appear:
Can the cargo tarpaulin tool specify a certain version to install? |
It's interesting that the relocation model needs to be set explicitly I'll try some stuff with musl and see if I can get to the bottom of it... Generally tarpaulin adding linker flags tends to make issues for some projects so it's interesting to see the inverse 😬 @cptpcrd and @xiye518 are your tests launching external processes? I added functionality to follow exec events down if the binary was part of the project so it's likely a problem with that which wasn't caught in testing. I'll have a look at these issues tonight! @xiye518 |
I've also been seeing similar issues for a couple of days now and have been trying to reduce the segfault to a minimal reproducible example but the segfault seems to "move" when tests are recompiled. I am using glibc.
I've also seen a SIGILL:
Project: https://github.com/MitMaro/git-interactive-rebase-tool Failing coverage run in GitHub Actions: https://github.com/MitMaro/git-interactive-rebase-tool/runs/1390537880?check_suite_focus=true |
The reproducible example I added doesn't have any tests. When linking against musl instead of glibc, the mere presence of a function that does particular things is enough to make it segfault. @MitMaro and @xiye518 seem to have encountered slightly different versions of this bug. |
I think there are two bugs here, I musl seems to cause very large address offsets to be reported which I think is leading to mis-instrumentation. For @MitMaro and @xiye518 I cant map the thread id to a parent pid with the new exec aware tracing. If I stub it so if it fails it's always the root test id it seems to always work... But that may then break tests that trace execs. If I can't find a better solution by the end of the week I'll release a patch doing that, after all having a new feature break some projects that use it is better than breaking existing projects. |
@xd009642 , I wish I knew more about how this project works to help out. If there is anything that I can do to provide help, please don't hesitate to ping me. Also, thanks for the amazing project! |
Okay I've figured out the musl bug, I just need to implement it. In the process memory map it adds vvar and vDSO before the executable which is I guess the memory map info for musl itself. glibc the process is always first which I thought should hold for everything. I'll fix this and also add a test for musl binaries to avoid regressions. After sleeping on it I think I have a solution for the other problem I just need to do some experimentation 😄 |
@xd009642 , just gave the branch and try and I can confirm that it works. Thanks for the quick update! Hopefully, the timeout issue isn't too difficult. :) |
The command you gave helped me successfully. I have now reduced my test environment version back to 0.16.0 and can now successfully generate coverage information; thank you for this amazing project! I will continue to pay attention to this project, and when this bug is fixed, I will experience the new version as soon as possible. |
Possibly related to #463 which also appears to be a regression in 0.17.0, and also exhibits similar symptoms. |
I've just yanked 0.17.0, I figured I'd spend a bit longer on the issues and didn't want to keep peoples CI broken in the meantime |
So I have a potential fix for everything on the |
I really hate to be annoying, but is there any progress on this issue? Is there any help needed (testing etc.)? I would really like to be able to see coverage for a project with integration tests only, run against the binary (which was implemented in the yanked 0.17.0, #107). |
so I've merged a partial fix to the develop branch which adds a I've got one bug that's also in 0.16.0 to fix that I just need to do a test for and then if follow-exec works for enough people I'll release a new version. I just need to find the time alongside my day job and a bunch of end of year deadlines... |
The |
Closing this as only the zebra issue remains which seems to be separate. |
Steps to reproduce
I've managed to work my code down to this minimal example:
(Clarification edit: As the title indicates, I have only encountered this when trying to build/test against musl libc; the same programs build fine when targetting glibc.)
What should happen
tarpaulin
builds the target and runs successfully. (It worked withtarpaulin
v0.16.0.)What actually happens
tarpaulin
fails with a message about a segfault.I'm not familiar with
tarpaulin
's internals (not by a long shot :-), so I can't debug this any further.Environment
I've been able to reproduce this on Arch Linux, Void Linux, and Ubuntu (all three had rustc 1.47.0 and were running either the latest kernel from the repos or only a few revisions behind).
Potential cause
It looks like this regression was caused (at least, most directly) by #613.
RUSTFLAGS='-C relocation-model=dynamic-no-pic' cargo tarpaulin --target=x86_64-unknown-linux-musl --verbose
builds with no problems.The text was updated successfully, but these errors were encountered: