zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.27k stars 2.98k forks source link

Remote-Development: Keeps crashing due to lack of memory available #15182

Closed DLBPointon closed 4 days ago

DLBPointon commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Set up the remote-dev environment

Installs remote server

Setup dev server folder

Open up project

Minute later. Remote connection fails.

I can then log back in but will be repeatedly get connection dropped.

Environment

Local

HPC using lshw

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

zed.log
2024-07-25T13:33:21.642371519+01:00 [INFO] ========== starting zed ==========
2024-07-25T13:33:21.729351859+01:00 [INFO] Opening main db
2024-07-25T13:33:21.76585305+01:00 [INFO] Using git binary path: None
2024-07-25T13:33:21.84607804+01:00 [INFO] installing extension html latest version
2024-07-25T13:33:21.846219703+01:00 [INFO] set status on client 0: Authenticating
2024-07-25T13:33:21.846289755+01:00 [INFO] set status on client 0: Connecting
2024-07-25T13:33:22.077999404+01:00 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc
2024-07-25T13:33:22.430018667+01:00 [INFO] add connection to peer
2024-07-25T13:33:22.430071791+01:00 [INFO] add_connection;
2024-07-25T13:33:22.43012486+01:00 [INFO] waiting for server hello
2024-07-25T13:33:22.444081743+01:00 [INFO] got server hello
2024-07-25T13:33:22.444147154+01:00 [INFO] set status to connected (connection id: ConnectionId { owner_id: 0, id: 0 }, peer id: PeerId { owner_id: 454, id: 1656719 })
2024-07-25T13:33:22.444304654+01:00 [INFO] set status on client 0: Connected { peer_id: PeerId { owner_id: 454, id: 1656719 }, connection_id: ConnectionId { owner_id: 0, id: 0 } }
2024-07-25T13:33:22.447032607+01:00 [INFO] building git repository, `.git` path in the worktree: ".git"
2024-07-25T13:33:22.963913298+01:00 [INFO] rebuilt extension index in 8.48507ms
2024-07-25T13:33:22.964037337+01:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-07-25T13:33:23.244823674+01:00 [ERROR] failed to load wasm extension html

Caused by:
    0: failed to instantiate wasm extension
    1: mmap failed to reserve 0x200000000 bytes
    2: Cannot allocate memory (os error 12)
2024-07-25T13:33:23.867505333+01:00 [INFO] set environment variables from shell:/bin/bash, path:/software/grit/conda/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/cryptsetup-2.3.5-upbw4n4h4w32gcrtmrcgdpl2mq5edkwu/sbin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/singularityce-4.1.0-wmywvbn7r2vl5opbrcibxvtcjxhtwojh/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/squashfs-4.6.1-itecc4egbbsr7jkezogrcxmjbopxn6uf/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/shadow-4.13-ensmdz4txvdqn7hrrb55ng6hntcx7o5j/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/libgpg-error-1.47-7dqcbi5usvm24hobw64jgasyniojxxqc/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/libfuse-3.16.2-bv66wskfbowhdvl4epthpryxybqr5lfs/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/go-1.21.3-ajxsxmdz6xlxousftu2pqhfxm74rdzpf/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/git-2.42.0-d74t4uspxrctldowbi5yxeoripdu6jd3/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/openssh-9.5p1-prc23f7yyacqf3b3x2db65x2drddkfsb/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/krb5-1.20.1-6ppe3zycfmrgbuw2obvk7la3iiasa2sf/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/curl-8.4.0-a5wxpzdj63tghmoecfumoo46cmhenifh/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/nghttp2-1.57.0-zfcdx6jf7fmuvuamoeue4xwqwnjd6qdt/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/libidn2-2.3.4-tz44ozqmrma6svtsjipvsnf6bnvqxhgm/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/util-linux-2.39.1-45odn4gqszqdqn7j5czrkou46sciiyuz/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/conmon-2.1.7-u2z4sr4lhsc7j4xzc6ouklwynbhme65e/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/libseccomp-2.5.4-sdy3lsuia3cqgv6l7ygpty4rnztgm4a5/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/glib-2.78.0-ocd4hb2rwwfi45tpwl35ncqz2y3k3tbr/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/python-3.11.6-2rsp5vjoxgxf7xsmoaocvxegzzwk27vn/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/util-linux-uuid-2.38.1-cfg5vly5q7hxflv22yqr66tqtkrkslsr/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/sqlite-3.43.2-myznosgiz3yd6vvbg3w6t664sjjlqfy7/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/openssl-3.1.3-bujcesd7lndbbxht6k5f3vedrimxynv3/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/expat-2.5.0-xqykpy5ua4ybofracgkxo2c43udbnkgr/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/perl-5.38.0-d6wa47obduh7vgeuf57qtqv7veqtwnxs/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/gdbm-1.23-vne54vdb2mhje642g6mu5rn43mu2qgl3/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/readline-8.2-4mkszdt4axhewfzidgknxlyyk4cjypmt/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/berkeley-db-18.1.40-6kzf3ekqhuk4cauv55g2impj5aklrw4r/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/pcre2-10.42-aile5dixy6wochxcp55oddugemkqm4b7/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/elfutils-0.189-ova3whvop7b7at7vlfz3y66u6ukuwrcd/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/pkgconf-1.9.5-oncjjtdzeq7vqyd2rk6euhwkpvfv5o63/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/gettext-0.22.3-dwvyslbblniv7fffh2tacm7z4unnnheq/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/tar-1.34-cu4lwvlzxbhgwynkxwd2sz4vya75lthb/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/zstd-1.5.5-giajr2lupgllmcvpaqeuwzu64467kl6u/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/pigz-2.7-i7bdayvdtswltrirspwm3u3tr432lveo/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/ncurses-6.4-fdyk2sckij3lfrjmapx44hzt2y6wtfeo/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/libxml2-2.10.3-mocs7x4ak6h2apynziun7hfbvzufivr4/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/xz-5.4.1-kznekhie2pomsg733bl6ju6rzfmwx6ju/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/libiconv-1.17-ra3jdfvcbxwsmeyowtgg5ya6s6qytx7k/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/bzip2-1.0.8-cwc4wbhejdajuihksvg4tie27immse7i/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/nextflow-23.10.0-74wmd5a5yiu2otarb6nkuq4hra4d4ouj/bin:/software/spack_environments/default/00/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-13.1.0/openjdk-17.0.8.1_1-6vvtdfa7tfqibhbzrromosql54do5y3j/bin:/software/team118/samtools/1.11/bin:/usr/bin:/software/grit:/software/spack_environments/groups/team311/00/bin:/usr/lib/oracle/19.6/client64/bin:/software/lsf-tol22/10.1/linux3.10-glibc2.17-x86_64/etc:/software/lsf-tol22/10.1/linux3.10-glibc2.17-x86_64/bin:/software/grit/conda/bin:/software/team118/samtools/1.11/bin:/usr/bin:/software/grit:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/bin:/software/bin
2024-07-25T13:33:23.958946097+01:00 [INFO] unhandled message SynchronizeContexts
Copy mode aborted  .823793341+01:00 [INFO] Initializing default prettier with plugins {}
2024-07-25T13:33:37.823867618+01:00 [INFO] starting language servers for Markdown:
2024-07-25T13:33:37.824079122+01:00 [INFO] Initializing default prettier with plugins {}
2024-07-25T13:33:37.824132888+01:00 [INFO] starting language servers for Markdown:
2024-07-25T13:33:37.824413612+01:00 [INFO] Node runtime install_if_needed
2024-07-25T13:33:37.947715852+01:00 [ERROR] {
  "thread": "",
  "payload": "called `Result::unwrap()` on an `Err` value: WasmError { kind: Other, message: \"failed to allocate wasm memory: mmap failed to reserve 0x200000000 bytes\\n\\nCaused by:\\n    Cannot allocate memory (os error 12)\" }",
  "location_data": {
    "file": "crates/language/src/language.rs",
    "line": 96
  },
  "backtrace": [
    "start_thread",
    "__GI___clone3"
  ],
  "app_version": "0.145.1",
  "release_channel": "Zed",
  "os_name": "Linux Headless",
  "os_version": "ubuntu 22.04",
  "architecture": "x86_64",
  "panicked_on": 1721910817947,
  "installation_id": "d2e1d9b1-565a-4c3a-bcfd-442c4e2b9276",
  "session_id": "bd17ef37-f5b8-41dc-acab-d84490a64ec4"
}
hansstimer commented 3 months ago

On the remote server (version 0.145.1) I've been seeing crashes too. Seen this in the system logs:

Out of memory: Killed process 7287 (zed-editor) total-vm:32031012kB, anon-rss:15423292kB, file-rss:2560kB, shmem-rss:0kB, UID:1000 pgtables:38924kB oom_score_adj:0

As one might imagine, the machine locks up until it unwinds the process.

mrnugget commented 4 days ago

I'm going to close this because we changed how remote development works completely: https://zed.dev/docs/remote-development Let's open another issue if this happens again.