JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
621 stars 268 forks source link

segfault from `Pkg.add` that only happens when REPL isn't fresh (1.7.0-rc1, apple silicon) #2759

Closed anandijain closed 2 years ago

anandijain commented 3 years ago

This is one of these annoying issues that's pretty hard to reproduce.

I included some of the stuff I was doing in the first REPL to indicate that it was not a "clean state". Prior to these, I didn't do any Pkg commands besides using. I'm not sure exactly I did would cause it to crash in the first REPL but not the second.

While I had loaded some of these locally dev'd pkgs in REPL 1, I think that it is not the cause of the crash.

julia> xml.node
EzXML.Node(<DOCUMENT_NODE@0x00000002ba616390>)

julia> xml.node^C

julia> using XMLDict
 │ Package XMLDict not found, but a package named XMLDict is available from a registry. 
 │ Install package?
 │   (@v1.7) pkg> add XMLDict 
 └ (y/n) [y]: 
    Updating registry at `~/.julia/registries/General.toml`
    Updating registry at `~/.julia/registries/JuliaSimRegistry.toml`
   Resolving package versions...

signal (11): Segmentation fault: 11
in expression starting at none:0
targeted_resolve at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:0
tiered_resolve at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1125
_resolve at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1160
unknown function (ip: 0x11fab3ccf)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#add#79 at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1176
add##kw at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1167 [inlined]
#add#129 at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:268
add##kw at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:221
unknown function (ip: 0x11fa999df)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#add#29 at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:149
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
add at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:144
#add#27 at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:142 [inlined]
add at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:142 [inlined]
try_prompt_pkg_add at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/Pkg/src/REPLMode/REPLMode.jl:697
unknown function (ip: 0x11fa564ab)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_f__call_latest at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#invokelatest#2 at ./essentials.jl:716 [inlined]
invokelatest at ./essentials.jl:714 [inlined]
check_for_missing_packages_and_run_hooks at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:175
eval_user_input at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:145
repl_backend_loop at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:244
start_repl_backend at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:229
#run_repl#47 at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:362
run_repl at /Users/sabae/src/julia/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:349
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#929 at ./client.jl:394
jfptr_YY.929_33876 at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_f__call_latest at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
#invokelatest#2 at ./essentials.jl:716 [inlined]
invokelatest at ./essentials.jl:714 [inlined]
run_main_repl at ./client.jl:379
exec_options at ./client.jl:309
_start at ./client.jl:495
jfptr__start_33611 at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_apply_generic at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
true_main at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
jl_repl_entrypoint at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libjulia-internal.1.7.dylib (unknown line)
Allocations: 162242131 (Pool: 162196907; Big: 45224); GC: 100

immediately after I tried again and it worked fine

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.0-rc1 (2021-09-12)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using XMLDict
 │ Package XMLDict not found, but a package named XMLDict is available from a registry. 
 │ Install package?
 │   (@v1.7) pkg> add XMLDict 
 └ (y/n) [y]: 
    Updating registry at `~/.julia/registries/General.toml`
    Updating registry at `~/.julia/registries/JuliaSimRegistry.toml`
   Resolving package versions...
    Updating `~/.julia/environments/v1.7/Project.toml`
  [228000da] + XMLDict v0.4.1
    Updating `~/.julia/environments/v1.7/Manifest.toml`
  [228000da] + XMLDict v0.4.1
