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

Cargo valgrind crashed while running tests. #55

Closed
Superhepper opened this issue May 6, 2022 · 9 comments
Closed

Cargo valgrind crashed while running tests. #55

Superhepper opened this issue May 6, 2022 · 9 comments

Comments

@Superhepper
Copy link

Thank you for an excellent tool!

As I was running this on our integration tests I experienced a crash with the following message:

cargo-valgrind: version 2.0.3
XML format mismatch between `valgrind` and `cargo valgrind`: custom: duplicate field `stack`
XML output of valgrind:
```xml
<?xml version="1.0"?>

<valgrindoutput>

<protocolversion>4</protocolversion>
<protocoltool>memcheck</protocoltool>

<preamble>
  <line>Memcheck, a memory error detector</line>
  <line>Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.</line>
  <line>Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info</line>
  <line>Command: /home/hepper/workspace/rust-tss-esapi/target/debug/deps/integration_tests-2d5723b6547f6cbb --test-threads=1 --nocapture</line>
</preamble>

<pid>9946</pid>
<ppid>9945</ppid>
<tool>memcheck</tool>

<args>
  <vargv>
    <exe>/usr/bin/valgrind.bin</exe>
    <arg>--xml=yes</arg>
    <arg>--xml-socket=127.0.0.1:41415</arg>
  </vargv>
  <argv>
    <exe>/home/hepper/workspace/rust-tss-esapi/target/debug/deps/integration_tests-2d5723b6547f6cbb</exe>
    <arg>--test-threads=1</arg>
    <arg>--nocapture</arg>
  </argv>
</args>

<status>
  <state>RUNNING</state>
  <time>00:00:00:01.897 </time>
</status>
@spital
Copy link

spital commented Jun 23, 2022

may be related:
#68 (comment)

@jfrimmel
Copy link
Owner

Could you try out the release 2.1.0? This nicht contain the fix for your issue.

@TommyAmberson
Copy link

I'm still getting this XML format mismatch error

$ cargo install --git https://github.com/jfrimmel/cargo-valgrind cargo-valgrind
    Updating git repository `https://github.com/jfrimmel/cargo-valgrind`
     Ignored package `cargo-valgrind v2.1.0 (https://github.com/jfrimmel/cargo-valgrind#43b31c93)` is already installed, use --force to override

What about the valgrind version?

$ valgrind --version
valgrind-3.18.1

@Superhepper
Copy link
Author

Superhepper commented Jul 29, 2022

Running with valgrind 3.15.0 and cargo-valgrind 2.1.0 actually made it worse. It crashes silently just after all the tests had been run and it was about to present the report.

When running without cargo valgrind the log ends like this:

test structures_tests::tagged_tests::tagged_signature_scheme_tests::test_invalid_any_sig ... [2022-07-29T19:06:36Z ERROR tss_esapi::structures::tagged::schemes] Cannot access digest for a non signing scheme
[2022-07-29T19:06:36Z ERROR tss_esapi::structures::tagged::schemes] Cannot access digest for a non signing scheme
ok
test structures_tests::tagged_tests::tagged_signature_scheme_tests::test_valid_any_sig ... ok
test structures_tests::time_attest_info_tests::test_conversion ... ok
test structures_tests::time_info_tests::test_conversion ... ok
test tcti_ldr_tests::tcti_context_tests::new_context ... ok
test tcti_ldr_tests::tcti_info_tests::new_info ... ok
test utils_tests::get_tpm_vendor_test::get_tpm_vendor ... [2022-07-29T19:06:36Z INFO  tss_esapi::context] Closing context.
[2022-07-29T19:06:36Z INFO  tss_esapi::context] Context closed.
ok

failures:

failures:
    abstraction_tests::transient_key_context_tests::activate_credential
    abstraction_tests::transient_key_context_tests::activate_credential_wrong_data
    abstraction_tests::transient_key_context_tests::activate_credential_wrong_key
    abstraction_tests::transient_key_context_tests::make_cred_params_name
    context_tests::tpm_commands::attestation_commands_tests::test_quote::certify
    context_tests::tpm_commands::duplication_commands_tests::test_duplicate::test_duplicate_and_import
    context_tests::tpm_commands::enhanced_authorization_ea_commands_tests::test_policy_template::basic_policy_template_test
    context_tests::tpm_commands::session_commands_tests::test_start_auth_session::test_nonce_sess
    error_tests::return_code_tests::esapi_tests::test_esapi_error_from_context_method

test result: FAILED. 448 passed; 9 failed; 3 ignored; 0 measured; 0 filtered out; finished in 84.63s

error: test failed, to rerun pass '-p tss-esapi --test integration_tests'

with cargo valgrind it looks like this:

[2022-07-29T19:13:20Z ERROR tss_esapi::structures::tagged::schemes] Cannot access digest for a non signing scheme
[2022-07-29T19:13:20Z ERROR tss_esapi::structures::tagged::schemes] Cannot access digest for a non signing scheme
[2022-07-29T19:13:21Z INFO  tss_esapi::context] Closing context.
[2022-07-29T19:13:21Z INFO  tss_esapi::context] Context closed.

error: test failed, to rerun pass '-p tss-esapi --test integration_tests'

@spital
Copy link

spital commented Jul 31, 2022

pls try at least valgrind 3.17, see #55 (comment)

@Superhepper
Copy link
Author

just tried it with valgrind 3.19 and wiht no difference. I got no XML output.

@jfrimmel
Copy link
Owner

Hey, the error with "XML format mismatch between valgrind and cargo valgrind: custom: duplicate field stack
" should be fixed as of cargo valgrind v2.2.0. Consider upgrading and testing you code. I'll go ahead and close this issue, but feel free to re-open if there are ongoing issues.

Thanks for your patience.

@jfrimmel
Copy link
Owner

With regards to newer valgrind versions: I always try with the latest valgrind version available, which is currently 3.23:

$ valgrind --version
valgrind-3.23.0

If your issue persists with 2.2.0 or newer versions of cargo valgrind, please report a new issue with details, so that I can reproduce and fix it.

@Superhepper
Copy link
Author

Superhepper commented Sep 17, 2024

This was a long time ago. We fixed the problem causing the memory leak and when we no longer had the gigantic reports this error went away.

And since then cargo valgrind have not had any problems in our CI pipeline that I know of. So I think it is safe to close this if no one else have encountered this.

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

4 participants