# AOT compiled hello.jl core dump

**URL:** <https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318>\
**Category:** General Usage\
**Created:** [January 6, 2019, 6:51am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318 "2019-01-06T06:51:14Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 6, 2019, 6:51am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/1 "2019-01-06T06:51:14Z")

</div>

Compiled through, but execution got core dump. Any idea?

```julia
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.3 (2018-12-18)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using PackageCompiler

julia> build_executable(
           "hello.jl")
Julia program file:
  "/home/user/tmp/Test/hello.jl"
C program file:
  "/home/user/.julia/packages/PackageCompiler/jBqfm/examples/program.c"
Build directory:
  "/home/user/tmp/Test/builddir"
All done

```

```julia
$ ./hello

signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0xffffffffffffffff)
main at ./hello (unknown line)
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
_start at ./hello (unknown line)
Allocations: 3278 (Pool: 3266; Big: 12); GC: 0
Segmentation fault (core dumped)

```

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 6, 2019, 2:30pm UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/2 "2019-01-06T14:30:27Z")

</div>

Can you give more info about your system? ( linux version , gcc version ? )

On clean docker julia environment this example working for me:

`docker run -it julia:1.0.3 bash`

```bash
apt-get update && apt-get install -y build-essential
julia -e 'using Pkg;Pkg.REPLMode.pkgstr("add UnicodePlots;precompile");using UnicodePlots'
julia -e 'using Pkg;Pkg.REPLMode.pkgstr("add PackageCompiler;precompile");using PackageCompiler'
cd $(julia -e 'print(abspath(joinpath(dirname(Base.find_package("PackageCompiler")), "../examples")))')
time julia -e 'using PackageCompiler; build_executable("hello.jl")'
cd builddir
./hello

```

log

```julia
...
root@324cbdd7a971:/# cd $(julia -e 'print(abspath(joinpath(dirname(Base.find_package("PackageCompiler")), "../examples")))')
root@324cbdd7a971:~/.julia/packages/PackageCompiler/jBqfm/examples# time julia -e 'using PackageCompiler; build_executable("hello.jl")'
Julia program file:
  "/root/.julia/packages/PackageCompiler/jBqfm/examples/hello.jl"
C program file:
  "/root/.julia/packages/PackageCompiler/jBqfm/examples/program.c"
Build directory:
  "/root/.julia/packages/PackageCompiler/jBqfm/examples/builddir"
All done

real	3m30.106s
user	3m26.387s
sys	0m2.911s
root@324cbdd7a971:~/.julia/packages/PackageCompiler/jBqfm/examples# cd builddir
root@324cbdd7a971:~/.julia/packages/PackageCompiler/jBqfm/examples/builddir# ./hello
hello, world
sin(0.0) = 0.0
      ┌────────────────────────────────────────┐ 
    1 │⠀⠀⠀⠀⠀⠀⠀⡠⠊⠉⠉⠉⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⢠⠎⠀⠀⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⢀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⡎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠼⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠬⢦⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⢤│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡎⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⢠⠎⠀⠀⠀⠀⠀│ 
   -1 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⣀⣀⣀⠔⠁⠀⠀⠀⠀⠀⠀│ 
      └────────────────────────────────────────┘ 
      0 100

root@324cbdd7a971:~/.julia/packages/PackageCompiler/jBqfm/examples/builddir# 

```

---

<div class="post-metadata">

**Author:** ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)\
**Post date:** [January 6, 2019, 2:54pm UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/3 "2019-01-06T14:54:15Z")

</div>

It looks like you’re supplying a potentially different `hello.jl` than ships with PackageCompiler. Can we see the source/an MWE of what’s in that file, if it differs from the default one?

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 6, 2019, 3:54pm UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/4 "2019-01-06T15:54:17Z")

</div>

