Skip to content

ci: Add missing -O2 to valgrind tasks - #28071

Merged
fanquake merged 1 commit into
bitcoin:masterfrom
maflcko:2307-ci-valgrind-o2-
Jul 14, 2023
Merged

fanquake merged 1 commit into
bitcoin:masterfrom
maflcko:2307-ci-valgrind-o2-

Conversation

@maflcko

@maflcko maflcko commented Jul 12, 2023

Copy link
Copy Markdown
Member

Currently the tasks have nothing (-O0) set, which makes them slow.

Fix this by falling back to the default (-O2).

@DrahtBot

DrahtBot commented Jul 12, 2023 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK dergoegge, recursive-rat4

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27992 (ci: build Valgrind (3.21) from source by fanquake)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot added the Tests label Jul 12, 2023
@dergoegge

Copy link
Copy Markdown
Member

which makes them slow

How much faster are they with -O2?

@maflcko

maflcko commented Jul 12, 2023 •

Copy link
Copy Markdown
Member Author

How much faster are they with -O2?

Yes.

(Locally the functional tests go from 77837 s (accumulated) to 19769 s (accumulated))

@dergoegge

Copy link
Copy Markdown
Member

(Locally the functional tests go from (hasn't finished) to 19769s (accumulated))

Any results for the fuzz task? Just to compare it to the speed up observed in #27992

@maflcko

maflcko commented Jul 12, 2023

Copy link
Copy Markdown
Member Author

Yes.

From:

Run asmap_direct with args ['valgrind', '--quiet', '--error-exitcode=1', '/root/bitcoin/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/fuzz/fuzz', '-runs=1', PosixPath('/root/bitcoin/ci/scratch/qa-assets/fuzz_seed_corpus/asmap_direct')]INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 98738393
INFO: Loaded 1 modules   (248427 inline 8-bit counters): 248427 [0x2781858, 0x27be2c3), 
INFO: Loaded 1 PC tables (248427 PCs): 248427 [0x27be2c8,0x2b88978), 
INFO:      645 files found in /root/bitcoin/ci/scratch/qa-assets/fuzz_seed_corpus/asmap_direct
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes
INFO: seed corpus: files: 645 min: 1b max: 1048576b total: 15304310b rss: 169Mb
#512	pulse  cov: 329 ft: 1557 corp: 243/22Kb exec/s: 21 rss: 188Mb
#646	INITED cov: 329 ft: 1576 corp: 257/39Kb exec/s: 5 rss: 219Mb
#646	DONE   cov: 329 ft: 1576 corp: 257/39Kb lim: 2177 exec/s: 5 rss: 219Mb
Done 646 runs in 128 second(s)

To:

Run asmap_direct with args ['valgrind', '--quiet', '--error-exitcode=1', '/root/bitcoin/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/fuzz/fuzz', '-runs=1', PosixPath('/root/bitcoin/ci/scratch/qa-assets/fuzz_seed_corpus/asmap_direct')]INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1921218028
INFO: Loaded 1 modules   (362668 inline 8-bit counters): 362668 [0x1c58000, 0x1cb08ac), 
INFO: Loaded 1 PC tables (362668 PCs): 362668 [0x1cb08b0,0x2239370), 
INFO:      645 files found in /root/bitcoin/ci/scratch/qa-assets/fuzz_seed_corpus/asmap_direct
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes
INFO: seed corpus: files: 645 min: 1b max: 1048576b total: 15304310b rss: 196Mb
#512	pulse  cov: 238 ft: 1316 corp: 367/51Kb exec/s: 128 rss: 216Mb
#646	INITED cov: 238 ft: 1372 corp: 395/91Kb exec/s: 35 rss: 248Mb
#646	DONE   cov: 238 ft: 1372 corp: 395/91Kb lim: 8193 exec/s: 35 rss: 248Mb
Done 646 runs in 18 second(s)

@recursive-rat4

Copy link
Copy Markdown
Contributor

Why not CXXFLAGS='$CXXFLAGS -gdwarf-4'?

@maflcko

maflcko commented Jul 13, 2023

Copy link
Copy Markdown
Member Author

Why not CXXFLAGS='$CXXFLAGS -gdwarf-4'?

Feel free to test it and make an alternative pull, but I am pretty sure it will not work. Also, I don't see any upside and it is more verbose.

@dergoegge dergoegge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fa4ccf1

@recursive-rat4

Copy link
Copy Markdown
Contributor

utACK fa4ccf1

CXXFLAGS was set in #24735 without intention to disable optimizations.

@maflcko

maflcko commented Jul 13, 2023

Copy link
Copy Markdown
Member Author

rfm or is something missing here?

@fanquake

Copy link
Copy Markdown
Member

Use of -O2 and above is not recommended as Memcheck occasionally reports uninitialised-value errors which don't really exist.

I guess this doesn't matter for us/is no-longer the case in Memcheck? Some mailing list discussion suggests so.

I think there's another issue here (for a different PR) where we should be setting some optimisation level in our build flags, because setting additional flags should not this problem.

@maflcko

maflcko commented Jul 13, 2023

Copy link
Copy Markdown
Member Author

I guess this doesn't matter for us/is no-longer the case in Memcheck? Some mailing list discussion suggests so.

Only for gcc, see #27741

I think there's another issue here (for a different PR) where we should be setting some optimisation level in our build flags, because setting additional flags should not this problem.

Right. Probably not worth to spend time here, with the switch to cmake. But that makes me wonder how cmake handles this.

@fanquake

Copy link
Copy Markdown
Member

Right. Probably not worth to spend time here,

I'll follow up with this, because it certainly shouldn't be broken, and if it is, it's not specific to valgrind etc.

@fanquake
fanquake merged commit 4a1aae6 into bitcoin:master Jul 14, 2023
@maflcko
maflcko deleted the 2307-ci-valgrind-o2- branch July 14, 2023 12:47
@bitcoin bitcoin locked and limited conversation to collaborators Jul 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants