Skip to content

segmentation fault in code-server #10921

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

Open
drob0362 opened this issue Apr 30, 2025 · 5 comments
Open

segmentation fault in code-server #10921

drob0362 opened this issue Apr 30, 2025 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote)

Comments

@drob0362
Copy link

drob0362 commented Apr 30, 2025

Does this issue occur when all extensions are disabled?: Unable to verify - cannot startup application in this way on corporate Mac.

  • VS Code Version: 1.99.3
CPUs Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (8 x 2000)
GPU Status 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off
Load (avg) 3, 4, 4
Memory (System) 16.00GB (1.50GB free)
Process Argv --crash-reporter-id 549fb657-8e3c-42f7-8e26-69a5f22fac76
Screen Reader no
VM 0%

Steps to Reproduce:

  1. Open current project in dev container, with following devcontainer.json:
{
    "name": "Java Development Container",
    "image": "mcr.microsoft.com/devcontainers/java:latest",
    "features": {
      "java": {
        "version": "latest"
      }
    },
    "settings": {
      "terminal.integrated.shell.linux": "/bin/bash"
    },
    "extensions": [
    ],
    "postCreateCommand": "java -version",
    "remoteUser": "vscode"
}

Error log:
[2025-04-30T14:06:27.476Z] userEnvProbe PATHs:
Probe: '/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:/usr/local/share/nvm/current/bin:/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:/usr/lib/jvm/msopenjdk-current/bin:/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:/usr/local/share/nvm/current/bin:/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:/usr/lib/jvm/msopenjdk-current/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/vscode/.local/bin'
Container: '/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:/usr/local/share/nvm/current/bin:/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:/usr/lib/jvm/msopenjdk-current/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
[2025-04-30T14:06:27.476Z] Start: Run in container: mkdir -p '/tmp/devcontainers-72b097d9-d0e1-4e4d-b134-3dae21c042fd1746021983097' && cat > '/tmp/devcontainers-72b097d9-d0e1-4e4d-b134-3dae21c042fd1746021983097/env-loginInteractiveShell.json' << 'envJSON'
[2025-04-30T14:06:27.485Z]
[2025-04-30T14:06:27.485Z]
[2025-04-30T14:06:27.485Z] Stop (9 ms): Run in container: mkdir -p '/tmp/devcontainers-72b097d9-d0e1-4e4d-b134-3dae21c042fd1746021983097' && cat > '/tmp/devcontainers-72b097d9-d0e1-4e4d-b134-3dae21c042fd1746021983097/env-loginInteractiveShell.json' << 'envJSON'
[2025-04-30T14:06:27.505Z] Segmentation fault
[2025-04-30T14:06:27.518Z] Stop (247 ms): Run in container: /home/vscode/.vscode-server/bin/17baf841131aa23349f217ca7c570c76ee87b957/bin/code-server --log debug --force-disable-user-env --server-data-dir /home/vscode/.vscode-server --use-host-proxy --telemetry-level all --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /home/vscode/.vscode-server/data/Machine/.connection-token-17baf841131aa23349f217ca7c570c76ee87b957 --extensions-download-dir /home/vscode/.vscode-server/extensionsCache --start-server --disable-websocket-compression --skip-requirements-check
[2025-04-30T14:06:27.523Z] Command failed: /home/vscode/.vscode-server/bin/17baf841131aa23349f217ca7c570c76ee87b957/bin/code-server --log debug --force-disable-user-env --server-data-dir /home/vscode/.vscode-server --use-host-proxy --telemetry-level all --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /home/vscode/.vscode-server/data/Machine/.connection-token-17baf841131aa23349f217ca7c570c76ee87b957 --extensions-download-dir /home/vscode/.vscode-server/extensionsCache --start-server --disable-websocket-compression --skip-requirements-check
[2025-04-30T14:06:27.523Z] Segmentation fault
[2025-04-30T14:06:27.523Z] Exit code 139

@drob0362 drob0362 changed the title dev container segmentation fault segmentation fault in code-server May 1, 2025
@drob0362
Copy link
Author

drob0362 commented May 1, 2025

other relevant info:
docker host engine v28.1.1

extension info, issue occurs with single extension in use:

Identifier
ms-vscode-remote.remote-containers
Version
0.409.0

@drob0362
Copy link
Author

drob0362 commented May 2, 2025

@krishanjmistry thank you for the link to your issue.

@rtucker-dw
Copy link

rtucker-dw commented May 2, 2025

I'm facing the same issue. I've tried to reduce the configuration as simple as possible. I'm on a 2020 MacBook Pro with an Intel i7 processor.

`
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:20",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [2435, 8675]

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Configure tool-specific properties.
// "customizations": {
// "extensions": [
// // "dbaeumer.vscode-eslint",
// // "aaron-bond.better-comments",
// // "vivaxy.vscode-conventional-commits",
// // "esbenp.prettier-vscode",
// // "arcanis.vscode-zipfs"
// ]
// },

// "mounts": ["source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/node/.aws,type=bind"]

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}`

Docker version 28.1.1, build 4eba377

Edit: Downgrading Docker worked for me as a band-aid fix!

@chrmarti
Copy link
Contributor

chrmarti commented May 3, 2025

This seems to be an upstream issue between Node.js and Docker. docker/for-mac#7667 mentions memory protection keys. /fyi @deepak1556

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote) labels May 3, 2025
@chrmarti chrmarti transferred this issue from microsoft/vscode May 3, 2025
@chrmarti chrmarti added the containers Issue in vscode-remote containers label May 3, 2025
@ctalledo
Copy link

ctalledo commented May 7, 2025

Docker Desktop 4.41 configures the Linux VM kernel with support for memory protection keys.

That's not a problem per-se, but it's causing vscode-server to hit a segmentation fault when it uses the mem protection keys mechanism. Apparently the problem only occurs on Mac with Intel processors, so it may be a virtualization layer issue.

More info on docker/for-mac#7667.

@chrmarti chrmarti assigned chrmarti and deepak1556 and unassigned chrmarti May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers upstream Issue identified as 'upstream' component related (exists outside of VS Code Remote)
Projects
None yet
Development

No branches or pull requests

5 participants