mitchellh/vagrant-google

Fails to install with Vagrant version 2.2.7

dvanbrug opened this issue · 7 comments

After installing the latest version of Vagrant (2.2.7) on Mac OS Sierra, I get the following error when trying to install the last three minor versions (2.3-2.5).

Building native extensions.  This could take a while...
/opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1052: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.4.9p362 (2019-10-02 revision 67824) [x86_64-darwin19]

After downgrading Vagrant to 2.2.6, plugin version 2.5.0 installs just fine.

Hmmm, I'll need a bit more info to go on here, is it possible to give me the full output, something like: https://gist.github.com/noi5e/3a0d1f8927212cc426898a3ceedec704

If it gave you a crash report location, that would be useful too. I need to know which extension failed to compile to dig in further as I don't have a Sierra machine to repro.

Sure thing. Here is the output from the command and the four DiagnosticReports that are created.

https://gist.github.com/dvanbrug/eb8189b278805040b611bed8d1de574a

Strangely, upgrading back to 2.2.7 did not immediatly cause the crash. I had to run the following to get the crash again.

vagrant plugin expunge
vagrant plugin install vagrant-google

@dvanbrug I'm so sorry but I'll need a bit more info from you, as I'm still not sure where exactly the issue is. Looks like it's either in core rubygems embedded within vagrant or when compiling native extensions. Latter I may be able to fix, former will probably mean a bug to core vagrant distrib.

Can you please run:

vagrant plugin expunge
vagrant plugin install --debug vagrant-google

, and:

otool -L /usr/lib/libcups.2.dylib
otool -L /opt/vagrant/embedded/lib/libiconv.2.dylib
otool -L /usr/lib/libiconv.2.dylib

@Temikus Sure thing, no worries. Here is the output you requested.

https://gist.github.com/dvanbrug/09cb1624a268636220a8e189ea0c2a85

@dvanbrug Hmmm, so far it looks like the issue is in Vagrant core.
For some reason it segfaults when trying to do a File.utime when building extensions.

This may require filing a bug to vagrant proper: https://github.com/hashicorp/vagrant

I would see what it's trying to call utime on and then possibly go from there?

The problematic place is /opt/vagrant/embedded/lib/ruby/2.4.0/fileutils.rb:1052

...
    return if noop
    list.each do |path|
      created = nocreate
      begin
        File.utime(t, t, path) # <= HERE
...

I would start by putting something like:

require 'pp'
pp t
pp path

,right before to see what it's trying to call utime on and go from there.

If you're comfortable with debugging, what I would do is put a binding.pry breakpoint right before and dig around a bit.

If not - if you can give me at least the path and t outputs I may be able to point you further.

Sorry for the back-and-forth but I wasn't able to reproduce this at all and didn't find any applicable references in vagrant or ruby bug trackers.

@Temikus Thank you for all your work digging into this. I was able to find this issue in the Vagrant repo:

hashicorp/vagrant#11376

If I'm reading it correctly, this is due to Sierra not being supported past Vagrant 2.1.0. I am in a similar case where my base Ruby is compiled against Darwin 16 while the embedded Ruby is compiled against Darwin 19.

Therefore, I think this is solved so I'll close the issue. Thank you again!

@dvanbrug Awesome! Yeah, that does look like the same issue.