maziac / DeZog

Visual Studio Code Debugger for Z80/ZX Spectrum.
MIT License
210 stars 34 forks source link

Extension host terminated unexpectedly 3 times within the last 5 minutes. #109

Closed zombiesbyte closed 1 year ago

zombiesbyte commented 1 year ago

Type: Bug

This error just appeared one day. It was identified by the steps used in Extension Bisect and disabled.

Extension version: 3.2.2 VS Code version: Code 1.76.0 (92da9481c0904c6adfe372c12da3b7748d74bdcb, 2023-03-01T10:25:16.105Z) OS version: Linux x64 5.19.0-35-generic snap Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 3807)| |GPU Status|2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off| |Load (avg)|0, 1, 1| |Memory (System)|15.33GB (7.25GB free)| |Process Argv|--no-sandbox . --crash-reporter-id 7da8ca46-570b-42b7-8830-51cf1e541136| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|cinnamon| |XDG_CURRENT_DESKTOP|X-Cinnamon| |XDG_SESSION_DESKTOP|cinnamon| |XDG_SESSION_TYPE|x11|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vscaac:30438847 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 pynewvextcfv2:30681851 azure-dev_surveyone:30548225 vscccc:30610679 pyindex848:30662994 nodejswelcome1:30587005 282f8724:30602487 pyind779:30671433 89544117:30613380 vscrpc:30673769 pythonsymbol12:30671437 6233i204:30672705 vsctsb:30677850 pythonb192cf:30669361 funwalk2:30682974 ```
maziac commented 1 year ago

Hi, do you see this problem always or only sometimes? Does dezog itself works for you? Unfortunately there is very little debug info available. Could you e.g. share if there is some related info in the debug console.

It would also be interesting if this is somehow related to one of your folder/projects. Could you start vscode with no folder opened and check if the problem persists?

To my understanding there are very few Linux users for dezog. Most are on Windows or macOS. I suspect that it has something to do with the package bundler, maybe something is missing in the Linux builds. Beginning with 3.2 I used a package bundler (esbuild). I'm not so happy with it, it has caused many problems and I could imagine that it has something to do with it. Could you please test versions 3.1 and 3.2 and let me know if you see any difference?

zombiesbyte commented 1 year ago

Hi Maziac I'm still testing 3.2.2 and what I can see so far is that it seems to be only 1 particular project I'm working on that produces this error. It's a time based error (meaning I have just just wait for the error to present itself). I don't know enough about what is going on in the background to start looking further. Here's a screen grab of my Laravel V9 project folder structure (note that I've tested other Laravel and PHP projects and couldn't replicate the issue)

image

Can you suggest a way to debug/log further. Maybe there's a file type that's triggering the issue or some other extension that is getting in the way.

I'll see if I can find out how to disable all extensions except yours to see if it's a project file issue

zombiesbyte commented 1 year ago

Ah ha - Found something while gradually turning on extensions

amiralizadeh9480.laravel-extra-intellisense https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.laravel-extra-intellisense

This instantly fires the error when I enable it

Peek 2023-03-11 11-43

maziac commented 1 year ago

Hmm, I also googled a bit for this error. To me it seems that it could be a problem of vscode. That it happens only with a few extensions could be because these extensions are language/debug servers and use this special vscode functionality.

(E.g. here similar issue: https://github.com/microsoft/vscode/issues/176562 This seems to be mainly the case on WSL2, i.e. Linux.)

zombiesbyte commented 1 year ago

Happy to close this issue as a workaround has been provided and the root cause has shifted in direction. I wasn't able to replicate the error in other PHP/Laravel repo's so there must be something specific that is causing this but I don't have anything further to go off.

composer.json (might provide clues for future explorers)

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.0.2",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^9.19",
        "laravel/sanctum": "^3.1",
        "laravel/tinker": "^2.7",
        "league/flysystem-aws-s3-v3": "^3.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },
    ...

package.json


    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "axios": "^1.1.2",
        "laravel-vite-plugin": "^0.6.0",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "vite": "^3.0.0"
    }
}

List of installed extensions

Extension Author (truncated) Version
better-comments aar 3.0.2
vscode-sql-formatter adp 1.4.4
alpine-js-intellisense adr 1.2.0
vscode-css-formatter aes 1.0.2
laravel-extra-intellisense ami 0.6.2
vscode-procurve-syntax and 1.1.1
markdown-preview-github-styles bie 1.0.1
vscode-intelephense-client bme 1.9.5
vue-docblocker BoW 2.1.0
vscode-tailwindcss bra 0.9.7
laravel-blade cjh 1.1.2
githistory don 0.6.20
dbml-language duy 0.0.1
gitlens eam 13.3.2
prettier-vscode esb 9.10.4
go gol 0.38.0
gzipdecompressor Hyu 1.2.0
vscode-edit-csv jan 0.7.4
svg joc 1.5.0
php-cs-fixer jun 0.3.9
php-xdebug kak 0.0.7
vscode-cfn-lint kdd 0.24.3
git-tree-compare let 1.14.0
pop-n-lock-theme-vscode Lux 3.32.188
dezog maz 3.2.2
twig-language-2 mbl 0.9.2
dotenv mik 1.0.1
graphql mqu 0.1.2
vscode-docker ms- 1.24.0
isort ms- 2022.8.0
python ms- 2023.4.1
vscode-pylance ms- 2023.3.20
jupyter ms- 2023.2.1200692131
jupyter-keymap ms- 1.1.0
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.6
vscode-jupyter-slideshow ms- 0.1.5
remote-containers ms- 0.282.0
cmake-tools ms- 1.13.45
cpptools ms- 1.14.4
cpptools-extension-pack ms- 1.3.0
php-docblocker nei 2.7.0
material-icon-theme PKi 4.24.0
vscode-yaml red 1.12.1
markdown-preview-enhanced shd 0.6.8
vscode-zipexplorer sle 0.3.1
pdf tom 1.2.2
cmake twx 0.0.17
vscode-icons vsc 12.2.0
volar Vue 1.2.0
vscode-typescript-vue-plugin Vue 1.2.0
twig wha 1.0.2
php-debug xde 1.32.0
highlight-trailing-white-spaces yba 0.0.2
markdown-pdf yza 1.4.4

(5 theme extensions excluded)

maziac commented 1 year ago

Do you have a launch.json in .vscode folder?

zombiesbyte commented 1 year ago

I have a extensions.json in the.vscode folder image

zombiesbyte commented 1 year ago

Oh -sorry. I was looking at the wrong codebase Yes I have a launch.json image

maziac commented 1 year ago

OK, I was just curious if there is something dezog related in it.

taylorza commented 1 year ago

I am also experiencing this issue. I cannot tell exactly when this started, I have not used dezog in a while, so it probably updated but I did update to the latest CSpect version 2.19.2.1. I have noticed that once the error occurs I cannot even run the task to launch CSpect.

The task does not have much in it

 {
     "label": "Launch CSpect",
     "type": "shell",
     "command": "D:/Temp/nextdev/emulator/cspect -fps -r -w2 -brk -zxnext -nextrom -mmc=D:/Temp/nextdev/sdcard/tbblue-dev.sd",
     "dependsOrder": "sequence",
     "dependsOn": [],
     "problemMatcher": []
}

DeZog Version: 3.2.2

When the extension host crashes and restarts the following message is in the DEBUG CONSOLE

'DeZogPlugin v2.1.0.29775' initialized.
Continue
maziac commented 1 year ago

Could you maybe go back to dezog 3.1 for a while to see If the problem exists there, too.

taylorza commented 1 year ago

I went back to version 3.1.0 and so far so good.

Here is my VSCode version information

Version: 1.76.1 (user setup) Commit: 5e805b79fcb6ba4c2d23712967df89a089da575b Date: 2023-03-08T16:32:00.131Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No

maziac commented 1 year ago

I do not see the "extension host error", but I was now able to reproduce the problem taylorza reported with the tasks. When starting "Run Task..." vscode did not list any of the tasks of tasks.json although the file still exists. vscode seems to look for tasks.json in a completely different workspace. However, after I cleared the complete file, save it, and then put the old contents in once again and again saved it, all the tasks got recognized by vscode.

This is somehow strange. Dezog has no relationship to the tasks. It does not use them or read them or whatever.

maziac commented 1 year ago

Maybe it is related to some update in vscode itself. Need to check if older versions also show this behavior.

taylorza commented 1 year ago

As an additional test, I upgraded DeZog to 3.2.2 and the problem returned. Subsequently downgrading to 3.1.0 I am not able to reproduce the problem.

maziac commented 1 year ago

Could you maybe test 3.2.1. I added a few packages in 3.2.2.

taylorza commented 1 year ago

I did a quick test this morning and I could not reproduce the issue with 3.2.1. And just for my own sanity, I retested 3.2.2 and I could reproduce the issue.

bpasero commented 1 year ago

👋 , in VS Code it is possible to start it in a way to produce a native crash dump. Curious if people can try to see if a crash dump is being produced, which then we in VS Code can also use to see if we could do something about it.

The steps in https://github.com/Microsoft/vscode/wiki/Native-Crash-Issues explain the process.

maziac commented 1 year ago

I was now able to reproduce this. For some reason it happens in Windows but not in MacOS. It is related to esbuild and the graphviz package that is used in dezog. Will investigate some more. Btw version 3.2.1 should not show this behavior.

maziac commented 1 year ago

Please retest with attached version. I exchanged the graphviz package. dezog-3.2.3-rc2.vsix.zip

Could you please also check if the flowchart and callgraph is working for you.

taylorza commented 1 year ago

It looks good. I will get setup to test the reverse engineering and callgraph capabilities and let you know, but so far 3.2.3-rc2 is looking good.

maziac commented 1 year ago

Could you please also test this version: dezog-3.2.3-rc3.vsix.zip

taylorza commented 1 year ago

3.2.3-rc3 looks good

maziac commented 1 year ago

I released 3.2.3 to marketplace. Please let me know if it works.

taylorza commented 1 year ago

It looks like it is working as expected. Thank you!

zombiesbyte commented 1 year ago

It looks like it is working as expected. Thank you!

Yep me too. Had this running for about 40 minutes with no issues, thanks

maziac commented 1 year ago

Thanks for testing.