> [@LeoK987](#):
>
> signal (11): Segmentation fault

maybe after upgrading julia - creating a clean state is very important

- remove: PackageCompiler , UnicodePlots
- `pkg> gc`

see :

> <https://github.com/JuliaLang/PackageCompiler.jl/issues/134>
>
> If I run \`test PackageCompiler\` locally in Julia 1.0.1, I get
> 
> \`\`\`julia
> Launc…hing new julia process to run commands...
> 
> signal (11): Segmentation fault
> in expression starting at no file:0
> jl\_array\_ptr\_ref at /buildworker/worker/package\_linux64/build/src/julia.h:786 \[inlined\]
> jl\_has\_call\_ambiguities at /buildworker/worker/package\_linux64/build/src/gf.c:2000
> jl\_mt\_assoc\_by\_type at /buildworker/worker/package\_linux64/build/src/gf.c:1095
> jl\_apply\_generic at /buildworker/worker/package\_linux64/build/src/gf.c:2153
> reinit\_stdio at ./libuv.jl:120
> \_\_init\_\_ at ./sysimg.jl:470
> jl\_apply\_generic at /buildworker/worker/package\_linux64/build/src/gf.c:2184
> jl\_apply at /buildworker/worker/package\_linux64/build/src/julia.h:1537 \[inlined\]
> jl\_module\_run\_initializer at /buildworker/worker/package\_linux64/build/src/toplevel.c:90
> \_julia\_init at /buildworker/worker/package\_linux64/build/src/init.c:813
> julia\_init\_\_threading at /buildworker/worker/package\_linux64/build/src/task.c:302
> main at /buildworker/worker/package\_linux64/build/ui/repl.c:227
> \_\_libc\_start\_main at /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
> \_start at /opt/julia-1.0.1/bin/julia (unknown line)
> Allocations: 2646 (Pool: 2637; Big: 9); GC: 0
> \`\`\`
> 
> Tests pass on 1.0.0. Can anybody reproduce this?

---

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 6, 2019, 11:40pm UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/5 "2019-01-06T23:40:13Z")

</div>

Thanks to all for the comments.

My Linux and gcc versions are:

```julia
$ gcc --version
gcc (GCC) 8.2.1 20181127
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Linux manjaro 4.19.13-1-MANJARO #1 SMP PREEMPT Sat Dec 29 15:43:56 UTC 2018 x86_64 GNU/Linux

```

I copied the hello.jl from PackageCompiler:

```julia
module Hello

using UnicodePlots

Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
    println("hello, world")
    @show sin(0.0)
    println(lineplot(1:100, sin.(range(0, stop=2π, length=100))))
    return 0
end

end

```

The packages of PackageCompiler and UnicodePlots were added yesterday under the same julia version. I just did a gc under pkg and recompiled hello.jl.

Actually, when I first run hello, I got a message saying hello.so not found:

```julia
$ ./hello
ERROR: could not load library "/home/user/Software/julia-1.0.3/bin/hello.so"
/home/user/Software/julia-1.0.3/bin/hello.so: cannot open shared object file: No such file or directory

```

So then I copied hello.so from builddir into `/home/user/Software/julia-1.0.3/bin/`, then when I ran hello, I got a core dump. Is there something wrong with my setting?

```julia
$ ./hello

signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0xffffffffffffffff)
main at ./hello (unknown line)
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
_start at ./hello (unknown line)
Allocations: 3278 (Pool: 3266; Big: 12); GC: 0
Segmentation fault (core dumped)

```

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 6, 2019, 11:58pm UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/6 "2019-01-06T23:58:30Z")

</div>

> [@LeoK987](#):
>
> So then I copied hello.so from builddir into `/home/user/Software/julia-1.0.3/bin/` , then when I ran hello, I got a core dump. Is there something wrong with my setting?

it is working on `buildir` ? ( no copy … )

my directory :

```julia
/builddir$ ls
hello libcholmod.so libgfortran.so.4 libjulia.so libmbedcrypto.so.0 libmbedx509.so.2.6.0 libopenlibm.so.2 libssh2.so
hello.a libcolamd.so libgit2.so libjulia.so.1 libmbedcrypto.so.2.6.0 libmpfr.so libopenlibm.so.2.5 libssh2.so.1
hello.so libcurl.so libgit2.so.0.27.2 libjulia.so.1.0 libmbedtls.so libmpfr.so.6 libpcre2-8.so libssh2.so.1.0.1
libamd.so libcurl.so.4 libgit2.so.27 libLLVM-6.0.0.so libmbedtls.so.10 libmpfr.so.6.0.1 libpcre2-8.so.0 libstdc++.so.6
libcamd.so libcurl.so.4.5.0 libgmp.so libLLVM-6.0.so libmbedtls.so.2.6.0 libopenblas64_.so libpcre2-8.so.0.6.0 libsuitesparseconfig.so
libccalltest.so libdSFMT.so libgmp.so.10 libLLVM.so libmbedx509.so libopenblas64_.so.0 libquadmath.so.0 libsuitesparse_wrapper.so
libccolamd.so libgcc_s.so.1 libgmp.so.10.3.2 libmbedcrypto.so libmbedx509.so.0 libopenlibm.so libspqr.so libumfpack.so

