# Segmentation fault when updating packages

**URL:** <https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766>\
**Category:** Juno\
**Created:** [May 2, 2019, 8:05am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766 "2019-05-02T08:05:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [May 2, 2019, 8:05am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/1 "2019-05-02T08:05:11Z")

</div>

Hello,

I’ve occasionally had this error pop up using Atom+Juno and doing something in `pkg` the problem is that it’s not easily reproducible afaict.

```julia
signal (11): Segmentation fault: 11
in expression starting at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:0
_ZN12_GLOBAL__N_114CodeGenPrepare13runOnFunctionERN4llvm8FunctionE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)

```

(I then need to quit atom)

I’m happy to open a bug report somewhere appropriate but I’m not sure whether it’s a Juno bug or a JuliaInterpreter bug or a Pkg bug. Has anyone else seen something of the sorts?

Julia 1.3-dev.83  
Atom 0.8.5  
Juno 0.7  
Julia client 0.8.3  
language-julia 0.18.1

**PS** : the full error in this case was triggered by `pkg> dev HTTP` (stacktrace below)

```julia
(v1.3) pkg> dev HTTP
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/JuliaWeb/HTTP.jl.git`
 Resolving package versions...
 Installed Tables ───────── v0.2.0
 Installed BinaryProvider ─ v0.5.4
 Installed Distributions ── v0.19.2
  Updating `~/.julia/environments/v1.3/Project.toml`
  [cd3eb016] + HTTP v0.8.0 [`~/.julia/dev/HTTP`]
  [4ca9428c] ↑ JuDoc v0.0.0 [`~/.julia/dev/JuDoc`] ⇒ v0.1.2 [`~/.julia/dev/JuDoc`]
  [6793090a] ↑ JuDocTemplates v0.1.0 [`~/.julia/dev/JuDocTemplates.jl`] ⇒ v0.1.1 [`~/.julia/dev/JuDocTemplates.jl`]
  Updating `~/.julia/environments/v1.3/Manifest.toml`
  [b99e7846] ↑ BinaryProvider v0.5.3 ⇒ v0.5.4
  [944b1d66] - CodecZlib v0.5.2
  [a93c6f00] ↑ DataFrames v0.17.1 ⇒ v0.18.1
  [31c24e10] ↑ Distributions v0.19.1 ⇒ v0.19.2
  [cd3eb016] ~ HTTP v0.8.0 ⇒ v0.8.0 [`~/.julia/dev/HTTP`]
  [82899510] ↑ IteratorInterfaceExtensions v0.1.1 ⇒ v1.0.0
  [4ca9428c] ↑ JuDoc v0.0.0 [`~/.julia/dev/JuDoc`] ⇒ v0.1.2 [`~/.julia/dev/JuDoc`]
  [6793090a] ↑ JuDocTemplates v0.1.0 [`~/.julia/dev/JuDocTemplates.jl`] ⇒ v0.1.1 [`~/.julia/dev/JuDocTemplates.jl`]
  [90014a1f] ↑ PDMats v0.9.6 ⇒ v0.9.7
  [2dfb63ee] + PooledArrays v0.5.1
  [88034a9c] ↑ StringDistances v0.3.1 ⇒ v0.3.2
  [3783bdb8] ↑ TableTraits v0.4.1 ⇒ v1.0.0
  [bd369af6] ↑ Tables v0.1.18 ⇒ v0.2.0
  [3bb67fe8] - TranscodingStreams v0.9.4

ArgumentError: Package Distances not found in current path:
- Run `import Pkg; Pkg.add("Distances")` to install the Distances package.
(v1.3) pkg> 
Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:876
 [2] eval at ./boot.jl:330 [inlined]
 [3] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:341
 [4] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:347
 [5] prepare_thunk at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:333 [inlined]
 [6] #methods_by_execution!#9(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:define,),Tuple{Bool}}}, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/lowered.jl:44
 [7] #methods_by_execution! at ./none:0 [inlined]
 [8] #eval_with_signatures#57(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.eval_with_signatures), ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:344
 [9] #eval_with_signatures at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:0 [inlined]
 [10] #instantiate_sigs!#58(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.instantiate_sigs!), ::OrderedCollections.OrderedDict{Module,OrderedCollections.OrderedDict{Revise.RelocatableExpr,Union{Nothing, Array{Any,1}}}}) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:352
 [11] instantiate_sigs! at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:349 [inlined]
 [12] maybe_parse_from_cache!(::Revise.PkgData, ::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:224
 [13] (::getfield(Revise, Symbol("##24#25")){String})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:370
 [14] with_logstate(::getfield(Revise, Symbol("##24#25")){String}, ::Base.CoreLogging.LogState) at ./logging.jl:395
 [15] with_logger at ./logging.jl:491 [inlined]
 [16] watch_manifest(::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:349
 [17] (::Revise.Rescheduler{typeof(Revise.watch_manifest),Tuple{String}})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/types.jl:235
while evaluating
import Distances: evaluate, Hamming, hamming, PreMetric, SemiMetric
in module Main.StringDistances
ArgumentError: Package IterTools not found in current path:
- Run `import Pkg; Pkg.add("IterTools")` to install the IterTools package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:876
 [2] eval at ./boot.jl:330 [inlined]
 [3] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:341
 [4] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:347
 [5] prepare_thunk at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:333 [inlined]
 [6] #methods_by_execution!#9(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:define,),Tuple{Bool}}}, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/lowered.jl:44
 [7] #methods_by_execution! at ./none:0 [inlined]
 [8] #eval_with_signatures#57(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.eval_with_signatures), ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:344
 [9] #eval_with_signatures at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:0 [inlined]
 [10] #instantiate_sigs!#58(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.instantiate_sigs!), ::OrderedCollections.OrderedDict{Module,OrderedCollections.OrderedDict{Revise.RelocatableExpr,Union{Nothing, Array{Any,1}}}}) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:352
 [11] instantiate_sigs! at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:349 [inlined]
 [12] maybe_parse_from_cache!(::Revise.PkgData, ::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:224
 [13] (::getfield(Revise, Symbol("##24#25")){String})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:370
 [14] with_logstate(::getfield(Revise, Symbol("##24#25")){String}, ::Base.CoreLogging.LogState) at ./logging.jl:395
 [15] with_logger at ./logging.jl:491 [inlined]
 [16] watch_manifest(::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:349
 [17] (::Revise.Rescheduler{typeof(Revise.watch_manifest),Tuple{String}})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/types.jl:235
while evaluating
import IterTools: chain
in module Main.StringDistances

signal (11): Segmentation fault: 11
in expression starting at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:0
_ZN12_GLOBAL__N_114CodeGenPrepare13runOnFunctionERN4llvm8FunctionE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 2, 2019, 8:20am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/2 "2019-05-02T08:20:04Z")

</div>

Does it happen without Revise?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 2, 2019, 8:23am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/3 "2019-05-02T08:23:04Z")

</div>

I’ve seen issues similar(-ish) to this when Revise is loaded in Juno and a tracked packages is updated, I think. Never without Revise loaded though.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [May 2, 2019, 11:13am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/4 "2019-05-02T11:13:08Z")

</div>

Hmm. I haven’t seen this, but while I sometimes use Juno I suspect I rarely update packages from its console. I will try to remember start doing that and see if I can trigger this myself.

From the stacktrace, to me it seems like the complaint is about [https://github.com/JuliaDebug/JuliaInterpreter.jl/blob/2c7ef5788352db40b3bfab7500a2cf52471f9de6/src/construct.jl#L341](https://github.com/JuliaDebug/JuliaInterpreter.jl/blob/2c7ef5788352db40b3bfab7500a2cf52471f9de6/src/construct.jl#L341) while updating the code of StringDistances (which got updated when you did `dev HTTP`), and it’s complaining specifically about [this line](https://github.com/matthieugomez/StringDistances.jl/blob/5869a8c26d9ade002d12615761cb056210aa010d/src/StringDistances.jl#L16). But

```julia
Core.eval(StringDistances, :(import Distances: evaluate, Hamming, hamming, PreMetric, SemiMetric))

```

works just fine at the REPL. Does it complain for you from Juno?

I do not understand why `StringDistances` doesn’t know about `Distances`, given that it’s in the Project.toml file.

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [May 3, 2019, 5:17am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/5 "2019-05-03T05:17:19Z")

</div>

Here’s another fresh case: (note that this time it doesn’t seem to be caused by distances?)  
It’s maybe just me doing it all wrong 😕

```julia
(v1.3) pkg> up
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed LoweredCodeUtils ─ v0.3.4
 Installed MLJModels ──────── v0.1.1
 Installed Revise ─────────── v2.1.3
 Installed MLJBase ────────── v0.1.1
  Updating `~/.julia/environments/v1.3/Project.toml`
  [16fef848] ↑ LiveServer v0.1.0 [`~/.julia/dev/LiveServer.jl`] ⇒ v0.1.1 [`~/.julia/dev/LiveServer.jl`]
  [a7f614a8] ↑ MLJBase v0.1.0 ⇒ v0.1.1
  [d491faf4] ↑ MLJModels v0.1.0 ⇒ v0.1.1
  [295af30f] ↑ Revise v2.1.2 ⇒ v2.1.3
  Updating `~/.julia/environments/v1.3/Manifest.toml`
  [31c24e10] ↓ Distributions v0.19.2 ⇒ v0.18.0
  [16fef848] ↑ LiveServer v0.1.0 [`~/.julia/dev/LiveServer.jl`] ⇒ v0.1.1 [`~/.julia/dev/LiveServer.jl`]
  [6f1432cf] ↑ LoweredCodeUtils v0.3.1 ⇒ v0.3.4
  [a7f614a8] ↑ MLJBase v0.1.0 ⇒ v0.1.1
  [d491faf4] ↑ MLJModels v0.1.0 ⇒ v0.1.1
  [295af30f] ↑ Revise v2.1.2 ⇒ v2.1.3

ArgumentError: Package JuliaInterpreter not found in current path:
- Run `import Pkg; Pkg.add("JuliaInterpreter")` to install the JuliaInterpreter package.
(v1.3) pkg> 
Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:876
 [2] eval at ./boot.jl:330 [inlined]
 [3] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:341
 [4] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:347
 [5] prepare_thunk at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:333 [inlined]
 [6] #methods_by_execution!#9(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:define,),Tuple{Bool}}}, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/lowered.jl:44
 [7] #methods_by_execution! at ./none:0 [inlined]
 [8] #eval_with_signatures#57(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.eval_with_signatures), ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:344
 [9] #eval_with_signatures at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:0 [inlined]
 [10] #instantiate_sigs!#58(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.instantiate_sigs!), ::OrderedCollections.OrderedDict{Module,OrderedCollections.OrderedDict{Revise.RelocatableExpr,Union{Nothing, Array{Any,1}}}}) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:352
 [11] instantiate_sigs! at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:349 [inlined]
 [12] maybe_parse_from_cache!(::Revise.PkgData, ::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:224
 [13] (::getfield(Revise, Symbol("##24#25")){String})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:370
 [14] with_logstate(::getfield(Revise, Symbol("##24#25")){String}, ::Base.CoreLogging.LogState) at ./logging.jl:395
 [15] with_logger at ./logging.jl:491 [inlined]
 [16] watch_manifest(::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:349
 [17] (::Revise.Rescheduler{typeof(Revise.watch_manifest),Tuple{String}})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/types.jl:235
while evaluating
using JuliaInterpreter
in module Main.LoweredCodeUtils
ArgumentError: Package JuliaInterpreter not found in current path:
- Run `import Pkg; Pkg.add("JuliaInterpreter")` to install the JuliaInterpreter package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:876
 [2] eval at ./boot.jl:330 [inlined]
 [3] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:341
 [4] prepare_thunk(::Module, ::Expr, ::Bool) at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:347
 [5] prepare_thunk at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:333 [inlined]
 [6] #methods_by_execution!#9(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:define,),Tuple{Bool}}}, ::typeof(Revise.methods_by_execution!), ::Any, ::Revise.CodeTrackingMethodInfo, ::Dict{Module,Array{Expr,1}}, ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/lowered.jl:44
 [7] #methods_by_execution! at ./none:0 [inlined]
 [8] #eval_with_signatures#57(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.eval_with_signatures), ::Module, ::Expr) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:344
 [9] #eval_with_signatures at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:0 [inlined]
 [10] #instantiate_sigs!#58(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Revise.instantiate_sigs!), ::OrderedCollections.OrderedDict{Module,OrderedCollections.OrderedDict{Revise.RelocatableExpr,Union{Nothing, Array{Any,1}}}}) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:352
 [11] instantiate_sigs! at /Users/tlienart/.julia/packages/Revise/RW8TD/src/Revise.jl:349 [inlined]
 [12] maybe_parse_from_cache!(::Revise.PkgData, ::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:224
 [13] (::getfield(Revise, Symbol("##24#25")){String})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:370
 [14] with_logstate(::getfield(Revise, Symbol("##24#25")){String}, ::Base.CoreLogging.LogState) at ./logging.jl:395
 [15] with_logger at ./logging.jl:491 [inlined]
 [16] watch_manifest(::String) at /Users/tlienart/.julia/packages/Revise/RW8TD/src/pkgs.jl:349
 [17] (::Revise.Rescheduler{typeof(Revise.watch_manifest),Tuple{String}})() at /Users/tlienart/.julia/packages/Revise/RW8TD/src/types.jl:235
while evaluating
using JuliaInterpreter: @lookup, moduleof, pc_expr, step_expr!, is_global_ref, whichtt, next_until!, finish_and_return!, nstatements, codelocation
in module Main.LoweredCodeUtils

signal (11): Segmentation fault: 11
in expression starting at /Users/tlienart/.julia/packages/JuliaInterpreter/rYo68/src/construct.jl:0
_ZN12_GLOBAL__N_114CodeGenPrepare13runOnFunctionERN4llvm8FunctionE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia/libLLVM.dylib (unknown line)

```

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [May 3, 2019, 1:31pm UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/6 "2019-05-03T13:31:01Z")

</div>

I poked at this a bit more and have a little more insight. If you check out StringDistances for development, `git diff v0.3.1..v0.3.2` shows you that, among other changes, the type definition of `StringDistances.QGramIterator` was altered. In the plain REPL, the sequence

```julia
pkg> add StringDistances@0.3.1
julia> using StringDistances, Revise
pkg> up
julia> 1+1 # just execute any statement

```

results in the error

```julia
invalid redefinition of constant QGramIterator
Stacktrace:
 [1] top-level scope at none:0
 [2] eval at ./boot.jl:328 [inlined]
 [3] evaluate_structtype(::Any, ::JuliaInterpreter.Frame, ::Expr) at /tmp/pkgs/packages/JuliaInterpreter/rYo68/src/interpret.jl:303
...
while evaluating
struct QGramIterator{S <: AbstractString, N}
    #= /tmp/pkgs/packages/StringDistances/dGPtc/src/distances/qgram.jl:9 =#
    s::S
    #= /tmp/pkgs/packages/StringDistances/dGPtc/src/distances/qgram.jl:10 =#
    l::Int
end
in module StringDistances

```

That error message is “correct,” given the [documented limitations of Revise](https://timholy.github.io/Revise.jl/dev/limitations/#Changes-that-Revise-cannot-handle-1).

However, in Juno this doesn’t happen. (EDIT: this is a consequence of StringDistances being loaded automatically by Juno before Revise gets loaded. If you add `StringDistances` to the watched packages, mimicking [these lines](https://github.com/timholy/Revise.jl/blob/4d4cdff9c07b8fe689d9273a2e62caaa3e586f55/src/Revise.jl#L1055-L1061), then Juno’s console gives the same result as the REPL. Nevertheless given the error messages in the OP it seems the following comments are still mostly relevant.) I don’t fully understand what’s going on; sometimes I see that it fails to even try to update the type definition. I am beginning to get suspicious that there are (at least) _two_ copies of `StringDistances` being loaded when you run in Juno. This may be a consequence of the fact that modules are no longer loaded into `Main` by default. `StringDistances` seems to be a dependency for `Atom`, which gets automatically loaded in Juno; unless you’d said `using StringDistances` in your console, there should be no `Main.StringDistances`.

I _think_ Revise is doing the right thing here, and that this is a Juno problem. (In the ordinary REPL, it doesn’t matter whether StringDistances gets loaded directly via `using StringDistances` or indirectly via `using Atom`.) [This Revise commit](https://github.com/timholy/Revise.jl/commit/d674c62d3b5861a55fe45e4e733c3359c3b25461) illustrates one of the changes I had to make to get this right; the test, I think, is outdated due to recent changes in Plots, but hopefully it illustrates the issues.

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [May 4, 2019, 1:02pm UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/7 "2019-05-04T13:02:01Z")

</div>

Thanks! The latest error didn’t seem to be caused by StringDistances though (?).

In any case should I open an issue on Juno and/or JuliaInterpreter?

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [May 4, 2019, 1:08pm UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/8 "2019-05-04T13:08:32Z")

</div>

It has nothing to do with StringDistances per se; this appears to be happening when you update already-loaded packages and the update has problems. StringDistances is simply a good test case, because between versions 0.3.1 and 0.3.2 it has a type-change that Revise can’t handle.

However, there’s more going on than just that. I can’t replicate what you’re seeing, so it would indeed be best if you filed the issue. Without a reproducible test case, there’s very little chance of fixing this. My recommendation is the following:

- check your history file (e.g., `~/.julia/logs/repl_history.jl`) to figure out exactly what you did when you issued one of the commands above, basically from the start of the REPL session until the error was issued.
- pin the packages that appear in your updates to their version _before_ the update
- repeat those commands, including the update, and see if you can reproduce the crash
- go through this process iteratively, trimming out anything not needed to reproduce the crash, until you have a MWE (=Minimal Working Example) that a developer can then use to isolate the problem & fix it

---

<div class="post-metadata">

**Author:** ![caleb-allen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/caleb-allen/32/14054_2.png) [@caleb-allen](https://discourse.julialang.org/u/caleb-allen)\
**Post date:** [March 4, 2020, 3:02am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/9 "2020-03-04T03:02:06Z")

</div>

I just installed Juno and Julia for the first time on my Manjaro Linux machine and was seeing a similar issue.

I experimented with the permissions of the `.julia` directory, and it was not the problem. I also uninstalled and reinstalled Juno, Julia, and Atom, none of which worked.

What ended up working was updating my system–not sure what was outdated, but something in my system update must have fixed up some shared libraries?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 4, 2020, 8:24am UTC](https://discourse.julialang.org/t/segmentation-fault-when-updating-packages/23766/10 "2020-03-04T08:24:30Z")

</div>

Probably related to [FS#65540 : [julia] signal (11): Segmentation fault](https://bugs.archlinux.org/task/65540).
