Skip to content

Run tests in memory sanitizer #17460

Closed

Description

@maflcko

We run the tests in the thread (and other sanitizers), see git grep sanitizer ./ci, but not in the memory sanitizer. This seems like it could be improved. See e.g. #17449

Activity

  1. maflcko commented on Nov 14, 2019

    @maflcko
    MemberAuthor

    On a second thought, it might be better to just run with valgrind: bitcoin-core/secp256k1#687 (comment)

  2. practicalswift commented on Nov 14, 2019

    @practicalswift
    Contributor

    @MarcoFalke I've tried to add Valgrind to our Travis build before: Valgrind is very good but also very very very slow. Running the unit tests and the functional tests under Valgrind takes hours(!) :(

    Perhaps DynamoRIO's Dr. Memory could be a faster option. I haven't investigated that option yet.

    Another alternative could be to run a subset of the tests under Valgrind and then use MSAN as a complement. With MSAN running all the tests including those excluded from the Valgrind run due to being too slow.

  3. maflcko commented on Nov 14, 2019

    @maflcko
    MemberAuthor

    Maybe running a single functional test (and/or unit test) in valgrind would be a good start. #17449 would have been caught when Bitcoin Core just boots up on mainnet.

  4. practicalswift commented on Nov 14, 2019

    @practicalswift
    Contributor

    Maybe running a single functional test (and/or unit test) in valgrind would be a good start.

    Agreed: to start with something under valgrind would be better nothing :)

    #17449 would have been caught when Bitcoin Core just boots up on mainnet.

    Do you mean "boots up on mainnet" as in when IBD is finished on mainnet?

    FWIW, I've only gotten valgrind to warn about the #17449 case when WarningBitsConditionChecker::Condition(…) is being run. That happens in UpdateTip given that we're done with IBD.

    Perhaps one would expect valgrind to warn earlier in the execution, such as when {CreateChain,Select}Params(…) is run. But that is not the case :)

  5. elichai commented on Nov 25, 2019

    @elichai
    Contributor
  6. locked as resolved and limited conversation to collaborators on Dec 16, 2021
  7. added a commit that references this issue on Jun 7, 2023
    86094b6
  8. added a commit that references this issue on Jul 19, 2026
    813dd6b
  9. added a commit that references this issue on Aug 30, 2026
    808e36c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions