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

Not working on unit tests (missing field xwhat) #32

Closed
faern opened this issue Apr 26, 2020 · 8 comments · Fixed by #49
Closed

Not working on unit tests (missing field xwhat) #32

faern opened this issue Apr 26, 2020 · 8 comments · Fixed by #49
Labels
bug Something isn't working

Comments

@faern
Copy link

faern commented Apr 26, 2020

Hi. Really awesome project. I love how much simpler it is to check for memory leaks etc with this tool. However I'm not able to run this on my integration tests on a Fedora Linux machine. I'm not sure if Cargo changed in some incompatible way or if I have an unsupported version of valgrind?

This is the software I'm running:

$ valgrind --version
valgrind-3.15.0
$ cargo valgrind --version
cargo-valgrind 1.3.0
$ cargo --version
cargo 1.43.0 (3532cf738 2020-03-17)

And this is the issue I'm getting:

$ cargo valgrind --test all_tests
...
error: Could not parse XML: custom: 'missing field `xwhat`'
@faern faern changed the title Not working on unit tests Not working on unit tests (missing field xwhat) Apr 26, 2020
@faern
Copy link
Author

faern commented Apr 26, 2020

It seems to work when running under Rust 1.39. cargo +1.39.0 valgrind --test all_tests does work. But only after a cargo clean. The builds with newer Rust seem to leave some metadata that cargo-valgrind does not understand.

@elichai
Copy link

elichai commented Aug 28, 2020

that would be great if I could run this on unit tests.

@jfrimmel
Copy link
Owner

Hello @faern,

can you provide me some test input for reproduction? Alternatively, you can try out the new version I've just updated. If you want to, you can try the new software using the following command:

cargo install --git https://github.com/jfrimmel/cargo-valgrind --branch custom-runner

@faern
Copy link
Author

faern commented Mar 12, 2021

I currently can't reproduce the issue. I can't remember exactly how I hit the problem, but I remember it being easy to get back then. I now have valgrind-3.16.1. So that could be why. Or newer Rust.

I think I got the problem in this repo: https://github.com/faern/loom-executor. It's the only one of my repos where I can find a all_tests.rs.

@jfrimmel jfrimmel added the bug Something isn't working label Mar 18, 2021
@jamesmishra
Copy link

I ran into this issue when using Valgrind 3.15.0 as packaged in the Ubuntu 20.04 repositories. The problem went away when I compiled Valgrind 3.16.1 on my own.

@marmeladema
Copy link

Hello and thank you very much for this tool which is incredibly useful!

I am encountering the same bug locally with valgrind 3.16.1. Therefore, I installed cargo-valgrind from the malformed-xml branch using:

$ cargo install --git https://github.com/jfrimmel/cargo-valgrind --branch malformed-xml -- cargo-valgrind

I rerun the test and I now have the failing XML printed out!

valgrind.log

I hope this helps!

@jfrimmel
Copy link
Owner

Thank you for the log, that's helpful. I'll have a look and hope to fix it soon.

@annapst
Copy link

annapst commented Jun 1, 2021

Hi! I wanted to share the environment in which I’m encountering the same issue today, including sample project and Dockerfile to reproduce. I hope this helps!
valgrind_test.zip

@vhqtvn vhqtvn mentioned this issue Oct 21, 2021
jfrimmel pushed a commit that referenced this issue Oct 28, 2021
Default-construct `xwhat` and filter out empty ones in order to allow more Valgrind output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants