sg-wireless / pymakr-vsc

GNU General Public License v3.0
99 stars 25 forks source link

Pymakr 1.1.14 crashes the VSCode 1.61.0 extension host on macOS 11.6 #167

Open morungos opened 3 years ago

morungos commented 3 years ago

What are the steps to reproduce this issue?

  1. Open VSCode 1.61.0 with Pymakr 1.1.14, on a Mac running Big Sur 11.6

What happens?

The VSCode extension host gets shut down with internal linkage errors. VSCode offers a restart, but using this repeats the error.

What were you expecting to happen?

VSCode would have extensions running and enabled, and ideally, Pymakr. This shuts down all extensions, not

Any logs, error output, etc?

(If it’s long, please paste to https://gist.github.com and insert the link here)

Developer tools console log includes the following:

workbench.desktop.main.js:2923:
dyld: lazy symbol binding failed: Symbol not found: __ZN2v86Object18InternalFieldCountEv
  Referenced from: /Users/stuart/.vscode/extensions/pycom.pymakr-1.1.14/node_modules/@serialport/bindings/build/Release/bindings.node
  Expected in: flat namespacedyld: Symbol not found: __ZN2v86Object18InternalFieldCountEv
  Referenced from: /Users/stuart/.vscode/extensions/pycom.pymakr-1.1.14/node_modules/@serialport/bindings/build/Release/bindings.node
  Expected in: flat namespace

And

workbench.desktop.main.js:603
INFO Extension host with pid 75741 exited with code: null, signal: SIGKILL.

Any other comments?

Pymakr 1.1.13 continues to work fine -- so downgrading means this is not a blocker.

What versions of software are you using?

Operating system:

Mac 11.6 (Big Sur)

VSCode version:

VSCode 1.61.0

Pymakr version:

1.1.14

mindeon commented 3 years ago

same error on MacOS 10.13.6 (High Sierra) and macOS 10.15.7 (Catalina) VSCode version: VSCode 1.61.0 Pymakr version: 1.1.14

serafinebot-wdna commented 3 years ago

same error on Ubuntu 20.04.3 LTS VSCode version: VSCode 1.61.0 Pymakr version: 1.1.14

I tried downgrading Pymakr to 1.1.13 and it is working fine.

jakobrosenberg commented 3 years ago

Thanks for the feedback.

Does deleting this file and restarting VSCode have any effect? ~/.vscode/extensions/pymakr-vsc/node_modules/@serialport/bindings/build/Release/bindings.node

serafinebot-wdna commented 3 years ago

@jakobrosenberg doesn't seem to resolve the issue.

Here's a full log of Developer Tools after deleting ~/.vscode/extensions/pycom.pymakr-1.1.14/node_modules/@serialport/bindings/build/Release/bindings.node and restarting VSCode: image

jakobrosenberg commented 3 years ago

Thanks @snebot-bg. That rules out a stale binding being used.

Do you have any pointers on how I could replicate this issue in a VM? I have Popos 21.04 running in HyperVM, but can try other distros.

serafinebot-wdna commented 3 years ago

@jakobrosenberg

The steps necessary to reproduce this issue are:

  1. VSCode version: 1.61.0
  2. Pymakr version: 1.1.14
  3. Open VSCode

When I tested this issue I also disabled all other extensions to ensure Pymakr was causing the issue and other extensions weren't interfering. FWIW: I had an issue where the Python extension stopped working after Pymakr crashed Extension Host (had to reinstall the Python extension) but now seems to be resolved and I am unable to replicate that problem again.

As commented above, this issue seems to be present on MacOS so I think it is fair to say that trying different distros probably won't show any different results. So I would say PopOS is fine.

c-p-b commented 3 years ago

I had this same issue, and interestingly managed to resolve it by deleting the node_modules folder in "~/.vscode/extensions/pycom.pymakr-1.1.14" (MacOS) and rerunning "npm install" from that same folder. After doing that I was not able to reproduce the issue.

jakobrosenberg commented 3 years ago

@snebot-bg I'm unfortunately reproduce the issue on Windows 10, PopOs (VM), and windows-latest, macos-18.04, ubuntu-20.04 in Github Actions.

@cpdeethree thanks you! Could I ask you to try deleting the file again, but this time without running npm install after?

c-p-b commented 3 years ago
~/.vscode/extensions/pycom.pymakr-1.1.14> rm ~/.vscode/extensions/pycom.pymakr-1.1.14/node_modules/@serialport/bindings/build/Release/bindings.node                
~/.vscode/extensions/pycom.pymakr-1.1.14> ls ~/.vscode/extensions/pycom.pymakr-1.1.14/node_modules/@serialport/bindings/build/Release/bindings.node         
/Users/me/.vscode/extensions/pycom.pymakr-1.1.14/node_modules/@serialport/bindings/build/Release/bindings.node
~/.vscode/extensions/pycom.pymakr-1.1.14> 

@jakobrosenberg Worked fine, file reappeared on reboot of vscode . My guess is that some dependencies were not upgrading properly.

I do want to note I was experimenting with version pinning before deleting the node_modules folder - pinning serialport to any specific version and running "npm install" after changing this line in package.json also fixed the issue.

    "dependencies": {
        "serialport": "^9.2.0"
    },
    "dependencies": {
        "serialport": "9.2.0"
    },

After trying all the versions from 9.2.0 to 9.2.4 and then finally blowing away the entire node_modules folder and rerunning npm install with the original "^9.2.0" back in place I still wasn't able to repro. I was also unable to reproduce by uninstalling and reinstalling the extension from scratch (whereas when I had the issue before performing these steps uninstalling and reinstalling the extension did not help). I was also unable to reproduce by deleting the extension folder entirely and reinstalling. All of which points to stale dependency IMO.

jakobrosenberg commented 3 years ago

@cpdeethree can you confirm that your initial error was this one:

dyld: lazy symbol binding failed: Symbol not found: __ZN2v86Object18InternalFieldCountEv

I have suspected versions past serialport 9.0.7 to be a cause of certain errors, but since I can't reproduce them, it's pure speculation. reference

c-p-b commented 3 years ago

@jakobrosenberg Yes, I can confirm that was the precise initial error that I encountered.

serafinebot-wdna commented 3 years ago

Here are a series of steps I have followed to fix this issue.

  1. Uninstalled Pymakr from VSCode and deleted extension folder if it was still present.
    rm -rf ~/.vscode/extensions/pycom.pymakr-1.1.14
  2. Reopened VSCode, reinstalled the extension and encountered the Extension Host crash issue.
  3. Closed VSCode, deleted node_modules folder and reinstalled modules.
    cd ~/.vsocde/extensions/pycom.pymakr-1.1.14
    rm -rf node_modules
    npm install
  4. After reopening VSCode once again I found the Extension Host crash issue and the serialport module issue.
  5. Closed VSCode and deleted bindings.node.
    rm -rf ~/.vsocde/extensions/pycom.pymakr-1.1.14/node_modules/@serialport/bindings/build/Release/bindings.node

    After reopening VSCode the extension works fine. I have tried these exact steps twice and the results are the exact same.

Edit: the serialport module issue I mentioned might be related to this issue.

mindeon commented 3 years ago

something which might help in solving the issue (macOS Catalina):

jakobrosenberg commented 3 years ago

New beta release out.

https://github.com/pycom/pymakr-vsc/releases/tag/v1.1.15-beta.0

VirtualWolf commented 3 years ago

Ahh, this is the problem I was talking about in #157.

I'm still on Catalina, but just installing the 1.1.15-beta.0 version didn't fix the extension host crashing for me.

My fix was mostly similar to @mindeon's above, except my ~/.vscode/extensions/pycom.pymakr-1.1.15/ folder did have a node_modules inside it. I removed it and manually ran npm install and that did the trick and everything's working now.

Looking at the contents of node_modules after a fresh installation of Pymakr 1.1.15, I noticed ./node_modules/@serialport/bindings/build/Release/bindings.node has a date modified of the 19th of June, which seems to correspond exactly to the old 9.2.0 release of node-serialport... seems a bit suspicious?

c-p-b commented 3 years ago

So vscode auto-updated pymakr to 1.1.15 and my bindings.node also reverted to a modified date of 19 june, giving the error again. Very interesting.

~/.vscode/extensions/pycom.pymakr-1.1.15> npm list serialport
pymakr@1.1.15 /Users/me/.vscode/extensions/pycom.pymakr-1.1.15
└── serialport@9.2.0

When I reran npm install here I still got 9.2.0, even though package.json specifies carat "^9.2.0" meaning it should go grab the latest patch version, which is 9.2.4.

I was curious if forcing something above 9.2.0 in package.json would cause the issue to be solved. In my case I again changed "^9.2.0" in package.json to "^9.2.1" and reran npm install. when I did that the version was forced to latest 9.2.4 and fixed the issue again. So I can confirm changing "^9.2.0" to "^9.2.1" in package.json should fix the issue.

jakobrosenberg commented 3 years ago

Thanks @cpdeethree . That's very interesting. It sounds like the version was locked by package-lock.json and after the 9.2.1 bump the lock file no longer satisfied the dependencies.

I would have expected PyMakr to download/rebuild the correct binding on binding-errors, but for some reason that didn't happen in your installation.

I'll err on the side of caution and publish a new version with ^9.2.4.