エラーの状態
2024年7月5日時点 での簡単なメモ
macOSでvisual studio code (以下、vscode)を使用中、「アップデートしてください」と表示されていたので、アップデートしたところ、vscodeが起動しなくなった(厳密には一瞬起動するも、すぐ落ちる状態)
前提
- VisualStudioCode version 1.91.0
- macOS Big Sur version 11.3.1
原因と解決
原因を探る。macOSならターミナルからもvscodeを起動できるので、ターミナルから --verbose
のオプションを付与して、ログを出力させながら起動する。
1 2 3 4 5 6 7 |
$ /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code --verbose [main 2024-07-05T09:25:15.820Z] [File Watcher (node.js)] Request to start watching: /Users/kenneth/Library/Application Support/Code/User (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>),/Users/kenneth/Library/Application Support/Code/User/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>) [1403:0705/182515.835426:ERROR:node_bindings.cc(162)] Fatal error in V8: v8::Template::Set Invalid value, must be a primitive or a Template [0705/182515.839318:WARNING:process_memory_mac.cc(94)] mach_vm_read(0x16bba8000, 0x8000): (os/kern) protection failure (2) [0705/182515.979080:ERROR:directory_reader_posix.cc(43)] opendir /Users/kenneth/Library/Application Support/Code/Crashpad/attachments/acf00f4a-1975-489c-8f0b-17205dbb5dd2: No such file or directory (2) [0705/182515.979255:WARNING:crash_report_exception_handler.cc(235)] UniversalExceptionRaise: (os/kern) failure (5) |
出力されたエラーメッセージ「UniversalExceptionRaise: (os/kern) failure」とかでググる。
ググった結果、どうやら GitHub の issue で同様の事象が報告されている模様。issue の日付からも、ここ最近発生している事象っぽい(2024年7月5日時点)
issueを眺めてみるとどうも原因は明確に判明していなさそうだが、ひとまずみんな実施している対策としては、vscode の 1つ前のバージョン (vscode 1.90.2 とか) にダウングレードして、問題を回避しているみたい。
参考になったダウングレード手順
I faced the same issue on my mac OS 10.15. the steps that I followed to remedy were as follows:
https://github.com/microsoft/vscode/issues/219893#issuecomment-2209163260
1- Uninstall VS Code
2- download the latest functioning version (1.90.2) from: https://update.code.visualstudio.com/1.90.2/darwin-universal/stable
3- make sure to turn off your internet connection
4- unzip and install the older version of VS Code
5- open VS Code, hit “Code” on the top. Then go to Preferences > Settings
6- search for Update settings and set the Update mode to “none”. it asks you to restart the program.
7- now you can safely turn your internet connection back on.
翻訳
私のMac OS 10.15でも同じ問題に直面しました。修正するために私が実行した手順は次のとおりです。
https://github.com/microsoft/vscode/issues/219893#issuecomment-2209163260
1-VS Codeをアンインストールする
2- 最新の機能バージョン (1.90.2) を https://update.code.visualstudio.com/1.90.2/darwin-universal/stable からダウンロードします。
3- インターネット接続を必ずオフにしてください
4- 古いバージョンの VS Code を解凍してインストールします
5- VS Code を開き、上部の「コード」を押します。次に、「環境設定 > 設定」に移動します。
6- [更新設定] を検索し、更新モードを「なし」に設定します。プログラムを再起動するように求められます。
7- これで、インターネット接続を安全にオンに戻すことができます。
vscodeのアンインストールは、普通に「アプリケーション」フォルダの「Visual Studio Code.app」をゴミ箱に入れただけ。
手順「2」のリンクからダウンロードして、「アプリケーション」フォルダに移動。一旦無事起動できた。

手順としては一旦以上。早くバグ修正された新しいvsvodeのバージョンをリリースしてほしいですね。