Repository navigation
Zlib error: invalid distance too far back #134429
Copy link
Copy link
Closed
Labels
author-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insidersremote-connectionIssues about the remote connectionIssues about the remote connectionverifiedVerification succeededVerification succeeded
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version:1.60.2
- OS Version:Windows_NT x64 10.0.19042
This is a problem that occurs when connecting the target OS to Linux from the Windows host OS using Remote Development.
If you check the logs, the extension host will start when you make a remote connection.
However, the extension host exits immediately.
"Extension Host Process exited with code: 1, signal: null." Is displayed on the log.
I guess the extended host function is timing out because the processing speed of the target OS is slow.
I set "Remote-SSH: Connect Timeout" to 500 seconds to solve this problem, but the problem still persists.
Are there any other measures?
[2021-10-05 17:57:11.242] [remoteagent] [info] Extension host agent started.
[2021-10-05 17:57:16.696] [remoteagent] [warning] No ptyHost heartbeat after 6 seconds
[2021-10-05 17:57:16.995] [remoteagent] [info] [<unknown>][fae5c6c7][ManagementConnection] New connection established.
[2021-10-05 17:57:17.184] [remoteagent] [info] [<unknown>][6346e60b][ExtensionHostConnection] New connection established.
[2021-10-05 17:57:17.364] [remoteagent] [info] [<unknown>][6346e60b][ExtensionHostConnection] <6182> Launched Extension Host Process.
[2021-10-05 17:57:22.028] [remoteagent] [error] No ptyHost heartbeat after 12 seconds
[2021-10-05 17:57:29.762] [remoteagent] [warning] No ptyHost heartbeat after 6 seconds
[2021-10-05 17:57:36.051] [remoteagent] [info] [<unknown>][6346e60b][ExtensionHostConnection] <6182> Extension Host Process exited with code: 1, signal: null.
[2021-10-05 17:57:36.072] [remoteagent] [info] Last EH closed, waiting before shutting down
[2021-10-05 17:57:36.686] [remoteagent] [error] [<unknown>][6346e60b][ExtensionHostConnection] Unknown reconnection token.
[2021-10-05 17:57:37.094] [remoteagent] [info] [<unknown>][fae5c6c7][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
author-verification-requestedIssues potentially verifiable by issue authorIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insidersremote-connectionIssues about the remote connectionIssues about the remote connectionverifiedVerification succeededVerification succeeded
Activity
alexdima commentedon Oct 12, 2021
kkat-zero In this case, it looks like the extension host process exited after 19seconds with exit code 1, which according to nodejs means "Uncaught Fatal Exception - There was an uncaught exception, and it was not handled by a domain or an uncaughtException event handler.". Unfortunately, that exit code is not very revealing towards what could be the problem.
In
1.61.0we have improved logging on the server side to also include thestdoutandstderrfrom the remote extension host. Could you please also try with1.61.0to see if the log contains more information regarding the crashing extension host? Also, could you please look for the remote extension host log (F1 > Developer: Show Logs > Remote Extension Host), the process appears to be running for 19s, so maybe there is something revealing in the remote extension host logs.kkat-zero commentedon Oct 13, 2021
Alexandru Dima (@alexdima) Thank you for your reply.
After updating VS code to 1.61.0 as you suggested, I reproduced the same phenomenon.
then, I got the log, so I will post it.
One is the log on the Remote-server side.
The other is the log on the Remote extension Host side.
remoteagent.log
developer logs_remote_extension_Host.log
alexdima commentedon Oct 13, 2021
kkat-zero Thank you for the extra information, the
remoteagent.logdoes now point to the root cause:It looks like there is a zlib stream decoding error in the extension host.
kkat-zero I am very interested to manage to reproduce this. In the remote machine, we pass over sockets from one process to another, and I think that something might be misbehaving in this area. What is the remote Linux distribution/version that you are connecting to? Does this reproduce when connecting to any linux machine via SSH?
kkat-zero commentedon Oct 13, 2021
Alexandru Dima (@alexdima) Thank you for the quick response.
Describes the Linux distribution and kernel version.
-Debian (version 9.13)
-Linux Kernel (Linux version 4.4.0-cip-rt-am335x (root @ runner--WzatKxx-project-21419463-concurrent-0) (gcc version 6.3.0 20170516 (Debian 6.3.0-18)) # 1 Thu Oct 22 03:36:11 UTC 2020)
This target Linux machine is an embedded Linux device. (MOXA-UC2100)
When connecting directly with OpenSSH, this phenomenon does not occur.
kkat-zero commentedon Oct 13, 2021
Alexandru Dima (@alexdima) We will inform you of additional information.
A) In rare cases, this phenomenon can be connected without error. (When retrying many times)
However, even after the connection is established, the remote connection is often disconnected on the way.
B) This embedded device has a very small internal RAM of 256MB.
Therefore, the memory capacity is increased by setting the virtual memory.
The additional RAM capacity setting is 512MB.
The additional memory is set to the built-in flash ROM (eMMC).
Therefore, the total RAM of the system is 768MB.
When VS Code makes a remote connection, I'm checking that a memory swap is occurring because the internal RAM alone isn't enough.
When I checked the memory used when the startup was successful, it was confirmed that a total of about 300MB of RAM was used.
alexdima commentedon Oct 13, 2021
kkat-zero Thank you for the extra information. Indeed, it might be a bug caused by timing that reproduces on memory limited machines that need to do swapping. Is there a way for me to try this debian distro in a VM? Could you please point me to an article or some steps to simulate this environment?
kkat-zero commentedon Oct 13, 2021
Alexandru Dima (@alexdima) Thank you for the quick response.
It is very difficult to build the same environment.
This is because there is generally no embedded linux VM environment.
(Usually, the test is performed on the actual machine)
However, I think it is possible to create an environment that combines only the limited memory environment with a VM.
First, build a virtual environment to install Debian OS on VMWare.
At this time, set the internal RAM memory to be mounted as small as 256MB. (Set an appropriate size for the built-in ROM, about 8 to 16GB)
Once the virtual environment can be built, set the virtual memory under that environment.
In our environment, 512MB is set as virtual memory.
There are two points of concern.
One thing to worry about is whether it is possible to install a general Debian OS on a PC with limited RAM.
If you cannot install it, you need to adjust the RAM size to an appropriate size as much as possible.
(It is necessary to build a state in which the internal RAM usage after OS installation is moderately overused.)
Second, when using a VM environment, there is a high possibility that the CPU processing speed and memory access speed will be faster than the actual machine.
Even if you set the virtual memory in the VM environment, the same problem may not occur if the problem is caused by the processing speed.
(If the problem depends on the virtual memory mechanism, it may be reproduced.)
For reference, the following sites are shown.
[How to build VMware]
https://kb.vmware.com/s/article/1018415
[Virtual memory setting method]
https://www.techwalla.com/articles/how-to-increase-virtual-memory-in-linux
7 remaining items
Ask the client to pause writing until the socket is sent to the remot…
aeschli commentedon Dec 2, 2021
Alexandru Dima (@alexdima) Is this something we can verify? Do you have a simple setup with steps?
alexdima commentedon Dec 2, 2021
Unfortunately I was only able to reproduce by making changes to the source code (e.g. to add artificial delays to the extension host startup path).
vscode-triage-bot commentedon Dec 2, 2021
This bug has been fixed in the latest release of VS Code Insiders!
kkat-zero, you can help us out by commenting
/verifiedif things are now working as expected.If things still don't seem right, please ensure you're on version 68a1e2f of Insiders (today's or later - you can use
Help: Aboutin the command palette to check), and leave a comment letting us know what isn't working as expected.Happy Coding!
kkat-zero commentedon Dec 3, 2021
Alexandru Dima (@alexdima) Thank you for corresponding to solve this issue.
I did the same test with Ver1.63.0-insider.
As a result, it was confirmed that it operates stably.
This issue can be closed.
Thank you.