```

---

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 7, 2019, 12:06am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/7 "2019-01-07T00:06:05Z")

</div>

Yes, I run hello under buiddir, but it’s not taking the hello.so there for some reason, and complains about the lack of hello.so under `/home/user/Software/julia-1.0.3/bin/`.

My builddir also has a full bunch of files:

```julia
builddir]$ ls
hello libdSFMT.so libLLVM-6.0.0.so libmpfr.so libspqr.so
hello.a libgcc_s.so.1 libLLVM-6.0.so libmpfr.so.6 libssh2.so
hello.so libgfortran.so.4 libLLVM.so libmpfr.so.6.0.1 libssh2.so.1
libamd.so libgit2.so libmbedcrypto.so libopenblas64_.so libssh2.so.1.0.1
libcamd.so libgit2.so.0.27.2 libmbedcrypto.so.0 libopenblas64_.so.0 libstdc++.so.6
libccalltest.so libgit2.so.27 libmbedcrypto.so.2.6.0 libopenlibm.so libsuitesparseconfig.so
libccolamd.so libgmp.so libmbedtls.so libopenlibm.so.2 libsuitesparse_wrapper.so
libcholmod.so libgmp.so.10 libmbedtls.so.10 libopenlibm.so.2.5 libumfpack.so
libcolamd.so libgmp.so.10.3.2 libmbedtls.so.2.6.0 libpcre2-8.so
libcurl.so libjulia.so libmbedx509.so libpcre2-8.so.0
libcurl.so.4 libjulia.so.1 libmbedx509.so.0 libpcre2-8.so.0.6.0
libcurl.so.4.5.0 libjulia.so.1.0 libmbedx509.so.2.6.0 libquadmath.so.0

```

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 7, 2019, 12:08am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/8 "2019-01-07T00:08:45Z")

</div>

Can you share the “`ldd hello`” output ?

my log.

```julia
root@9cff0dc03a96:~/.julia/packages/PackageCompiler/jBqfm/examples/builddir# ldd hello
	linux-vdso.so.1 (0x00007ffc653b8000)
	hello.so => /root/.julia/packages/PackageCompiler/jBqfm/examples/builddir/./hello.so (0x00007fe9fe770000)
	libjulia.so.1 => /usr/local/julia/lib/libjulia.so.1 (0x00007fe9fdffd000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe9fdc5e000)
	libLLVM-6.0.so => /usr/local/julia/lib/julia/libLLVM-6.0.so (0x00007fe9fafc2000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe9fadbe000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe9fabb6000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe9fa999000)
	libstdc++.so.6 => /usr/local/julia/lib/julia/libstdc++.so.6 (0x00007fe9fa61b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe9fa317000)
	libgcc_s.so.1 => /usr/local/julia/lib/julia/libgcc_s.so.1 (0x00007fe9fa0ff000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fea06898000)
root@9cff0dc03a96:~/.julia/packages/PackageCompiler/jBqfm/examples/builddir# 

```

---

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 7, 2019, 12:11am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/9 "2019-01-07T00:11:57Z")

</div>

```julia
builddir]$ ldd hello
	linux-vdso.so.1 (0x00007ffc217da000)
	hello.so => /home/user/tmp/Test/builddir/./hello.so (0x00007f9241079000)
	libjulia.so.1 => /home/user/Software/julia-1.0.3/lib/libjulia.so.1 (0x00007f9240906000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f924070d000)
	libLLVM-6.0.so => /home/user/Software/julia-1.0.3/lib/julia/libLLVM-6.0.so (0x00007f923da71000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f923da6c000)
	librt.so.1 => /usr/lib/librt.so.1 (0x00007f923da62000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f923da3f000)
	libstdc++.so.6 => /home/user/Software/julia-1.0.3/lib/julia/libstdc++.so.6 (0x00007f923d6c1000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007f923d53c000)
	libgcc_s.so.1 => /home/user/Software/julia-1.0.3/lib/julia/libgcc_s.so.1 (0x00007f923d324000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f9248d9e000)

```

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 7, 2019, 12:36am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/10 "2019-01-07T00:36:30Z")

</div>

> [@LeoK987](#):
>
> Yes, I run hello under buiddir, but it’s not taking the hello.so there for some reason, and complains about the lack of hello.so under `/home/user/Software/julia-1.0.3/bin/` .

please copy-paste the full (latest) error message .  
`builddir]$ ./hello `

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 7, 2019, 12:39am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/11 "2019-01-07T00:39:39Z")

</div>

Testing on clean Manjaro environment - is OK.

```julia
Step 13/13 : RUN cd $(julia -e 'print(abspath(joinpath(dirname(Base.find_package("PackageCompiler")), "../examples")))') && time julia -e 'using PackageCompiler; build_executable("hello.jl")' && cd builddir && ldd ./hello && ./hello
 ---> Running in 5108a55a38f4
