Curl_multi_assign and segmentation fault when installing package

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

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 ). I found in the github repository that other people were having issues with apple silicon (like here ) 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.

It looks like you are using homebrew to install Julia? I would recommend installing the official binary via juliaup.

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

1 Like

Note that this had been reported in Downloads.jl, 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.

1 Like

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.

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.

1 Like

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