# Curl\_multi\_assign and segmentation fault when installing package

**URL:** https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901
**Category:** General Usage
**Tags:** libcurl, segfault, apple
**Created:** [October 4, 2024, 9:41am UTC](https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901 "2024-10-04T09:41:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![arnerob](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arnerob/32/49522_2.png) [@arnerob](https://discourse.julialang.org/u/arnerob)
#### Post date: [October 4, 2024, 9:41am UTC](https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901/1 "2024-10-04T09:41:33Z")

</div>

I recently switched to Apple M2 and I tried to install FFTW.jl. I did the following in a fresh REPL:

```julia
julia> using Pkg

julia> Pkg.add("FFTW")
   Resolving package versions...
    Updating `~/.julia/environments/v1.10/Project.toml`
  [7a1cc6ca] + FFTW v1.8.0
    Updating `~/.julia/environments/v1.10/Manifest.toml`
  [7a1cc6ca] + FFTW v1.8.0
  [f5851436] + FFTW_jll v3.3.10+1
┌ Warning: attempting to remove probably stale pidfile
│ path = "/Users/arnedecadt/.julia/compiled/v1.10/FFTW/PvIn2_38hl1.ji.pidfile"
└ @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.5/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:244
Precompiling project...
┌ Warning: attempting to remove probably stale pidfile 0/5
│ path = "/Users/arnedecadt/.julia/compiled/v1.10/FFTW/PvIn2_38hl1.ji.pidfile"ecadt/.julia/compiled/v1.10/FFTW/PvIn2_38hl1.ji.pidfile)
└ @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.5/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:273
┌ Error: curl_multi_assign: 1 ] 0/5
└ @ Downloads.Curl /opt/homebrew/Cellar/julia/1.10.5/share/julia/stdlib/v1.10/Downloads/src/Curl/utils.jl:57FFTW/PvIn2_38hl1.ji.pidfile)
┌ Error: curl_multi_assign: 1
└ @ Downloads.Curl /opt/homebrew/Cellar/julia/1.10.5/share/julia/stdlib/v1.10/Downloads/src/Curl/utils.jl:57
  Progress [>] 0/5
  ◓ FFTW Being precompiled by another process (pid: 17652, pidfile: /Users/arnedecadt/.julia/compiled/v1.10/FFTW/PvIn2_38hl1.ji.pidfile)

[22998] signal (11.2): Segmentation fault: 11
in expression starting at REPL[2]:1
curl_multi_socket_action at /opt/homebrew/Cellar/curl/8.10.1/lib/libcurl.4.dylib (unknown line)
julia_YY.59_92916.1 at /opt/homebrew/Cellar/julia/1.10.5/lib/julia/sys.dylib (unknown line)
Allocations: 12635827 (Pool: 12616508; Big: 19319); GC: 17
[1] 22998 segmentation fault julia

```

After this I was out of the REPL and back to my command line. (This follows the [installation guide](https://juliamath.github.io/FFTW.jl/stable/#Installation) ). I found in the github repository that other people were having issues with apple silicon (like [here](https://github.com/JuliaMath/FFTW.jl/issues/274) ) but I cannot use the solution provided since I cannot even install the package.

When I switched to my new laptop I copied over my old julia installation using time machine, but when I found this error I have since asked homebrew to reinstall julia, but the problem remains.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [October 4, 2024, 10:25am UTC](https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901/2 "2024-10-04T10:25:36Z")

</div>

> [@arnerob](#):
>
> `Downloads.Curl /opt/homebrew/Cellar/julia/1.10.5/share/julia/stdlib/v1.10/Downloads/src/Curl/utils.jl:57`

It looks like you are using homebrew to install Julia? I would recommend installing the [official binary](https://julialang.org/downloads/) via `juliaup`.

PS. This has nothing to do with FFTW.jl specifically.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 4, 2024, 10:37am UTC](https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901/3 "2024-10-04T10:37:51Z")

</div>

Note that this had been [reported in Downloads.jl](https://github.com/JuliaLang/Downloads.jl/issues/260), I tried to look into this last week, but I couldn’t come up with ideas that @jameson would like and then I gave up. But this problem has to be solved, regardless of whether we’re using official binaries or not.

---

<div class="post-metadata">

### Author: ![arnerob](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arnerob/32/49522_2.png) [@arnerob](https://discourse.julialang.org/u/arnerob)
#### Post date: [October 4, 2024, 12:45pm UTC](https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901/4 "2024-10-04T12:45:17Z")

</div>

I agree that it should be solved regardless of which binary is used. Installing from the official binary worked though, but I had to fix PyCall with `Pkg.build("PyCall")`. I don’t know enough about this to understand why the brew version broke.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 4, 2024, 12:57pm UTC](https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901/5 "2024-10-04T12:57:56Z")

</div>

> [@arnerob](#):
>
> I don’t know enough about this to understand why the brew version broke.

In practice because homebrew upgraded the version of libcurl used by julia despite knowing that there’s a bug, which is kind of asking for troubles. The bug is probably on the julia side, but it manifests itself only in libcurl 8.10+ when libcurl decided to start running callbacks after cleaning up the multi objects. Note that Julia isn’t the only application caught off by this change of behaviour, in the bug report you can see other projects were relying on callbacks not being called after the multi objects is cleaned up.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [October 4, 2024, 5:31pm UTC](https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901/6 "2024-10-04T17:31:04Z")

</div>

> [@arnerob](#):
>
> but I had to fix PyCall with `Pkg.build("PyCall")`.

Probably it was already built with your old version and you had to rebuild it to reset the configuration.
