test: --valgrind should check presence and version of binary #17724

issue Sjors opened this issue on December 11, 2019
  1. Sjors commented at 1:31 PM on December 11, 2019: member

    As a followup to #17633 we could use better error handling when valgrind executable is missing, or when something else goes wrong (e.g. #17633#pullrequestreview-326402329).

    E.g. I ran into (burried in the logs) valgrind: Unknown option: --exit-on-first-error=yes valgrind: Use --help for more information or consult the user manual..

    That would have been caught by checking the version number (3.13 doesn't have this flag).

  2. Sjors added the label Feature on Dec 11, 2019
  3. fanquake added the label Tests on Dec 11, 2019
  4. fanquake removed the label Feature on Dec 11, 2019
  5. MarcoFalke commented at 2:39 PM on December 11, 2019: member

    I think that exit-on-first-error can be removed, so that the option can be used on Ubuntu Bionic, and added back (assuming Ubuntu later than Bionic) during debugging when the cause of a failure is not apparent.

  6. MarcoFalke commented at 2:40 PM on December 11, 2019: member

    when something else goes wrong

    We have combine_logs.py, which should already handle all of this

  7. practicalswift commented at 3:25 PM on December 11, 2019: contributor

    Perhaps valgrind could be run without --exit-on-first-error=yes for users running Valgrind 3.13~3.14~ or older.

    Due to the super long run-times I still think it makes sense to use --exit-on-first-error=yes where possible (Valgrind 3.14~3.15~ or later).

    Edited: Messed up the version numbers. Sorry about that. --exit-on-first-error is supported by Valgrind 3.14 and above :)

  8. MarcoFalke commented at 3:25 PM on December 11, 2019: member

    Yeah, auto-detection would be even better

  9. practicalswift commented at 3:34 PM on December 11, 2019: contributor

    If anyone wants to tackle auto-detection:

    >>> subprocess.run(["valgrind", "--version"], \
            stdout=subprocess.PIPE).stdout.decode("utf-8").rstrip().split("valgrind-")[1:]
    ['3.15.0']
    >>> tuple(int(i) for i in subprocess.run(["valgrind", "--version"], \
            stdout=subprocess.PIPE).stdout.decode("utf-8").rstrip().split("valgrind-")[1:][0].split("."))
    (3, 15, 0)
    >>> tuple(int(i) for i in subprocess.run(["valgrind", "--version"], \
          stdout=subprocess.PIPE).stdout.decode("utf-8").rstrip().split("valgrind-")[1:][0].split(".")) \
          >= (3, 14, 0)
    True
    

    :)

  10. MarcoFalke added the label good first issue on Dec 11, 2019
  11. fanquake commented at 2:40 PM on August 4, 2022: member

    Going to close this. Anyone wanting to use valgrind should really be using a version newer than 3.13 (latest is 3.19), and focal ships with 3.15. I don't think anyone else has opened an issue about the flag exit-on-first-error flag since this was opened.

  12. fanquake closed this on Aug 4, 2022

  13. fanquake removed the label good first issue on Aug 4, 2022
  14. bitcoin locked this on Aug 4, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me