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

Error "redefinition of constant attr_list" from Revise.track(Base) #677

Closed
mcabbott opened this issue Mar 27, 2022 · 4 comments
Closed

Error "redefinition of constant attr_list" from Revise.track(Base) #677

mcabbott opened this issue Mar 27, 2022 · 4 comments

Comments

@mcabbott
Copy link

mcabbott commented Mar 27, 2022

I'm getting an error I haven't seen reported, when trying to use Revise to track changes in Julia itself:

  | | |_| | | | (_| |  |  Version 1.9.0-DEV.252 (2022-03-26)
 _/ |\__'_|_|_|\__'_|  |  Commit 9d31f6a8d9 (0 days old master)
|__/                   |

julia> versioninfo()
Julia Version 1.9.0-DEV.252
Commit 9d31f6a8d9 (2022-03-26 20:08 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.1.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 4 on 4 virtual cores
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_PKG_USE_CLI_GIT = true
  JULIA_PKG_SERVER_REGISTRY_PREFERENCE = eager

(@v1.9) pkg> activate --temp
  Activating new project at `/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_E9glhC`

(jl_E9glhC) pkg> up
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_E9glhC/Project.toml`
  No Changes to `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_E9glhC/Manifest.toml`

(jl_E9glhC) pkg> add Revise
   Resolving package versions...
    Updating `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_E9glhC/Project.toml`
  [295af30f] + Revise v3.3.3
    Updating `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_E9glhC/Manifest.toml`
  [da1fd8a2] + CodeTracking v1.0.8
  [aa1ae85d] + JuliaInterpreter v0.9.11
  [6f1432cf] + LoweredCodeUtils v2.2.1
  [bac558e1] + OrderedCollections v1.4.1
  [ae029012] + Requires v1.3.0
  [295af30f] + Revise v3.3.3
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.8.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [fa267f1f] + TOML v1.0.0
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [deac9b47] + LibCURL_jll v7.81.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.0+0
  [14a3606d] + MozillaCACerts_jll v2022.2.1
  [83775a58] + Zlib_jll v1.2.12+1
  [8e850ede] + nghttp2_jll v1.41.0+1
  [3f19e933] + p7zip_jll v16.2.1+1
Precompiling project...
  2 dependencies successfully precompiled in 1 seconds. 7 already precompiled.

julia> using Revise; Revise.track(Base)

julia> 1+1
WARNING: redefinition of constant attr_list. This may fail, cause incorrect answers, or produce other errors.

Then it hangs. Sometimes it gets to Error showing value of type ERROR: and then nothing.

For definiteness this is with JuliaLang/julia#43334, newly rebased. The PR does not change anything very deep. I don't know what attr_list is; I think I remember seeing this complaint before, but it still worked.

Edit: In fact I get the same error on master, thus no changes for Revise to handle at all:

julia> using Revise; Revise.track(Base)

julia> 1+1
WARNING: redefinition of constant attr_list. This may fail, cause incorrect answers, or produce other errors.
Error showing value of type ERROR: 
^C^C^C^C^C^C^C^C^C^C^C^C^C^CWARNING: Force throwing a SIGINT
fatal: error thrown and no exception handler available.
InterruptException()
cong at /Users/me/.julia/dev/julia/src/./julia_internal.h:1127 [inlined]
jl_rand_ptls at /Users/me/.julia/dev/julia/src/partr.c:75
cong at ./partr.jl:31 [inlined]
multiq_insert at ./partr.jl:83
enq_work at ./task.jl:746
#schedule#612 at ./task.jl:808
schedule##kw at ./task.jl:799 [inlined]
notify at ./condition.jl:148
#notify#585 at ./condition.jl:142 [inlined]
notify at ./condition.jl:142 [inlined]
notify at ./condition.jl:142 [inlined]
task_done_hook at ./task.jl:623
jfptr_task_done_hook_53858 at /Users/me/.julia/dev/julia/usr/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/me/.julia/dev/julia/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/me/.julia/dev/julia/src/gf.c:2549
jl_apply at /Users/me/.julia/dev/julia/src/./julia.h:1833 [inlined]
jl_finish_task at /Users/me/.julia/dev/julia/src/task.c:254
start_task at /Users/me/.julia/dev/julia/src/task.c:942
┌ Warning: temp cleanup
│   exception =
│    schedule: Task not runnable
│    Stacktrace:
│      [1] error(s::String)
│        @ Base ~/.julia/dev/julia/base/error.jl:35
│      [2] enq_work(t::Task)
│        @ Base ~/.julia/dev/julia/base/task.jl:726
│      [3] yield
│        @ ./task.jl:841 [inlined]
│      [4] yield
│        @ ./task.jl:839 [inlined]
│      [5] Channel{Tuple{String, Vector{String}, Vector{String}}}(func::Base.Filesystem.var"#28#31"{String}, size::Int64; taskref::Nothing, spawn::Bool)
│        @ Base ~/.julia/dev/julia/base/channels.jl:140
│      [6] Channel (repeats 2 times)
│        @ ./channels.jl:133 [inlined]
│      [7] #walkdir#27
│        @ ./file.jl:963 [inlined]
│      [8] prepare_for_deletion(path::String)
│        @ Base.Filesystem ~/.julia/dev/julia/base/file.jl:507
│      [9] temp_cleanup_purge(; force::Bool)
│        @ Base.Filesystem ~/.julia/dev/julia/base/file.jl:542
│     [10] (::Base.var"#885#886")()
│        @ Base ./initdefs.jl:351
│     [11] _atexit()
│        @ Base ~/.julia/dev/julia/base/initdefs.jl:372
└ @ Base.Filesystem file.jl:547
UndefVarError: rn1 not defined
atexit hook threw an error: UndefVarError(var=:rn1)
ijl_undefined_var_error at /Users/me/.julia/dev/julia/src/rtutils.c:132
multiq_deletemin at ./partr.jl:135
trypoptask at ./task.jl:925
poptask at ./task.jl:933
wait at ./task.jl:944
uv_write at ./stream.jl:1043
unsafe_write at ./stream.jl:1115
write at ./strings/io.jl:244 [inlined]
print at ./strings/io.jl:246 [inlined]
showerror at ./errorshow.jl:163
unknown function (ip: 0x15619813b)
_jl_invoke at /Users/me/.julia/dev/julia/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/me/.julia/dev/julia/src/gf.c:2549
_atexit at ./initdefs.jl:374
jfptr__atexit_28624 at /Users/me/.julia/dev/julia/usr/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/me/.julia/dev/julia/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/me/.julia/dev/julia/src/gf.c:2549
jl_apply at /Users/me/.julia/dev/julia/src/./julia.h:1833 [inlined]
ijl_atexit_hook at /Users/me/.julia/dev/julia/src/init.c:219
ijl_exit at /Users/me/.julia/dev/julia/src/jl_uv.c:639
ijl_no_exc_handler at /Users/me/.julia/dev/julia/src/task.c:606
jl_finish_task at /Users/me/.julia/dev/julia/src/task.c:257
start_task at /Users/me/.julia/dev/julia/src/task.c:942
@KristofferC
Copy link
Collaborator

Have you e.g. changed branch of the julia repo without rebuilding julia?

@mcabbott
Copy link
Author

Yes, that was my intention. The PR branch is rebased on top of the master from which I built it.

However, I now get the error even on master.

@mcabbott
Copy link
Author

FWIW the same failure occurs when I run the tests. (On Julia master, exact same branch as built.)

(jl_fb9t4z) pkg> test Revise
     Testing Revise
      Status `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_F1W6Ae/Project.toml`
  [aafaddc9] CatIndices v0.2.2
  [da1fd8a2] CodeTracking v1.0.8
  [340492b5] EndpointRanges v0.2.1
  [97e2ac4a] EponymTuples v0.2.2
  [7876af07] Example v0.5.3
  [9b13fd28] IndirectArrays v1.0.0
  [aa1ae85d] JuliaInterpreter v0.9.11
  [6f1432cf] LoweredCodeUtils v2.2.1
  [1914dd2f] MacroTools v0.5.9
  [dbb5928d] MappedArrays v0.4.1
  [bac558e1] OrderedCollections v1.4.1
  [ae029012] Requires v1.3.0
  [295af30f] Revise v3.3.3
  [d5f540fe] RoundingIntegers v1.1.0
  [c4a57d5a] UnsafeArrays v1.0.3
  [8ba89e20] Distributed `@stdlib/Distributed`
  [7b1f6079] FileWatching `@stdlib/FileWatching`
  [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
  [76f85450] LibGit2 `@stdlib/LibGit2`
  [44cfe95a] Pkg v1.8.0 `@stdlib/Pkg`
  [3fa0cd96] REPL `@stdlib/REPL`
  [9a3f8284] Random `@stdlib/Random`
  [8dfed614] Test `@stdlib/Test`
  [cf7118a7] UUIDs `@stdlib/UUIDs`
  [4ec0a83e] Unicode `@stdlib/Unicode`
      Status `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_F1W6Ae/Manifest.toml`
  [79e6a3ab] Adapt v3.3.3
  [aafaddc9] CatIndices v0.2.2
  [da1fd8a2] CodeTracking v1.0.8
  [dc8bdbbb] CustomUnitRanges v1.0.2
  [340492b5] EndpointRanges v0.2.1
  [97e2ac4a] EponymTuples v0.2.2
  [7876af07] Example v0.5.3
  [9b13fd28] IndirectArrays v1.0.0
  [aa1ae85d] JuliaInterpreter v0.9.11
  [6f1432cf] LoweredCodeUtils v2.2.1
  [1914dd2f] MacroTools v0.5.9
  [dbb5928d] MappedArrays v0.4.1
  [6fe1bfb0] OffsetArrays v1.10.8
  [bac558e1] OrderedCollections v1.4.1
  [ae029012] Requires v1.3.0
  [295af30f] Revise v3.3.3
  [d5f540fe] RoundingIntegers v1.1.0
  [c4a57d5a] UnsafeArrays v1.0.3
  [0dad84c5] ArgTools v1.1.1 `@stdlib/ArgTools`
  [56f22d72] Artifacts `@stdlib/Artifacts`
  [2a0f44e3] Base64 `@stdlib/Base64`
  [ade2ca70] Dates `@stdlib/Dates`
  [8ba89e20] Distributed `@stdlib/Distributed`
  [f43a241f] Downloads v1.6.0 `@stdlib/Downloads`
  [7b1f6079] FileWatching `@stdlib/FileWatching`
  [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
  [b27032c2] LibCURL v0.6.3 `@stdlib/LibCURL`
  [76f85450] LibGit2 `@stdlib/LibGit2`
  [8f399da3] Libdl `@stdlib/Libdl`
  [37e2e46d] LinearAlgebra `@stdlib/LinearAlgebra`
  [56ddb016] Logging `@stdlib/Logging`
  [d6f4376e] Markdown `@stdlib/Markdown`
  [ca575930] NetworkOptions v1.2.0 `@stdlib/NetworkOptions`
  [44cfe95a] Pkg v1.8.0 `@stdlib/Pkg`
  [de0858da] Printf `@stdlib/Printf`
  [3fa0cd96] REPL `@stdlib/REPL`
  [9a3f8284] Random `@stdlib/Random`
  [ea8e919c] SHA v0.7.0 `@stdlib/SHA`
  [9e88b42a] Serialization `@stdlib/Serialization`
  [6462fe0b] Sockets `@stdlib/Sockets`
  [fa267f1f] TOML v1.0.0 `@stdlib/TOML`
  [a4e569a6] Tar v1.10.0 `@stdlib/Tar`
  [8dfed614] Test `@stdlib/Test`
  [cf7118a7] UUIDs `@stdlib/UUIDs`
  [4ec0a83e] Unicode `@stdlib/Unicode`
  [e66e0078] CompilerSupportLibraries_jll v0.5.2+0 `@stdlib/CompilerSupportLibraries_jll`
  [deac9b47] LibCURL_jll v7.81.0+0 `@stdlib/LibCURL_jll`
  [29816b5a] LibSSH2_jll v1.10.2+0 `@stdlib/LibSSH2_jll`
  [c8ffd9c3] MbedTLS_jll v2.28.0+0 `@stdlib/MbedTLS_jll`
  [14a3606d] MozillaCACerts_jll v2022.2.1 `@stdlib/MozillaCACerts_jll`
  [4536629a] OpenBLAS_jll v0.3.20+0 `@stdlib/OpenBLAS_jll`
  [83775a58] Zlib_jll v1.2.12+1 `@stdlib/Zlib_jll`
  [8e850b90] libblastrampoline_jll v5.1.0+0 `@stdlib/libblastrampoline_jll`
  [8e850ede] nghttp2_jll v1.41.0+1 `@stdlib/nghttp2_jll`
  [3f19e933] p7zip_jll v16.2.1+1 `@stdlib/p7zip_jll`
     Testing Running tests...
[ Info: The following error messge is expected for this broken test
┌ Error: Failed to revise /var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/xWZjhruw5N/Order2/src/Order2.jl
│   exception =
│    UndefVarError: Ord2 not defined
│    Stacktrace:
│     [1] top-level scope
│       @ /var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/xWZjhruw5N/Order2/src/Order2.jl:3
│    Revise evaluation error at /var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/xWZjhruw5N/Order2/src/Order2.jl:3
│    
└ @ Revise ~/.julia/packages/Revise/VskYC/src/packagedef.jl:708
┌ Warning: The running code does not match the saved version for the following files:
│ 
│   /var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/xWZjhruw5N/Order2/src/Order2.jl
│ 
│ If the error was due to evaluation order, it can sometimes be resolved by calling `Revise.retry()`.
│ Use Revise.errors() to report errors again. Only the first error in each file is shown.
│ Your prompt color may be yellow until the errors are resolved.
└ @ Revise ~/.julia/packages/Revise/VskYC/src/packagedef.jl:818
Revise is currently tracking the following files in ReviseFileNow [top-level]: ["src/ReviseFileNow.jl"]
[ Info: tracking Base
WARNING: redefinition of constant attr_list. This may fail, cause incorrect answers, or produce other errors.

@mcabbott
Copy link
Author

Closing this as the problem seems to have gone away.

On Julia master, I get a warning like this, but no ill effects that I know of:

  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-DEV.357 (2022-04-11)
 _/ |\__'_|_|_|\__'_|  |  Commit 0deb3265ee (0 days old master)
|__/                   |

julia> using Revise; Revise.track(Base)

julia> 1+1
WARNING: redefinition of constant heaps_lock. This may fail, cause incorrect answers, or produce other errors.
2

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

No branches or pull requests

2 participants