microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.99k stars 29.54k forks source link

v1.53 creates debug.log automatically #115874

Closed IperStan closed 3 years ago

IperStan commented 3 years ago

Issue Type: Bug

Apparently it's an old issue https://github.com/microsoft/vscode/issues/105191#issuecomment-690953187

I have the same behaviour: open the first window (no debug.log file) -> open the second window (debug.log file was created automatically)

VS Code version: Code 1.53.0 (8490d3dde47c57ba65ec40dd192d014fd2113496, 2021-02-03T20:36:38.611Z) OS version: Windows_NT x64 10.0.19041

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.94GB (5.82GB free)| |Process Argv|C:\\Progetti\\iperGestionale| |Screen Reader|no| |VM|0%|
Extensions (25) Extension|Author (truncated)|Version ---|---|--- indent4to2|Com|0.1.2 alignment|ann|0.3.0 bracket-pair-colorizer-2|Coe|0.2.0 vscode-eslint|dba|2.1.14 githistory|don|0.6.14 gitlens|eam|11.2.1 tortoise-svn|fan|0.1.1 auto-close-tag|for|0.5.10 beautify|Hoo|1.5.0 svn-scm|joh|2.13.5 vscode-cflint|Kam|0.3.4 vscode-cfml|Kam|0.5.3 HTMLHint|mka|0.10.0 vscode-filesize|mkx|2.1.4 prettify-json|moh|0.0.3 sublime-keybindings|ms-|4.0.7 color-highlight|nau|2.3.0 vetur|oct|0.32.0 vscode-yaml|red|0.14.0 sass-indented|rob|1.5.1 vscode-paste-and-indent|Rub|0.0.8 vscode-sql-beautify|sen|0.0.4 open-in-browser|tec|2.0.0 vscode-icons|vsc|11.1.0 JavaScriptSnippets|xab|1.8.0
nemchik commented 3 years ago

I can confirm I experienced this issue with 1.49. I believe it was resolved in 1.49.2 (I no longer experienced it at that point). Now the issue seems to have returned in 1.53.


