-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
more field property annotations #47677
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vchuravy
reviewed
Nov 23, 2022
@nanosoldier |
vtjnash
commented
Nov 30, 2022
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
17c5c83
to
eef92f0
Compare
Mostly looking at fixing more implicit data race with more atomics. Some of this (at the Julia level) is not strictly necessary since we already intend to start using implicit release-consume ordering for references. But since the user should not be changing these fields anyways, or risk severe breakage, this should be fine to mark explicitly.
eef92f0
to
261d447
Compare
Should we do a follow up like: diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl
index 81d0f06608..e55c79b69a 100644
--- a/base/compiler/typeinfer.jl
+++ b/base/compiler/typeinfer.jl
@@ -1096,7 +1096,7 @@ function typeinf_ext_toplevel(interp::AbstractInterpreter, linfo::MethodInstance
# method lambda - infer this specialization via the method cache
src = typeinf_ext(interp, linfo)
else
- src = linfo.uninferred::CodeInfo
+ src = @atomic :monotonic linfo.uninferred::CodeInfo
if !src.inferred
# toplevel lambda - infer directly
ccall(:jl_typeinf_timing_begin, Cvoid, ())
diff --git a/base/show.jl b/base/show.jl
index 9e6b959f24..3dbf345c8f 100644
--- a/base/show.jl
+++ b/base/show.jl
@@ -1246,7 +1246,8 @@ function show_mi(io::IO, l::Core.MethodInstance, from_stackframe::Bool=false)
# added by other means. But if it isn't, then we should try
# to print a little more identifying information.
if !from_stackframe
- linetable = l.uninferred.linetable
+ codeinf = (@atomic :monotonic l.uninferred)::CodeInfo
+ linetable = codeinf.linetable
line = isempty(linetable) ? "unknown" : (lt = linetable[1]::Union{LineNumberNode,Core.LineInfoNode}; string(lt.file, ':', lt.line))
print(io, " from ", def, " starting at ", line)
end
@@ -1270,7 +1271,8 @@ function show(io::IO, mi_info::Core.Compiler.Timings.InferenceFrameInfo)
show_tuple_as_call(io, def.name, mi.specTypes; argnames, qualified=true)
end
else
- linetable = mi.uninferred.linetable
+ codeinf = (@atomic :monotonic mi.uninferred)::CodeInfo
+ linetable = codeinf.linetable
line = isempty(linetable) ? "" : (lt = linetable[1]; string(lt.file, ':', lt.line))
print(io, "Toplevel InferenceFrameInfo thunk from ", def, " starting at ", line)
end
diff --git a/base/stacktraces.jl b/base/stacktraces.jl
index d74d47e1eb..0ab9a22584 100644
--- a/base/stacktraces.jl
+++ b/base/stacktraces.jl
@@ -124,7 +124,7 @@ function lookup(ip::Union{Base.InterpreterIP,Core.Compiler.InterpreterIP})
# interpreted top-level expression with no CodeInfo
return [StackFrame(top_level_scope_sym, empty_sym, 0, nothing, false, false, 0)]
end
- codeinfo = (code isa MethodInstance ? code.uninferred : code)::CodeInfo
+ codeinfo = (code isa MethodInstance ? (@atomic :monotonic code.uninferred) : code)::CodeInfo
# prepare approximate code info
if code isa MethodInstance && (meth = code.def; meth isa Method)
func = meth.name
diff --git a/stdlib/Serialization/src/Serialization.jl b/stdlib/Serialization/src/Serialization.jl
index e36b5c67e2..252695d635 100644
--- a/stdlib/Serialization/src/Serialization.jl
+++ b/stdlib/Serialization/src/Serialization.jl
@@ -446,7 +446,7 @@ function serialize(s::AbstractSerializer, linfo::Core.MethodInstance)
serialize_cycle(s, linfo) && return
writetag(s.io, METHODINSTANCE_TAG)
if isdefined(linfo, :uninferred)
- serialize(s, linfo.uninferred)
+ serialize(s, @atomic :monotonic linfo.uninferred)
else
writetag(s.io, UNDEFREF_TAG)
end , or are these explicit |
aviatesk
added a commit
to aviatesk/JET.jl
that referenced
this pull request
Dec 8, 2022
aviatesk
added a commit
to aviatesk/JET.jl
that referenced
this pull request
Dec 8, 2022
That is the default behavior, so it is unnecessary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mostly looking at fixing more implicit data race with more atomics. Some of this (at the Julia level) is not strictly necessary since we already intend to start using implicit release-consume ordering for references. But since the user should not be changing these fields anyways, or risk severe breakage, this should be fine to mark explicitly.