Precompiling project...
  ✗ Pluto
  17 dependencies successfully precompiled in 40 seconds (431 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

julia> 

env info

Julia Version 1.7.0-rc1
Commit 9eade6195e (2021-09-12 06:45 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin20.5.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)
Environment:
  JULIA_NUM_THREADS = 8
  JULIA_PKG_SERVER = 

      Status `~/.julia/environments/v1.7/Project.toml`
  [ab8c0f59] BenchmarkPlots v0.1.0
  [6e4b80f9] BenchmarkTools v1.2.0
  [12aac903] BinaryBuilder v0.4.1
  [336ed68f] CSV v0.8.5
  [479239e8] Catalyst v9.0.0
  [39db22c5] ClipData v0.1.0
  [3da002f7] ColorTypes v0.10.12
  [c3611d14] ColorVectorSpace v0.8.7
  [5ae59095] Colors v0.12.8
  [a93c6f00] DataFrames v1.2.2
  [82cc6244] DataInterpolations v3.6.1
  [864edb3b] DataStructures v0.18.10
  [aae7a2af] DiffEqFlux v1.43.0
  [41bf760c] DiffEqSensitivity v6.59.0
  [0c46a032] DifferentialEquations v6.19.0
  [31c24e10] Distributions v0.25.18
  [7da242da] Enzyme v0.7.0
  [8f5d6c58] EzXML v1.1.0
  [c87230d0] FFMPEG v0.4.1
  [7a1cc6ca] FFTW v1.4.5
  [5789e2e9] FileIO v1.11.1
  [53c48c17] FixedPointNumbers v0.8.4
  [587475ba] Flux v0.12.7
  [e9467ef8] GLMakie v0.4.6
  [28b8d3ca] GR v0.59.0
  [cd3eb016] HTTP v0.9.16
  [f332f351] ImageContrastAdjustment v0.3.7
  [6a3955dd] ImageFiltering v0.6.21
  [82e4d734] ImageIO v0.5.8
  [d8c32880] ImageInTerminal v0.4.6
  [6218d12a] ImageMagick v1.2.1
  [4e3cecfd] ImageShow v0.3.1
  [916415d5] Images v0.24.1
  [0f8b85d8] JSON3 v1.9.2
  [b9914132] JSONTables v1.0.2
  [23fbe1c1] Latexify v0.15.6
  [093fc24a] LightGraphs v1.3.5
  [f57c4921] MIDI v2.0.2
  [ee78f7c6] Makie v0.15.2
  [abcecc63] MathML v0.1.9
  [961ee093] ModelingToolkit v6.5.2
  [1dea7af3] OrdinaryDiffEq v5.64.1
  [9b87118b] PackageCompiler v1.7.1
  [4722fa14] PkgAuthentication v1.1.1
  [91a5bcdd] Plots v1.22.4
  [c3e4b0f8] Pluto v0.16.1
  [dca85d43] QuartzImageIO v0.7.3
  [8a4e6c94] QuasiMonteCarlo v0.2.3
  [295af30f] Revise v3.1.20
  [e5567a89] SBML v0.8.0 `~/.julia/dev/SBML`
  [86080e66] SBMLToolkit v0.1.8
  [1bc83da4] SafeTestsets v0.0.1
  [6f1ad949] SaveREPL v0.1.0 `../../dev/SaveREPL.jl`
  [2913bbd2] StatsBase v0.33.10
  [f3b207a7] StatsPlots v0.14.28
  [8254be44] SymbolicRegression v0.6.14 `~/.julia/dev/SymbolicRegression`
  [d1185830] SymbolicUtils v0.16.0
  [0c5d862f] Symbolics v3.4.1
  [40c74d1a] TableView v0.7.1
  [5e47fb64] TestImages v1.6.1
  [a759f4b9] TimerOutputs v0.5.13
  [b8865327] UnicodePlots v2.4.6
  [8149f6b0] WAV v1.1.1
  [276b4fcb] WGLMakie v0.4.6
  [228000da] XMLDict v0.4.1
  [5ae413db] EarCut_jll v2.2.3+0
  [b22a6f82] FFMPEG_jll v4.4.0+0
  [f5851436] FFTW_jll v3.3.10+0
  [c73af94c] ImageMagick_jll v6.9.12+0
  [bb12108a] SBML_jll v5.19.0+3 `~/.julia/dev/SBML_jll`
  [45378030] alsa_jll v1.2.5+0
fredrikekre commented 3 years ago

Can you try rc2?

anandijain commented 3 years ago

IIRC, this happened recently to me on rc2, but I don't have a MWE

KristofferC commented 2 years ago

You could try again with nightly since that thas gotten quite a few fixes to apple silicon. Also, I don't think this can be fixed from Pkg itself since this is likely an issue with Julia itself. If you can still reproduce, you can open an issue on the Julia repo.