Julia program file:
  "/root/.julia/packages/PackageCompiler/jBqfm/examples/hello.jl"
C program file:
  "/root/.julia/packages/PackageCompiler/jBqfm/examples/program.c"
Build directory:
  "/root/.julia/packages/PackageCompiler/jBqfm/examples/builddir"
All done

real	3m18.788s
user	3m11.210s
sys	0m8.809s
	linux-vdso.so.1 (0x00007ffefc75d000)
	hello.so => /root/.julia/packages/PackageCompiler/jBqfm/examples/builddir/./hello.so (0x00007fbbff33c000)
	libjulia.so.1 => /usr/local/julia/lib/libjulia.so.1 (0x00007fbbfebc9000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007fbbfe9fe000)
	libLLVM-6.0.so => /usr/local/julia/lib/julia/libLLVM-6.0.so (0x00007fbbfbd62000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fbbfbd5d000)
	librt.so.1 => /usr/lib/librt.so.1 (0x00007fbbfbd53000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fbbfbd30000)
	libstdc++.so.6 => /usr/local/julia/lib/julia/libstdc++.so.6 (0x00007fbbfb9b2000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007fbbfb82d000)
	libgcc_s.so.1 => /usr/local/julia/lib/julia/libgcc_s.so.1 (0x00007fbbfb615000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fbc0704e000)
hello, world
sin(0.0) = 0.0
      ┌────────────────────────────────────────┐ 
    1 │⠀⠀⠀⠀⠀⠀⠀⡠⠊⠉⠉⠉⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⢠⠎⠀⠀⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⢀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⡎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠼⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠬⢦⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⢤│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡎⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⢠⠎⠀⠀⠀⠀⠀│ 
   -1 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⣀⣀⣀⠔⠁⠀⠀⠀⠀⠀⠀│ 
      └────────────────────────────────────────┘ 
      0 100

Removing intermediate container 5108a55a38f4
 ---> ee1669d4634b
Successfully built ee1669d4634b
Successfully tagged jl-manjaro:latest

```

my dockerfile

```julia
# cat Dockerfile_manjaro 
FROM jonathonf/manjaro
RUN pacman-mirrors -c all 
RUN pacman -Syu --noconfirm wget tar gzip base-devel

ENV JULIA_MAJOR=1.0
ENV JULIA_VERSION=1.0.3
ENV JULIA_SHA256=362ba867d2df5d4a64f824e103f19cffc3b61cf9d5a9066c657f1c5b73c87117

ENV JULIA_DIR=/usr/local/julia
ENV JULIA_PATH=${JULIA_DIR}

RUN mkdir ${JULIA_DIR} && \
    cd /tmp && \
    wget -q https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_MAJOR}/julia-${JULIA_VERSION}-linux-x86_64.tar.gz && \
    echo "$JULIA_SHA256 julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - && \
    tar xzf julia-${JULIA_VERSION}-linux-x86_64.tar.gz -C ${JULIA_DIR} --strip-components=1 && \
    rm /tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz
RUN ln -fs ${JULIA_DIR}/bin/julia /usr/local/bin/julia

RUN julia -e 'using Pkg;Pkg.REPLMode.pkgstr("add UnicodePlots;precompile");using UnicodePlots'
RUN julia -e 'using Pkg;Pkg.REPLMode.pkgstr("add PackageCompiler;precompile");using PackageCompiler'
RUN cd $(julia -e 'print(abspath(joinpath(dirname(Base.find_package("PackageCompiler")), "../examples")))') \
  && time julia -e 'using PackageCompiler; build_executable("hello.jl")' \
  && cd builddir \
  && ldd ./hello \
  && ./hello

```

---

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 7, 2019, 12:39am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/12 "2019-01-07T00:39:50Z")

</div>

If I copy all the files under builddir into `/home/user/Software/julia-1.0.3/bin/` and run hello under `/home/user/Software/julia-1.0.3/bin/`, then it sort of works:

```julia
$ pwd
/home/user/Software/julia-1.0.3/bin
[manjaro bin]$ ./hello
hello, world
sin(0.0) = 0.0
      ┌────────────────────────────────────────┐ 
    1 │⠀⠀⠀⠀⠀⠀⠀⡠⠊⠉⠉⠉⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⢠⠎⠀⠀⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⠀⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⢀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠀⡎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
      │⠼⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠬⢦⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⢤│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡎⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀⠀⠀│ 
      │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢆⠀⠀⠀⠀⠀⠀⢠⠎⠀⠀⠀⠀⠀│ 
   -1 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⣀⣀⣀⠔⠁⠀⠀⠀⠀⠀⠀│ 
      └────────────────────────────────────────┘ 
      0 100

