Skip to content

segfault when using Postgres feature on Apple Silicon #76

Open
@DanBradbury

Description

@DanBradbury

Ran into this when trying to have our dev team start using devcontainers in our Rails 8.0 application.

Here's the simple devcontainer.json that is being used

{
  "image": "ghcr.io/rails/devcontainer/images/ruby:3.3.0",
  "features": {
    "ghcr.io/rails/devcontainer/features/postgres-client": {}
  }
}

This worked without issue on my older machine but folks with Apple chips were having issues even running irb and require "rails" without getting a segfault (seg-fault.txt)

I was able to confirm on a personal machine that the exact same behavior occurred on my M2 laptop when using the feature. If I remove the feature and rebuild I am able to run rails console, etc without issue.

In order to fix this my solution was to try and pass the --platform=linux/amd64 as a runArgs

{
  "image": "ghcr.io/rails/devcontainer/images/ruby:3.3.0",
  "runArgs": ["--platform=linux/amd64"],
  "features": {
    "ghcr.io/rails/devcontainer/features/postgres-client": {}
  }
}

Unfortunately this doesn't fix the issue because the features are built and do not pass along the same runArgs that were used by the image

If we change our nice/slim devcontainer.json and copy the devcontainer.json the Dockerfile from ruby/images/.devcontainer we are able to properly pass --platform as a build.options and image + features be created with the same architecture

Can find more people reporting similar issues here in vs-remote-releases repo a few days ago.

I'm not sure what the stance would be by folks that maintain the project but I'd like to propose using the build options as a default to avoid any "works on my machine" situations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions