Severe crashing bug in nRF Connect for VS Code on macOS Monterey

I have been attempting to install nRF Connect SDK on macOS for several months without complete success.  You can check my prior tickets for details. Nonetheless, I have recently made progress by ensuring that all traces of the SDK and, in particular, west, are removed before attempting a new installation. (I'll update my last ticket with more details on this.) -- enough progress to allow me to encounter the following problem with the VS Code IDE:

  • When following Video 3 of the getting started series: nRF Connect for VS Code, 3: Building an application & Exploring windows. at 2:30, an application build has been completed.  The lecturer has dragged up from the bottom bar of the VS Code window to open a terminal pane, which shows the output from the build process.
  • At the bottom of the pane, a note is attached: "Terminal will be reused by tasks, press any key to close it."
  • If I then click in the pane to give it focus and type a key (e.g., "m" or "l"), my applications will immediately crash.
  • And I mean, my "applications', not only the VS Code app, but also all other open apps( e.g., nRF Connect, Safari, Mail, etc., background apps like Parallels Toolbox, even Finder).  It's almost the same as a reboot (except the system isn't reloaded).  Hence my description of the bug as severe.
  • This bug is repeatable; also occurs later when following the video sequence to add and build a second app.
  • I have never seen anything like this in VS Code before installing the nRF Connect package.

I'm actually impressed by this bug.  Seems interesting that it can have effect beyond the VS Code app itself, without a total system crash.

Will be interesting to see if your engineers can reproduce this behavior.  I should note that I'm not running an entirely stock macOS Monterey (Version12.1 Beta, Build 21C5039b, the latest developer release).  I'm running on a MacBook Pro 10,1 (early 2013). which is not directly supported by Apple for Monterey.  I'm using OCLP (OpenCore Legacy Patcher) to fool macOS into thinking I have a slightly more modern machine.  Hard to see how this could be the root of this bug.  In the case of my machine, the only patches used are for graphics acceleration.  I've never seen any similar problem with OCLP before.  Will be happy to run additional diagnostics with your engineers if there's any indication that my specific configuration is at fault.

Mike (making slow, but incremental progress with configuring SES and VS Code IDEs for nRF Connect)

  • Having exactly the same problem with crashing.  FWIW, I am on a MacBook Pro 2019, so the OCLP can be ruled out.  Was using sdk 1.7.0 a while back and was able to build and flash helloworld and the bt mesh chat app with no crashes.  However, after upgrading to sdk 1.8.0 I have the same issues.  Seems to happen only after a build has occurred.  I am still able to build and flash, but then it will crash everything when I type anything into the terminal, or if I just try to close vs code.  Again, my setup is not very unique as far as I can tell, and this bug seems to be more than a one off instance.  It is going to make it very difficult to move forward.  Let me know if I can provide any other details for comparison.  Have included the support info below.

    [17:59:10] west build --build-dir /Users/ScottsMacbook/nordic/myapps/chat/build /Users/ScottsMacbook/nordic/myapps/chat
    [17:59:10] Success.
    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "darwin",
        "osVersion": "Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64",
        "osKernel": "21.2.0",
        "vscode": "1.63.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-01-22T22:59:20.786Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:00:35",
        "osUptime": "01:29:04",
        "cpu": {
          "model": "Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz",
          "speed": "2300 MHz",
          "count": 8
        },
        "memory": {
          "total": "32.00 GB",
          "free": "17.05 GB"
        }
      },
      "workspace": {
        "name": "workspace (Workspace)",
        "workspaceFile": "/Users/ScottsMacbook/nordic/myapps/chat/workspace.code-workspace",
        "folders": [
          "/Users/ScottsMacbook/nordic/myapps/chat"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2021.12.137",
            "path": "/Users/ScottsMacbook/.vscode/extensions/nordic-semiconductor.nrf-connect-2021.12.137",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2021.11.7",
            "path": "/Users/ScottsMacbook/.vscode/extensions/nordic-semiconductor.nrf-terminal-2021.11.7",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.2.0",
          "ms-vscode.cpptools": "1.8.0",
          "ms-vscode.js-debug": "1.62.0",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.81",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "ACharLuk.easy-cpp-projects": "2.0.0",
          "christian-kohler.npm-intellisense": "1.4.0",
          "christian-kohler.path-intellisense": "2.7.0",
          "dbaeumer.vscode-eslint": "2.2.2",
          "EditorConfig.EditorConfig": "0.16.4",
          "eg2.vscode-npm-script": "0.3.24",
          "esbenp.prettier-vscode": "9.1.0",
          "espressif.esp-idf-extension": "1.3.0",
          "gcazaciuc.vscode-flow-ide": "1.2.0",
          "GrapeCity.gc-excelviewer": "4.0.50",
          "jasonnutter.search-node-modules": "1.3.0",
          "jawandarajbir.react-vscode-extension-pack": "0.5.0",
          "k--kato.intellij-idea-keybindings": "1.5.0",
          "keroc.hex-fmt": "1.0.0",
          "mkaufman.HTMLHint": "0.10.0",
          "mohsen1.prettify-json": "0.0.3",
          "mrmlnc.vscode-autoprefixer": "3.0.1",
          "ms-dotnettools.csharp": "1.24.0",
          "numso.prettier-standard-vscode": "0.9.2",
          "platformio.platformio-ide": "2.4.0",
          "quicktype.quicktype": "12.0.46",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17",
          "vscode-icons-team.vscode-icons": "11.8.0",
          "xabikos.JavaScriptSnippets": "1.8.0",
          "xabikos.ReactSnippets": "2.4.0",
          "ZixuanWang.linkerscript": "1.0.2"
        }
      },
      "tools": {
        "/Applications/SEGGER/JLink/JLinkExe": "7.56a",
        "/usr/local/bin//nrfjprog": "10.15.2",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/cmake": "3.21.1",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/west": "0.12.0",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/python3": "3.9.6",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/gperf": "3.1",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/arm-none-eabi-gcc": "9-2019-q4-major",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/gn": "1961",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/git": "2.32.0"
      },
      "connectedDevices": [
        {
          "id": "683551328",
          "alias": "nRF52840 DevKit #2"
        },
        {
          "id": "683554705",
          "alias": "nRF52840 DevKit #1"
        }
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.8.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.8.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}"
          ],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "nordic-semiconductor.devicetree": {
          "modules": [
            "${zephyrBase}",
            "${zephyrBase}/../nrf",
            "."
          ],
          "zephyr": "",
          "ctxFile": "",
          "defaultBoard": ""
        },
        "nordic-semiconductor.kconfig": {
          "root": "",
          "env": {},
          "cfiles": true,
          "disable": false,
          "zephyr": {
            "base": ""
          },
          "python": "/opt/nordic/ncs/v1.8.0/toolchain/bin/python3.9"
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "objdumpPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "/opt/nordic/ncs/v1.8.0/toolchain/bin/west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.8.0/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
          "HOME": "/Users/ScottsMacbook",
          "PATH": "/opt/nordic/ncs/v1.8.0/toolchain/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Users/ScottsMacbook/.nvm/versions/node/v16.13.2/bin:/usr/local/git/bin:/sw/bin/:/usr/local/:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/bin/:/usr/local/bin/node:/usr/local/bin/npm:/usr/local/bin/wstorm:~/Library/Android/sdk/tools:~/Library/Android/sdk/platform-tools:./node_modules/.bin:/Applications/CMake.app/Contents/bin:/Users/ScottsMacbook/.espressif/python_env/idf4.1_py3.8_env/bin:/usr/bin:/Users/ScottsMacbook/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin:/Users/ScottsMacbook/.espressif/tools/xtensa-esp32s2-elf/esp-2020r2-8.2.0/xtensa-esp32s2-elf/bin:/Users/ScottsMacbook/.espresso/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/Users/ScottsMacbook/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/Users/ScottsMacbook/.espressif/tools/openocd-esp32/v0.10.0-esp32-20191114/openocd-esp32/bin",
          "ZEPHYR_BASE": "/opt/nordic/ncs/v1.8.0/zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.8.0/toolchain",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "USER": "ScottsMacbook"
        },
        "toolchainPath": "/opt/nordic/ncs/v1.8.0/toolchain",
        "toolchainBinPath": "/opt/nordic/ncs/v1.8.0/toolchain/bin",
        "toolchainVersion": "1.8.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

  • SDPro

    Thanks very much for submitting your report.  Always thought the problem I encountered wasn't due to OCLP.  Now, with your confirmation, I hope we can find the real cause.

    Mike

  • Hi

    Could the bug you are describing be the same as in This case?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    It is the same.  However, it does not generate a crash report. 

    However, I did some testing with different versions of vscode.  The good news is the problem is only with the latest (Nov 2021) version of vscode - 1.63.2 (universal and 64 bit).  When I installed the prior version (October 2021 1.62.3) there is no crash.  (And, of course, turn off automatic updates)  I am guessing if you update VS Code to the latest version, you will be able to reproduce the problem.  But, as you pointed out, it seems to be a problem with VS Code.  Maybe the problem is based in electron, but both versions of VS Code are using the same version of Electron. Anyway, I will be on the lookout for the next version of VS Code to give it another test.  I would log in a VS Code bug but it would probably be best from Nordic.

    Thanks,

    Scott

  • Hi Scott

    If we are able to reproduce this we will log it as a bug.

    In the meantime, it is good to have a workaround: just downgrading VS Code.
    I hope this will work for Mike as well.

    Thank you for the insights!

    Regards,
    Sigurd Hellesvik

Related