# Pkg.instantiate aborts Julia

**URL:** https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679
**Category:** New to Julia
**Tags:** environment
**Created:** [October 13, 2022, 4:41pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679 "2022-10-13T16:41:13Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tasdemir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tasdemir/32/43523_2.png) [@tasdemir](https://discourse.julialang.org/u/tasdemir)
#### Post date: [October 13, 2022, 4:41pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/1 "2022-10-13T16:41:13Z")

</div>

When I use `instantiate` command, Julia throws a warning and aborts. Every time I start giving a try to Julia language I stuck in a small step and go back to Python unfortunately. This is frustrating. Please help. My system is macOS 12.6 with apple M1 chip. I installed Julia 1.8.2 by the precompiled binaries from Julia site. Here is the output:

```julia
┌ Warning: The active manifest file has dependencies that were resolved with a different julia version (1.7.1). Unexpected behavior may occur.
└ @ ~/projects/lecture-julia.notebooks/Manifest.toml:0
julia(26814,0x103060580) malloc: *** error for object 0x600003c6a700: pointer being freed was not allocated
julia(26814,0x103060580) malloc: *** set a breakpoint in malloc_error_break to debug

signal (6): Abort trap: 6
in expression starting at REPL[4]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 2589302 (Pool: 2587567; Big: 1735); GC: 4
[1] 26814 abort julia

```

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [October 13, 2022, 4:49pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/2 "2022-10-13T16:49:09Z")

</div>

That’s very strange. If you were on Linux I would suggest you use rr to capture a trace but I’m not entirely sure how to debug this without access to the machine on MacOS. Are you comfortable using lldb?

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [October 13, 2022, 4:54pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/3 "2022-10-13T16:54:41Z")

</div>

> [@tasdemir](#):
>
> `julia(26814,0x103060580) malloc: *** error for object 0x600003c6a700: pointer being freed was not allocated`

I seem to recall this being a problem with using PythonCall and PyCall at the same time (I think [this](https://cjdoris.github.io/PythonCall.jl/stable/pycall/#Coming-from-PyCall/PyJulia?) was linked in reference as well). The two require the same version at the same time, else it can break. Can you share your Manifest.toml?

---

<div class="post-metadata">

### Author: ![tasdemir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tasdemir/32/43523_2.png) [@tasdemir](https://discourse.julialang.org/u/tasdemir)
#### Post date: [October 13, 2022, 5:15pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/4 "2022-10-13T17:15:45Z")

</div>

Here is the [Manifest.toml](https://github.com/QuantEcon/lecture-julia.notebooks/blob/main/Manifest.toml) file.

---

<div class="post-metadata">

### Author: ![tasdemir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tasdemir/32/43523_2.png) [@tasdemir](https://discourse.julialang.org/u/tasdemir)
#### Post date: [October 13, 2022, 5:16pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/5 "2022-10-13T17:16:44Z")

</div>

Never used `lldb` before.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [October 13, 2022, 6:52pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/6 "2022-10-13T18:52:03Z")

</div>

That’s very intriguing:

> [@tasdemir](#):
>
> `malloc: *** error [..] pointer being freed was not allocated`

I want to decode that first, that should never happen (not in Python either, but also a possibility). It can happen with C (or languages building on it), but should never happen with a garbage-collected language like Julia (or Java, or e.g. Go or Python).

I’ve never seen that error with Julia, and don’t expect this to be your usual experience (if you use pure Julia), we use a garbage-collect language to escape such errors. But it did happen, so why? The full warning comes from Pkg (a part of Julia) that checks, to guard against something (and I believe no Julia package source code or any of the (C?) dependencies were yet run):

> <https://github.com/JuliaLang/Pkg.jl/blob/master/src/manifest.jl#L326>

I had never see “The active manifest file has dependencies that were resolved with a different julia”, and it’s seemingly very rare since googling for it only had very few results.

> [@tasdemir](#):
>
> My system is macOS 12.6 with apple M1 chip.

It’s Tier 2, not yet Tier 1, so I suggest trying a) the other Julia binary, for x86-64 which should also work on your system, until this is fixed. you can also try this on either of the 1.7.1 binaries. And is this repeatable on any Julia binary? It’s so strange that I wouldn’t even rule out a broken CPU (nor broken filesystem), but let’s not panic, that’s much less likely, most likely a bug in Julia (just unclear to me why so few user see it).

> <https://stackoverflow.com/questions/13148119/what-does-pointer-being-freed-was-not-allocated-mean-exactly>

---

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [October 14, 2022, 12:23am UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/7 "2022-10-14T00:23:19Z")

</div>

That Manifest file is around 385 packages!

If you have a companion `Project.toml` file, I would suggest to start from it to get an environment that while not identical to the one used while _creating_ the `Manifest.toml` file still “should be” compatible (and any how you don’t get exactly the dame packages as you are using a different Julia version)

---

<div class="post-metadata">

### Author: ![tasdemir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tasdemir/32/43523_2.png) [@tasdemir](https://discourse.julialang.org/u/tasdemir)
#### Post date: [October 14, 2022, 6:28am UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/8 "2022-10-14T06:28:23Z")

</div>

**UPDATE!**  
Julia 1.7.1 binary for M1 chip worked halfway. It generated a different error while building `FastTransforms`. It seems the error is just related to this package.  
[Here](https://gist.github.com/murattasdemir/5b10bd79682ebf86be7247aa31a997c9) is the whole output with a link to the original repo.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [October 14, 2022, 9:49am UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/9 "2022-10-14T09:49:55Z")

</div>

> Warning: Platform `arm64-apple-darwin21.2.0` is not an officially supported platform

Too bad, try the “macOS x86 (Intel or Rosetta)” Julia binary (yes, ARM is a different platform, but Apple has you covered with Rosetta emulation, hopefully, if it’s good).

FYI: FastTransforms.jl isn’t obviously something that shouldn’t work, but it depends on FastTransforms\_jll (you may need to look into the Project.toml to see such JLL dependencies, or in dependencies of dependencies etc.) and that’s likely the reason.

Some JLLs have already been built for [Apple’s] ARM, but there’s no guarantee, and that one hasn’t. JLLs are for dependencies made with other languages, e.g. compiled from C, or seemingly there from Fortran. It seems to me Python would likely have a similar problem. And even more likely since it relies heavily on such faster compiled languages. In theory all such code could be made in Julia only but the JLLs are to reuse already made good source code, and usually they would just work, for you not to have to compile yourself.

```julia
ERROR: Error building `FastTransforms`:
┌ Warning: Platform `arm64-apple-darwin21.2.0` is not an officially supported platform
└ @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:450
ERROR: LoadError: KeyError: key "unknown" not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:481 [inlined]
  [2] parse_dl_name_version
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:511 [inlined]
  [3] detect_libgfortran_abi(libgfortran_name::String, platform::BinaryProvider.UnknownPlatform) (repeats 2 times)
    @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:555
  [4] detect_libgfortran_abi
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:584 [inlined]
[..]

```

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [October 14, 2022, 7:03pm UTC](https://discourse.julialang.org/t/pkg-instantiate-aborts-julia/88679/10 "2022-10-14T19:03:13Z")

</div>

Seems most likely to be an error in some code that calls into a C library, certainly not an issue with Julia itself. Not helpful, I know.
