# Pkg.update() results in segfault error

**URL:** <https://discourse.julialang.org/t/pkg-update-results-in-segfault-error/2575>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 9, 2017, 8:02pm UTC](https://discourse.julialang.org/t/pkg-update-results-in-segfault-error/2575 "2017-03-09T20:02:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thushalala](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@thushalala](https://discourse.julialang.org/u/thushalala)\
**Post date:** [March 9, 2017, 8:02pm UTC](https://discourse.julialang.org/t/pkg-update-results-in-segfault-error/2575/1 "2017-03-09T20:02:09Z")

</div>

I decided to change installed julia 4.7(everything were fine) to julia 5.1(both are generic linux tarballs unpacked in /opt with PATH set accordingly) and this resulted in error about missing libgit2, so i couldn`t run julia. To fix it i installed this library(libgit2-0.24.6) and julia launches now without problems, i can use it as expected. But then i tried to install additional packages, and got error. When i try to simply run Pkg.update() problem is the same - segfault. This is the output:

> INFO: Cloning METADATA from [GitHub - JuliaLang/METADATA.jl: Metadata for registered Julia packages up to Julia v0.6. No longer maintained. Please see https://github.com/JuliaRegistries/General instead.](https://github.com/JuliaLang/METADATA.jl)

> signal (11): Segmentation fault  
> while loading no file, in expression starting on line 0  
> unknown function (ip: 0x7f1a51465940)  
> iconv\_close at /lib64/libc.so.6 (unknown line)  
> unknown function (ip: 0x7f184269097d)  
> unknown function (ip: 0x7f184265ec7e)  
> unknown function (ip: 0x7f1842660853)  
> unknown function (ip: 0x7f18426b8bf0)  
> unknown function (ip: 0x7f184269b57f)  
> git\_reference\_iterator\_new at /usr/lib64/libgit2.so (unknown line)  
> git\_reference\_foreach\_name at /usr/lib64/libgit2.so (unknown line)  
> git\_repository\_is\_empty at /usr/lib64/libgit2.so (unknown line)  
> git\_clone at /usr/lib64/libgit2.so (unknown line)  
> macro expansion at ./libgit2/error.jl:97 [inlined]  
> clone at ./libgit2/repository.jl:191  
> #clone#112 at ./libgit2/libgit2.jl:327  
> unknown function (ip: 0x7f183faf9169)  
> jl\_call\_method\_internal at /home/centos/buildbot/slave/package\_tarball64/build/src/julia\_internal.h:210 [inlined]  
> jl\_apply\_generic at /home/centos/buildbot/slave/package\_tarball64/build/src/gf.c:1950  
> #clone at ./:0  
> #4 at ./pkg/dir.jl:49  
> cd at ./file.jl:59  
> init at ./pkg/dir.jl:47  
> #cd#1 at ./pkg/dir.jl:28  
> update at ./pkg/pkg.jl:210  
> jl\_call\_method\_internal at /home/centos/buildbot/slave/package\_tarball64/build/src/julia\_internal.h:210 [inlined]  
> jl\_apply\_generic at /home/centos/buildbot/slave/package\_tarball64/build/src/gf.c:1950  
> do\_call at /home/centos/buildbot/slave/package\_tarball64/build/src/interpreter.c:66  
> eval at /home/centos/buildbot/slave/package\_tarball64/build/src/interpreter.c:190  
> jl\_toplevel\_eval\_flex at /home/centos/buildbot/slave/package\_tarball64/build/src/toplevel.c:558 [inlined]  
> jl\_toplevel\_eval at /home/centos/buildbot/slave/package\_tarball64/build/src/toplevel.c:580  
> jl\_toplevel\_eval\_in\_warn at /home/centos/buildbot/slave/package\_tarball64/build/src/builtins.c:590  
> eval at ./boot.jl:234  
> unknown function (ip: 0x7f1a4cb2029f)  
> jl\_call\_method\_internal at /home/centos/buildbot/slave/package\_tarball64/build/src/julia\_internal.h:210 [inlined]  
> jl\_apply\_generic at /home/centos/buildbot/slave/package\_tarball64/build/src/gf.c:1950  
> eval\_user\_input at ./REPL.jl:64  
> unknown function (ip: 0x7f183faf7f66)  
> jl\_call\_method\_internal at /home/centos/buildbot/slave/package\_tarball64/build/src/julia\_internal.h:210 [inlined]  
> jl\_apply\_generic at /home/centos/buildbot/slave/package\_tarball64/build/src/gf.c:1950  
> macro expansion at ./REPL.jl:95 [inlined]  
> #3 at ./event.jl:68  
> unknown function (ip: 0x7f183faeef0f)  
> jl\_call\_method\_internal at /home/centos/buildbot/slave/package\_tarball64/build/src/julia\_internal.h:210 [inlined]  
> jl\_apply\_generic at /home/centos/buildbot/slave/package\_tarball64/build/src/gf.c:1950  
> jl\_apply at /home/centos/buildbot/slave/package\_tarball64/build/src/julia.h:1392 [inlined]  
> start\_task at /home/centos/buildbot/slave/package\_tarball64/build/src/task.c:254  
> unknown function (ip: 0xffffffffffffffff)  
> Allocations: 1256956 (Pool: 1256072; Big: 884); GC: 0  
> Segmentation fault

My distro is Slackware 14.2 x64(not multilib). I don`t have a single idea why this happens and not managed to find solution by searching. Sorry if it`s wrong place to ask about it. Github suggests to ask here.

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [March 9, 2017, 10:38pm UTC](https://discourse.julialang.org/t/pkg-update-results-in-segfault-error/2575/2 "2017-03-09T22:38:07Z")

</div>

You shouldn’t need to install a system copy of libgit2. There should be a libgit2.so in the binary, under lib/julia. Run `ldd` on it, what does it say?

---

<div class="post-metadata">

**Author:** ![thushalala](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@thushalala](https://discourse.julialang.org/u/thushalala)\
**Post date:** [March 10, 2017, 4:58am UTC](https://discourse.julialang.org/t/pkg-update-results-in-segfault-error/2575/3 "2017-03-10T04:58:23Z")

</div>

ldd returns this:

> linux-vdso.so.1 (0x00007ffcad900000)  
> libcurl.so.4 =\> /opt/julia/lib/julia/./libcurl.so.4 (0x00007fd67c5dd000)  
> libz.so.1 =\> /lib64/libz.so.1 (0x00007fd67c38d000)  
> libssl.so.6 =\> /opt/julia/lib/julia/./libssl.so.6 (0x00007fd67c13f000)  
> libcrypto.so.6 =\> /opt/julia/lib/julia/./libcrypto.so.6 (0x00007fd67bded000)  
> libssh2.so.1 =\> /opt/julia/lib/julia/./libssh2.so.1 (0x00007fd67bbbc000)  
> librt.so.1 =\> /lib64/librt.so.1 (0x00007fd67b9b4000)  
> libpthread.so.0 =\> /lib64/libpthread.so.0 (0x00007fd67b797000)  
> libc.so.6 =\> /lib64/libc.so.6 (0x00007fd67b3cd000)  
> libmbedtls.so.10 =\> /opt/julia/lib/julia/./libmbedtls.so.10 (0x00007fd67b1a6000)  
> libmbedx509.so.0 =\> /opt/julia/lib/julia/./libmbedx509.so.0 (0x00007fd67af93000)  
> libmbedcrypto.so.0 =\> /opt/julia/lib/julia/./libmbedcrypto.so.0 (0x00007fd67ad40000)  
> libgssapi\_krb5.so.2 =\> not found  
> libkrb5.so.3 =\> not found  
> libcom\_err.so.2 =\> /lib64/libcom\_err.so.2 (0x00007fd67ab3b000)  
> libk5crypto.so.3 =\> not found  
> libdl.so.2 =\> /lib64/libdl.so.2 (0x00007fd67a937000)  
> /lib64/ld-linux-x86-64.so.2 (0x0000557159de4000)

When i delete system library and launch julia:

> fatal: error thrown and no exception handler available.  
> Base.InitError(mod=:LibGit2, error=ErrorException(“could not load library “libgit2”  
> /usr/lib64/libgit2.so: cannot open shared object file: No such file or directory”))  
> rec\_backtrace at /home/centos/buildbot/slave/package\_tarball64/build/src/stackwalk.c:84  
> record\_backtrace at /home/centos/buildbot/slave/package\_tarball64/build/src/task.c:233  
> jl\_throw at /home/centos/buildbot/slave/package\_tarball64/build/src/task.c:551  
> jl\_errorf at /home/centos/buildbot/slave/package\_tarball64/build/src/builtins.c:78  
> jl\_dlerror at /home/centos/buildbot/slave/package\_tarball64/build/src/dlload.c:69 [inlined]  
> jl\_load\_dynamic\_library\_ at /home/centos/buildbot/slave/package\_tarball64/build/src/dlload.c:209  
> jl\_get\_library at /home/centos/buildbot/slave/package\_tarball64/build/src/runtime\_ccall.cpp:152  
> jl\_load\_and\_lookup at /home/centos/buildbot/slave/package\_tarball64/build/src/runtime\_ccall.cpp:163  
> unknown function (ip: 0x7efdb4106ce6)  
> **init** at ./libgit2/libgit2.jl:539  
> unknown function (ip: 0x7efdb41074e8)  
> jl\_call\_method\_internal at /home/centos/buildbot/slave/package\_tarball64/build/src/julia\_internal.h:210 [inlined]  
> jl\_apply\_generic at /home/centos/buildbot/slave/package\_tarball64/build/src/gf.c:1950  
> jl\_apply at /home/centos/buildbot/slave/package\_tarball64/build/src/julia.h:1392 [inlined]  
> jl\_module\_run\_initializer at /home/centos/buildbot/slave/package\_tarball64/build/src/toplevel.c:83  
> \_julia\_init at /home/centos/buildbot/slave/package\_tarball64/build/src/init.c:742  
> julia\_init at /home/centos/buildbot/slave/package\_tarball64/build/src/task.c:284  
> unknown function (ip: 0x40143a)  
> \_\_libc\_start\_main at /lib64/libc.so.6 (unknown line)  
> unknown function (ip: 0x40148c)

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [March 10, 2017, 6:56am UTC](https://discourse.julialang.org/t/pkg-update-results-in-segfault-error/2575/4 "2017-03-10T06:56:57Z")

</div>

> [@thushalala](#):
>
> libgssapi\_krb5.so.2 =\> not found  
> libkrb5.so.3 =\> not found
> 
> libk5crypto.so.3 =\> not found

You’ll need to install something for these, krb5 probably? The binaries of 0.5 are unfortunately not completely self-contained. This should be fixed on nightly but I considered it a bit of a risky internal change to backport.

---

<div class="post-metadata">

**Author:** ![thushalala](https://avatars.discourse-cdn.com/v4/letter/t/ed655f/32.png) [@thushalala](https://discourse.julialang.org/u/thushalala)\
**Post date:** [March 10, 2017, 3:46pm UTC](https://discourse.julialang.org/t/pkg-update-results-in-segfault-error/2575/5 "2017-03-10T15:46:15Z")

</div>

Yes, now everything works! Thank you for your help.