```

There must be something wrong with my julia env setting then. In my .bashrc I have set these. Something not appropriate?

```julia
export JULIA_DIR=/home/user/Software/julia-1.0.3
export JULIA_BINDIR=$JULIA_DIR/bin

export PATH=$JULIA_BINDIR:/home/user/Software/VSCode-linux-x64/bin/:$PATH

export LD_LIBRARY_PATH=./:$JULIA_DIR/lib:$LD_LIBRARY_PATH

```

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 7, 2019, 12:57am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/13 "2019-01-07T00:57:37Z")

</div>

good news 🙂

> [@LeoK987](#):
>
> There must be something wrong with my julia env setting then.

I am only a (julia)beginner - and I am mostly using Docker environment.  
my simple advice:

- Check my (manjaro)Dockerfiles ( see “FROM jonathonf/manjaro” … )
- and/or check the [https://julialang.org/downloads/platform.html](https://julialang.org/downloads/platform.html) - with the default linux instructions.

---

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 7, 2019, 12:58am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/14 "2019-01-07T00:58:56Z")

</div>

@ImreSamu, thanks very much for the kind help!

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 7, 2019, 1:01am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/15 "2019-01-07T01:01:19Z")

</div>

if everything is working - please set a “solved” flag in the forum - so others can see the solutions. 🙂

---

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 7, 2019, 1:05am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/16 "2019-01-07T01:05:21Z")

</div>

It’s not working yet. I still can not run hello from under builddir if I don’t copy all the files into JULIA\_BINDIR.

---

<div class="post-metadata">

**Author:** ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)\
**Post date:** [January 7, 2019, 2:50pm UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/17 "2019-01-07T14:50:52Z")

</div>

That’s because it’s failing to load its shared libraries, which for some reason becomes a segfault, not a linker error. Maybe a good idea to file an issue on PackageCompiler’s Github, and provide a link to this discussion for context. At the very least, a linker error would be preferred to a segfault.

---

<div class="post-metadata">

**Author:** ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Post date:** [January 8, 2019, 12:20am UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/18 "2019-01-08T00:20:27Z")

</div>

I agree that it should not segfault, but I don’t understand why it works for @ImreSamu’s setup.

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [January 8, 2019, 12:06pm UTC](https://discourse.julialang.org/t/aot-compiled-hello-jl-core-dump/19318/19 "2019-01-08T12:06:04Z")

</div>

> [@LeoK987](#):
>
> but I don’t understand why it works for @ImreSamu’s setup.

What we know: On clean (Manjaro) Docker environment - it is working.  
Question: What is the differences?

- only you can find this - because I can’t replicate the error

Some hint:

- Can you replicate your error in (Manjaro) Docker environment? ( add julia files, settings, .bashrc )
- Testing PackageCompiler is OK ? ( `pkg> test PackageCompiler` )
- What is the result of :
  - `# export | grep -i julia`
  - `# set | grep -i julia`

- What is your full $PATH?
  - `# echo $PATH`

If you don’t see any problems - try cleaning your environment:

- backup !!!
- remove ~/.julia ; ~/.juliarc.jl
- remove **_all_** julia versions
- check no libjulia in your system:
  - `find / -name “libjulia\*”

- clean/verify environment variables, $PATH
- reinstall only Julia-v1.0.3
- add packages
- your testcase is working?

it can be a complex issue:

- JULIA\_BINDIR? ( [v1.0.0 segfaults on macOS X if JULIA\_BINDIR set wrongly · Issue #28636 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/28636) )
- Multiple julia versions? ( [How to set path after running juliac.jl?](https://discourse.julialang.org/t/how-to-set-path-after-running-juliac-jl/14025) )
- bad cache somewhere ?
- LD\_LIBRARY\_PATH problems?
- some strange problems? ([https://github.com/JuliaLang/PackageCompiler.jl/search?q=hello&type=Issues](https://github.com/JuliaLang/PackageCompiler.jl/search?q=hello&type=Issues) )
- [Heisenbug - Wikipedia](https://en.wikipedia.org/wiki/Heisenbug) ??
- …
