Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant-go segfaults on launch #13583

Open
mommys-little-hacker opened this issue Jan 27, 2025 · 0 comments
Open

vagrant-go segfaults on launch #13583

mommys-little-hacker opened this issue Jan 27, 2025 · 0 comments

Comments

@mommys-little-hacker
Copy link

Debug output

Not applicable

Expected behavior

vagrant-go --help shows help message

Actual behavior

vagrant-go binary throws segfault on any call

Reproduction information

Vagrant version

2.4.3

Host operating system

Ubuntu 24.04

Guest operating system

Not applicable

Steps to reproduce

  1. Install vagrant from gem file: sudo gem install vagrant-2.4.3.gem
  2. Install vagrant-go from releases (see bash code below)
  3. Run vagrant-go --help or any other command

Output

$ vagrant-go --help
This is an experimental version of Vagrant. Please note that some things may
not work as you expect and this version of Vagrant is not compatible with the 
stable version of Vagrant. For more information about vagrant-go read the docs 
at https://www.vagrantup.com/docs/experimental/vagrant_go. To disable this 
warning set the environment variable 'VAGRANT_SUPPRESS_GO_EXPERIMENTAL_WARNING'.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x16226fb]

goroutine 1 [running]:
github.com/hashicorp/vagrant/internal/client.(*Client).LoadBasis(0xc0000ddd80, {0x1a4a17d, 0x7})
        /home/runner/work/vagrant-builders/vagrant-builders/vagrant-source/internal/client/client.go:189 +0x31b
github.com/hashicorp/vagrant/internal/cli.BaseCommand({0x1e9b1e0?, 0xc000491040}, {0x1ea8610?, 0xc000a5ee60}, {0x1e90700?, 0x2d04f60}, {0xc0009bfc40, 0x1, 0x4?})
        /home/runner/work/vagrant-builders/vagrant-builders/vagrant-source/internal/cli/base.go:269 +0xfca
github.com/hashicorp/vagrant/internal/cli.Commands({0x1e9b1e0?, 0xc000491040}, {0xc000a3b420?, 0x2, 0x2}, {0x1ea8610?, 0xc000a5ee60}, {0x1e90700?, 0x2d04f60}, {0x0, ...})
        /home/runner/work/vagrant-builders/vagrant-builders/vagrant-source/internal/cli/main.go:154 +0x2d9
github.com/hashicorp/vagrant/internal/cli.Main({0xc00003e040?, 0x1749280?, 0xc0000061a0?})
        /home/runner/work/vagrant-builders/vagrant-builders/vagrant-source/internal/cli/main.go:90 +0x3da
main.main()
        /home/runner/work/vagrant-builders/vagrant-builders/vagrant-source/cmd/vagrant/main.go:17 +0x77

vagrant-go installation code

  vagrant_go_path="${HOME}/.bin/vagrant-go-${vagrant_version}"

  vagrant_go_linux_amd64_link=https://github.com/hashicorp/vagrant/releases/download/v${vagrant_version}/vagrant-go_linux_amd64
  vagrant_go_linux_amd64_sha256=4578c436053655d02e16b106058d00c827dfe2075a266a3b74e72ae9a320dae9
  vagrant_go_macos_amd64_link=https://github.com/hashicorp/vagrant/releases/download/v${vagrant_version}/vagrant-go_darwin_amd64
  vagrant_go_macos_amd64_sha256=0ece47981b1ea09592c585cbf2e7d8a00b0a03fe9d93869a8d403e084250e977
  vagrant_go_macos_arm64_link=https://github.com/hashicorp/vagrant/releases/download/v${vagrant_version}/vagrant-go_darwin_arm64
  vagrant_go_macos_arm64_sha256=e2918da764d074e28afe2d68615a60e36f402984a5b01a43a817124f6030a036

  if [ -f $vagrant_go_path ]
  then
    vagrant_go_bin_sha256=`sha256sum $vagrant_go_path | awk '{print $1}'`
  fi

  if [ $OSTYPE = "linux-gnu" ] && [ $HOSTTYPE = "x86_64" ]
  then
    if [ ${vagrant_go_bin_sha256-""} != $vagrant_go_linux_amd64_sha256 ]
    then
      wget -q -O $vagrant_go_path $vagrant_go_linux_amd64_link || return 1
    fi
  elif [ $OSTYPE = "darwin" ] && [ $HOSTTYPE = "amd64" ]
  then
    if [ ${vagrant_go_bin_sha256-""} != $vagrant_go_macos_amd64_sha256 ]
    then
      wget -q -O $vagrant_go_path $vagrant_go_macos_amd64_link || return 1
    fi
  elif [ $OSTYPE = "darwin" ] && [ $HOSTTYPE = "arm64" ]
  then
    if [ ${vagrant_go_bin_sha256-""} != $vagrant_go_macos_arm64_sha256 ]
    then
      wget -q -O $vagrant_go_path $vagrant_go_macos_arm64_link || return 1
    fi
  else
    echo "Unsupported OS or architechture"
    return 1
  fi

  chmod 0755 $vagrant_go_path
  ln -rsf $vagrant_go_path ${HOME}/.bin/vagrant-go

Vagrantfile

Not applicable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants