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

Canonicalize IR to disallow mutable GlobalRef in value position #39893

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Mar 2, 2021

Generally we assume parameters can be duplicated without seeing
side-effects. That is not entirely true of mutable globals and
multi-threading.

Refs: #36450
Fixes: #39508

Generally we assume parameters can be duplicated without seeing
side-effects. That is not entirely true of mutable globals and
multi-threading.

Refs: #36450
Fixes: #39508
@vtjnash vtjnash requested a review from Keno March 2, 2021 22:26
@vtjnash vtjnash added the backport 1.6 Change should be backported to release-1.6 label Mar 2, 2021
@Keno
Copy link
Member

Keno commented Mar 2, 2021

I think this is the right direction, but I'm not sure I agree with the memory model arguments here. LLVM will certainly freely duplicate these loads unless they're annotated volatile. Does our memory model make any guarantees in the presence of a data race here?

@vtjnash
Copy link
Member Author

vtjnash commented Mar 3, 2021

Yes, weakly. These are relaxed atomics currently, though I'd like to consider strengthening it to release/consume for non-mutated fields–such as typeof–in a future release (unrelated to this PR).

@Keno
Copy link
Member

Keno commented Mar 3, 2021

All right, fair enough.

@Keno Keno merged commit c0f9666 into master Mar 3, 2021
@Keno Keno deleted the jn/globalrefstmt branch March 3, 2021 01:05
KristofferC pushed a commit that referenced this pull request Mar 14, 2021
Generally we assume parameters can be duplicated without seeing
side-effects. That is not entirely true of mutable globals and
multi-threading.

Refs: #36450
Fixes: #39508
(cherry picked from commit c0f9666)
@KristofferC KristofferC mentioned this pull request Mar 14, 2021
14 tasks
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Mar 23, 2021
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
…aLang#39893)

Generally we assume parameters can be duplicated without seeing
side-effects. That is not entirely true of mutable globals and
multi-threading.

Refs: JuliaLang#36450
Fixes: JuliaLang#39508
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
…aLang#39893)

Generally we assume parameters can be duplicated without seeing
side-effects. That is not entirely true of mutable globals and
multi-threading.

Refs: JuliaLang#36450
Fixes: JuliaLang#39508
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
Generally we assume parameters can be duplicated without seeing
side-effects. That is not entirely true of mutable globals and
multi-threading.

Refs: #36450
Fixes: #39508
(cherry picked from commit c0f9666)
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

Successfully merging this pull request may close these issues.

internal IR corruption from use of a local variable assigned in a try block
3 participants