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

coverage: Avoid a possible query stability hazard in CoverageCounters #119401

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

Zalathar
Copy link
Contributor

#119252 revealed a possible query stability hazard in CoverageCounters: we iterate over the entries of an FxHashMap in a way that allows the iteration order to potentially affect the relative creation order of MIR blocks.

I'm not sure whether there's an actual stability problem or not in practice, but it's certainly a hazard, and I don't see any reason not to switch over to FxIndexMap to avoid potential issues.


This can either be merged on its own, or incorporated into #119252.

cc @Enselic
r? @cjgillot

The iteration order of this hashmap can potentially affect the relative
creation order of MIR blocks.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 29, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 29, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@Noratrieb
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 29, 2023

📌 Commit 8529b63 has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 29, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#119375 (Merge Coroutine lowering functions)
 - rust-lang#119393 (Use filter instead of filter_map in Parser::expected_one_of_not_found)
 - rust-lang#119401 (coverage: Avoid a possible query stability hazard in `CoverageCounters`)
 - rust-lang#119402 (Also walk bindings created by if-let guards)
 - rust-lang#119404 (Enable profiler in dist-powerpc-linux)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4b9a76c into rust-lang:master Dec 29, 2023
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Dec 29, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2023
Rollup merge of rust-lang#119401 - Zalathar:query-stability, r=Nilstrieb

coverage: Avoid a possible query stability hazard in `CoverageCounters`

rust-lang#119252 revealed a possible query stability hazard in `CoverageCounters`: we iterate over the entries of an `FxHashMap` in a way that allows the iteration order to potentially affect the relative creation order of MIR blocks.

I'm not sure whether there's an actual stability problem or not in practice, but it's certainly a hazard, and I don't see any reason not to switch over to `FxIndexMap` to avoid potential issues.

---

This can either be merged on its own, or incorporated into rust-lang#119252.

cc `@Enselic`
r? `@cjgillot`
@Zalathar Zalathar deleted the query-stability branch December 29, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants