Repository: vscode
Issue: Crash with Illegal Instruction under Rosetta2 emulation in remote container
Labels: freeze-slow-crash-leak,remote


Type: <b>Bug</b>

I'm running a x64 container on my M2 MacBook.
The entire container seems to randomly crash with `Illegal Instruction`:

```
2024-12-22 15:38:44 Container started
2024-12-22 16:27:41 Container started
2024-12-22 16:46:43 Container started
2024-12-22 16:27:27 Illegal instruction
2024-12-22 16:46:32 Illegal instruction
2024-12-22 17:09:36 Illegal instruction
2024-12-22 17:47:34 Illegal instruction
2024-12-22 17:49:43 Illegal instruction
2024-12-22 18:05:51 Illegal instruction
2024-12-22 18:37:52 Illegal instruction
2024-12-22 19:11:42 Illegal instruction
2024-12-22 17:15:07 Container started
2024-12-22 17:45:01 Container started
2024-12-22 17:47:53 Container started
2024-12-22 17:50:00 Container started
2024-12-22 17:53:28 Container started
2024-12-22 18:06:40 Container started
2024-12-22 18:23:54 Container started
2024-12-22 18:37:08 Container started
2024-12-22 18:38:00 Container started
2024-12-22 18:46:27 Container started
2024-12-22 19:40:52 Container started
```

This usually means something is trying to use AVX2 instructions which can't be emulated by Rosetta.

The crashes seem to be somehow related to Jupyter Notebooks: The crashes seem to occur more frequently when I search for a Jupyter Kernel.
Sometimes the container also crashes when it is idle for 1h.

I don't know if the issue is related to an extension or not because the remote extension host also seems to randomly crash, but it doesn't take the entire container down.

I didn't experience crashes when running the container without vscode.

I also found #214630 but I'm not sure if this is related because the extension host starts most of the time without any crashes.

VS Code version: Code 1.96.2 (Universal) (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Darwin arm64 24.2.0
Modes:
Remote OS version: Linux x64 6.10.14-linuxkit

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M2 (8 x 2400)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|5, 4, 3|
|Memory (System)|8.00GB (0.08GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|

|Item|Value|
|---|---|
|Remote|Entwicklungscontainer: Anaconda (Python 3) @ desktop-linux|
|OS|Linux x64 6.10.14-linuxkit|
|CPUs|unknown (8 x 0)|
|Memory (System)|3.83GB (2.33GB free)|
|VM|0%|
</details><details><summary>Extensions (11)</summary>

Extension|Author (truncated)|Version
---|---|---
jupyter-keymap|ms-|1.1.2
remote-containers|ms-|0.394.0
vscode-language-pack-de|MS-|1.96.2024121109
debugpy|ms-|2024.14.0
python|ms-|2024.22.0
vscode-pylance|ms-|2024.12.1
jupyter|ms-|2024.11.0
jupyter-keymap|ms-|1.1.2
jupyter-renderers|ms-|1.0.21
vscode-jupyter-cell-tags|ms-|0.1.9
vscode-jupyter-slideshow|ms-|0.1.6


</details>
<!-- generated by issue reporter -->