VS Code version: Code 1.53.0 (8490d3dde47c57ba65ec40dd192d014fd2113496, 2021-02-03T20:36:38.611Z) OS version: Windows_NT x64 10.0.19042

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz (4 x 3292)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.92GB (5.42GB free)| |Process Argv|--crash-reporter-id 57e98722-0245-4ceb-bd53-ca7a45705c1f| |Screen Reader|no| |VM|0%|
Extensions (46) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|2.1.0 vscode-icalendar|af4|1.0.1 vscode-intelephense-client|bme|1.6.3 npm-intellisense|chr|1.3.1 gitignore|cod|0.6.0 bracket-pair-colorizer-2|Coe|0.2.0 systemd-unit-file|coo|1.0.6 vscode-dockerfilelint|Dan|0.0.2 vscode-markdownlint|Dav|0.38.0 vscode-eslint|dba|2.1.14 xml|Dot|2.5.1 gitlens|eam|11.2.1 EditorConfig|Edi|0.16.4 vscode-npm-script|eg2|0.3.13 prettier-vscode|esb|5.9.1 shell-format|fox|7.0.1 vscode-nginx-conf-hint|han|0.1.0 npm-dependency-links|her|1.2.0 nsis|idl|3.38.0 composer|ika|0.7.1 dupchecker|jia|0.1.6 vscode-format-context-menu|lac|1.0.4 dotenv|mik|1.0.1 vscode-docker|ms-|1.9.1 mssql|ms-|1.10.1 python|ms-|2021.1.502429796 vscode-pylance|ms-|2021.2.0 jupyter|ms-|2020.12.414227025 remote-containers|ms-|0.158.0 remote-ssh|ms-|0.63.0 remote-ssh-edit|ms-|0.63.0 remote-wsl|ms-|0.53.2 vscode-remote-extensionpack|ms-|0.20.0 powershell|ms-|2020.6.0 vsliveshare|ms-|1.0.3629 indent-rainbow|ode|7.5.0 vscode-yaml-sort|Pas|3.1.0 nginx-formatter|ray|0.0.11 vscode-sort-json|ric|1.19.2 code-spell-checker|str|1.10.2 vscode-stylelint|sty|0.85.0 shellcheck|tim|0.13.1 vscodeintellicode|Vis|1.2.11 vscode-nginx|wil|0.7.2 vscode-import-cost|wix|2.15.0 markdown-all-in-one|yzh|3.4.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspyt653:30253241 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30211401 pythonvsdeb440:30248342 pythonvsded773:30248341 pythonvspyt600cf:30251589 ```
deepak1556 commented 3 years ago

Can you provide the exact repro steps that created the log, I cannot repro with the steps from previous issue using system install. Thanks!

nemchik commented 3 years ago

Can you provide the exact repro steps that created the log, I cannot repro with the steps from previous issue using system install. Thanks!

I did a little testing, and here's what I've come up with.

With no vscode instances open, I navigate in Windows Explorer to the folder I want to open in vscode. I right click on the folder in the Explorer tree on the left of Windows Explorer and select "Open with Code". the debug.log files do not get created in the folder tree.

With at least one instance of vscode open (which as stated above is unaffected by the debug.log issue), i repeat the exact same steps but for a different folder (so I now have two or more folders open with code) and all instances of vscode after the first will have debug.log files created in any folder next to a file that is opened as a tab in vscode. vscode remembers which files i have open when reopening a folder in this way, so if I have files open all of the folders where those file exist will have a debug.log created just by starting vscode. Opening any files in any folders after that will also create a debug.log file.

Further info. I have opened git repos, folders that are not git repos, and even created new empty folders and opened them in vscode. All of the above are affected and debug.log files will be created if i have more than one instance of vscode open. The first instance remains unaffected, even when having multiple instances open.

nemchik commented 3 years ago

Also here are the contents of the file:

[0205/141437.535:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)
[0205/141437.561:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)
mbomb007 commented 3 years ago

Same for me:

[0205/143929.529:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)
[0205/143929.572:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)

Also, the instance that created the debug.log file must be closed in order for the debug.log file to be deleted.

nemchik commented 3 years ago

P.s. I confirmed closing all vscode instances and switching the order of the folders opened still results in the second instance opened having debug.log files created did me.

Also I'm running a system install (not user)

deepak1556 commented 3 years ago

Thanks for the steps in https://github.com/microsoft/vscode/issues/115874#issuecomment-774264583, I am able to repro the issue.

deepak1556 commented 3 years ago

Crashpad handler gets instantiated the following way on windows,

Fix at https://github.com/microsoft/vscode/pull/116252 will now take pipe from the original instance and give it to all the instances that are connecting to it.

As for the original debug.log file generation,

So it is unclear why the PLOG error from registration_protocol_win would be logged to a file. I can no longer repo the issue following the steps at https://github.com/microsoft/vscode/issues/115874#issuecomment-774264583, so there is nothing much I can do without more reliable repro here.

nemchik commented 3 years ago

1.53.1 seems to have resolved the issue for me.

Version: 1.53.1 (system setup) Commit: 5d424b828ada08e1eb9f95d6cb41120234ef57c7 Date: 2021-02-08T23:29:42.785Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

IperStan commented 3 years ago

1.53.1 seems to have resolved the issue for me.

Version: 1.53.1 (system setup) Commit: 5d424b8 Date: 2021-02-08T23:29:42.785Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

Negative, I'm on 1.53.1 and the issue still persists. How is it possible you don't have it if the fix was released 7 hours ago?

nemchik commented 3 years ago

1.53.1 seems to have resolved the issue for me. Version: 1.53.1 (system setup) Commit: 5d424b8 Date: 2021-02-08T23:29:42.785Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

Negative, I'm on 1.53.1 and the issue still persists. How is it possible you don't have it if the fix was released 7 hours ago?

Something else in 1.53.1 may have affected it? I'm not sure. But I am am unable to reproduce the issue on 1.53.1.

OurMajesty commented 3 years ago

I can confirm, I am having the issue on 1.53.1 too. To reproduce I just have to open second VSCode window with another repository.

Version: 1.53.1 (system setup) Commit: 5d424b828ada08e1eb9f95d6cb41120234ef57c7 Date: 2021-02-08T23:29:42.785Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

deepak1556 commented 3 years ago

Can you check if the issue persists with the latest insiders https://code.visualstudio.com/insiders

nemchik commented 3 years ago

1.53.1 seems to have resolved the issue for me. Version: 1.53.1 (system setup) Commit: 5d424b8 Date: 2021-02-08T23:29:42.785Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

Just reproduced on a different machine running 1.53.1

nemchik commented 3 years ago

/verified

nemchik commented 3 years ago

Could not reproduce on

Version: 1.54.0-insider (user setup) Commit: 40b3204d70a9c72305c613164272175d0b344b5f Date: 2021-02-10T17:39:27.208Z Electron: 11.2.3 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

IperStan commented 3 years ago

/verified

danstur commented 3 years ago

@deepak1556 Has the underlying problem (writing log files into arbitrary user directories) been solved or is this just treating the symptoms "we fixed the problem that caused the error in this particular case"?

If it's the latter it sounds like a good idea to create a new issue to actually fix the problem of log files getting written to the wrong place - otherwise we'll just have the same problem again in a few months. I might want to look into this if I find time.

deepak1556 commented 3 years ago

@danstur as mentioned here https://github.com/microsoft/vscode/issues/115874#issuecomment-776406845

The fix was made for the error seen in the log

[0205/143929.529:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)

As for the original debug.log generation under system install, I have outlined the changes that were made to make this impossible to create.

If it's the latter it sounds like a good idea to create a new issue to actually fix the problem of log files getting written to the wrong place -

You are right, but without a reliable repro, I can't validate why the logging preferences set by the runtime are being ignored.

nemchik commented 3 years ago

1.53.2 seems to have fixed the issue on both of my systems. Thanks!

IperStan commented 3 years ago

All good with 1.53.2. Thanks for the quick fix! Happy coding!