Raspberry PI - failed to map segment from shared object

We have some problems using our package on a Raspebrry Pi.

jarl@pirog:~/archive/julia-1.2.0/bin $ ./julia 
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |
(v1.2) pkg> add IterativeSolvers
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `/media/pi/bd7c534f-dc69-49c8-a217-0eff1fb001b8/jarl/.julia/environments/v1.2/Project.toml`
  [42fd0dbc] + IterativeSolvers v0.8.1
  Updating `/media/pi/bd7c534f-dc69-49c8-a217-0eff1fb001b8/jarl/.julia/environments/v1.2/Manifest.toml`
 [no changes]
julia> using NonlinearEigenproblems
[ Info: Precompiling NonlinearEigenproblems [067cfa3b-fa88-53b2-a873-5b23b3a16e31]
ERROR: could not load library "/media/pi/bd7c534f-dc69-49c8-a217-0eff1fb001b8/jarl/archive/julia-1.2.0/lib/julia/sys.so"
/media/pi/bd7c534f-dc69-49c8-a217-0eff1fb001b8/jarl/archive/julia-1.2.0/lib/julia/sys.so: failed to map segment from shared object
ERROR: LoadError: Failed to precompile StaticArrays [90137ffa-7385-5640-81b9-e52037218182] to /home/jarl/.julia/compiled/v1.2/StaticArrays/yY9vm.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1253
 [3] _require(::Base.PkgId) at ./loading.jl:1013
 [4] require(::Base.PkgId) at ./loading.jl:911
 [5] require(::Module, ::Symbol) at ./loading.jl:906
 [6] include at ./boot.jl:328 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1094
 [8] include(::Module, ::String) at ./Base.jl:31
 [9] top-level scope at none:2
 [10] eval at ./boot.jl:330 [inlined]
 [11] eval(::Expr) at ./client.jl:432
 [12] top-level scope at ./none:3
in expression starting at /home/jarl/.julia/packages/ArnoldiMethod/5fDBS/src/ArnoldiMethod.jl:4
ERROR: LoadError: LoadError: Failed to precompile ArnoldiMethod [ec485272-7323-5ecc-a04f-4719b315124d] to /home/jarl/.julia/compiled/v1.2/ArnoldiMethod/zP00S.ji.                                                                                                                                             
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1253
 [3] _require(::Base.PkgId) at ./loading.jl:1013
 [4] require(::Base.PkgId) at ./loading.jl:911
 [5] require(::Module, ::Symbol) at ./loading.jl:906
 [6] include at ./boot.jl:328 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1094
 [8] include at ./Base.jl:31 [inlined]
 [9] include(::String) at /home/jarl/.julia/packages/NonlinearEigenproblems/NAm4H/src/NonlinearEigenproblems.jl:1
 [10] top-level scope at /home/jarl/.julia/packages/NonlinearEigenproblems/NAm4H/src/NonlinearEigenproblems.jl:17
 [11] include at ./boot.jl:328 [inlined]
 [12] include_relative(::Module, ::String) at ./loading.jl:1094
 [13] include(::Module, ::String) at ./Base.jl:31
 [14] top-level scope at none:2
 [15] eval at ./boot.jl:330 [inlined]
 [16] eval(::Expr) at ./client.jl:432
 [17] top-level scope at ./none:3
in expression starting at /home/jarl/.julia/packages/NonlinearEigenproblems/NAm4H/src/LinSolvers.jl:8
in expression starting at /home/jarl/.julia/packages/NonlinearEigenproblems/NAm4H/src/NonlinearEigenproblems.jl:17
ERROR: Failed to precompile NonlinearEigenproblems [067cfa3b-fa88-53b2-a873-5b23b3a16e31] to /home/jarl/.julia/compiled/v1.2/NonlinearEigenproblems/4KoNg.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1253
 [3] _require(::Base.PkgId) at ./loading.jl:1013
 [4] require(::Base.PkgId) at ./loading.jl:911
 [5] require(::Module, ::Symbol) at ./loading.jl:906
jarl@pirog:~/archive/julia-1.2.0/bin $ lsb_release  -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.8 (stretch)
Release:        9.8
Codename:       stretch
jarl@pirog:~/archive/julia-1.2.0/bin $ ls -l ../../julia-1.2.0-linux-armv7l.tar.gz 
-rw-r--r-- 1 jarl jarl 81715930 Aug 20 06:46 ../../julia-1.2.0-linux-armv7l.tar.gz

The same happens on julia 1.0.x. Any ideas where the /julia/sys.so: failed to map segment from shared object comes from?

It works for me:

(v1.2) pkg> add NonlinearEigenproblems
 ...

julia> using NonlinearEigenproblems
[ Info: Precompiling NonlinearEigenproblems [067cfa3b-fa88-53b2-a873-5b23b3a16e31]

julia> versioninfo()
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
  OS: Linux (arm-linux-gnueabihf)
  CPU: ARMv7 Processor rev 4 (v7l)
  WORD_SIZE: 32
  LIBM: libm
  LLVM: libLLVM-6.0.1 (ORCJIT, cortex-a53)

I’m running Arch Linux, not Raspbian.

Your dynamic linker failed to load sys.so. Does your user have execution permission for that shared library?

See here for more info:
https://unix.stackexchange.com/questions/496292/what-does-a-failed-to-map-segment-from-shared-object-error-mean

I’m not familiar with Raspberry Pis, but this link suggests that only root and the pi user have execution permissions in that directory by default:
How to create the /media/pi folder with correct permissions? - Raspberry Pi Forums

Thanks! I got the same error when I run julia as root or pi. I also tried running on the /usr/local/bin filesystem. Same results. This does not exclude an execution permission problem.

Eventually I tried a system upgrade raspian buster to get julia 1.0. It crashed my system completely, so I need some time to fix it before following up on this.

A fresh install with Raspian version buster, and julia 1.0.3 seems to have solved the problem. Thanks again.