From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: execvy@gmail.com Newsgroups: gmane.emacs.devel Subject: Re: Emacs [scratch/igc 6682d0e6c96] crash on Linux 6.6.41 KDE 6.0.5, wayland Date: Tue, 3 Sep 2024 09:10:50 +0800 Message-ID: <2dbfa6b7-19c4-40e1-a094-2995261097ac@gmail.com> References: <87ikve2el4.fsf@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10155"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Pip Cet , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 03 04:23:16 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1slJCN-0002Tx-Ul for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Sep 2024 04:23:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slJBb-0000s1-4R; Mon, 02 Sep 2024 22:22:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slI4Q-0006te-CJ for emacs-devel@gnu.org; Mon, 02 Sep 2024 21:10:58 -0400 Original-Received: from mail-oa1-x41.google.com ([2001:4860:4864:20::41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slI4O-00049G-3a for emacs-devel@gnu.org; Mon, 02 Sep 2024 21:10:58 -0400 Original-Received: by mail-oa1-x41.google.com with SMTP id 586e51a60fabf-277f0540c3aso806909fac.3 for ; Mon, 02 Sep 2024 18:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725325855; x=1725930655; darn=gnu.org; h=content-transfer-encoding:in-reply-to:references:subject:to:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=zrGW1s7y1pT1S3y5DtFoir4ccyvJmMIAU0iOhbLi1iM=; b=N3b2asOSC9ga7/aqdXfftjXX224SwbHuwSBIuQL/Rz4PUC3gM/vQ/rxG7Es7r4KIFR dA+45fkQwJVcxTTq8Js+fg+ws1bblR/3TbAdQMhCDCFiLBYAWIBDsfCZwUe5UMHUmmCm ZYFcVogHrVBYvMk5+MZSkzPy4Te3h7kkgzxjYmXGPThhKnIz7bQpCXQQ3Vxn34XLbgL1 lDq1Gi6pH1VErxKTgxkiyC4u+w3BAAsL7sGsbL2E04I1S+F97KepsTCbExCoyXSJsBgm 3RlWhJEyMvfhcfzsVf7TA4FvZ+RxK2pravjAXhkCgi5PoMgJAF6f2ZK30ShcbZj1itoW l/UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725325855; x=1725930655; h=content-transfer-encoding:in-reply-to:references:subject:to:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=zrGW1s7y1pT1S3y5DtFoir4ccyvJmMIAU0iOhbLi1iM=; b=MbQbMJpZXs9xGhT/wSFBQcm0RYRAeV1ClPgmyC/Bt3Ri0gcA6CCt+z/y16I40xmtwZ ESNbPeVSPPHXFEtlXq9B0Pmo8BUFzZSPfWmSXD+eJ6BJatoOZuusfHbWU9EM/W2xCWlg N1uxRulBqXKVTz5vCe4mmrzvaDC40KflOqi7pw4zFDVl3GC9G4LeOFHFGlr/pElb0cvk YAqIh5FlYViuvYCI7m5cFv0TVuVZr28UM+U4o82PL0jmFKtO6jxtURlL3jNOJfAX19wn p2E10ronQsxHa6lJkzQ437gFkqslRPoBXPMcPzPsavkstqqaG9ZFr0vKSyEIzUW4XzFb E2gw== X-Forwarded-Encrypted: i=1; AJvYcCWUeFTnc56rVITKvZD5UOwNGlzDdQwHjkptLDGdJKYAVyBiUQX2qfQ/82NXidXIqtPKlkubEURWDxoXPA==@gnu.org X-Gm-Message-State: AOJu0YzcOCWisOUvnQGO9vP3EJSNIJsP+ffBur1GzoX4dH0PPdbaIN7K s+OzeIgKzrRjT/aKFSxdBAWgJZn1sFvbBIDGbgntTxtDX/RB9nIKgqlDwTRAuLE= X-Google-Smtp-Source: AGHT+IFIbgLZ4hZkdlmmBH+jpJbpXrHt2UdpB9Tm3tI2V1uQFlHSMgojuPa7PDmIE8YQPLi5cG7lJg== X-Received: by 2002:a05:6871:3843:b0:277:fe14:e68c with SMTP id 586e51a60fabf-277fe1530afmr2688918fac.33.1725325854489; Mon, 02 Sep 2024 18:10:54 -0700 (PDT) Original-Received: from [28.0.0.1] (144.34.182.14.16clouds.com. [144.34.182.14]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-715e569e993sm7428664b3a.110.2024.09.02.18.10.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Sep 2024 18:10:54 -0700 (PDT) In-Reply-To: <87ikve2el4.fsf@protonmail.com> Received-SPF: pass client-ip=2001:4860:4864:20::41; envelope-from=execvy@gmail.com; helo=mail-oa1-x41.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 02 Sep 2024 22:22:22 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323314 Archived-At: Hello After I change `mps_gen_param_s gens[] = { { 128000, 0.8 }, { 5 * 128000, 0.4 } };` to `mps_gen_param_s gens[] = { { 12800000, 0.8 }, { 5 * 12800000, 0.4 } };`, the Emacs never crash again. And it's RES mem is 2661M, I think it's good, I'm editing 2000 rust files in Emacs with rust-analyzer lsp server. 99% of time I don't feel GC's lag. But, When I hit `Ctrl + right click`, I feel a very long GC lag ( > 10 seconds). It's reproducible. So I profiler-start, then `Ctrl + right click`, then `profiler-stop`, got: ``` 14726 58% Automatic GC 10528 41% - help-command-error-confusable-suggestions 10528 41% - debug 10528 41% - recursive-edit 391 1% - substitute-command-keys 134 0% - # 134 0% - kill-buffer 102 0% tabspaces--local-buffer-p 6 0% - replace-buffer-in-windows 3 0% - unrecord-window-buffer 1 0% window-normalize-window 1 0% window-normalize-buffer 19 0% generate-new-buffer 16 0% text-quoting-style 332 1% - redisplay_internal (C function) 18 0% - eval 11 0% - mode--line-format-right-align 6 0% string-pixel-width 1 0% - eval 1 0% - minions--prominent-modes 1 0% - cl-remove-if-not 1 0% cl-remove 5 0% - breadcrumb--header-line 4 0% - funcall 2 0% - breadcrumb-imenu-crumbs 2 0% - let 2 0% - which-function 2 0% - add-log-current-defun 2 0% - treesit-add-log-current-defun 1 0% - treesit-defun-at-point 1 0% - treesit-thing-at-point 1 0% treesit-thing-at 1 0% - treesit-defun-name 1 0% rust-ts-mode--defun-name 2 0% - breadcrumb-project-crumbs 2 0% - breadcrumb--project-crumbs-1 1 0% - file-relative-name 1 0% - apply 1 0% - # 1 0% - my-cacheable-file-relative-name 1 0% let 1 0% breadcrumb--format-project-node 1 0% - minions--prominent-modes 1 0% - cl-remove-if-not 1 0% - cl-remove 1 0% # 1 0% - if 1 0% frame-parameter 2 0% - tab-bar-make-keymap 2 0% - tab-bar-make-keymap-1 2 0% - tab-bar-format-list 2 0% - # 1 0% - tab-bar-format-tabs 1 0% - # 1 0% tab-bar--format-tab 1 0% - tab-bar-format-align-right 1 0% - tab-bar-format-list 1 0% - # 1 0% - keycast-tab-bar 1 0% - keycast--format 1 0% format-spec 1 0% - redisplay--pre-redisplay-functions 1 0% - run-hook-with-args 1 0% - redisplay--update-region-highlight 1 0% # 84 0% keymap-canonicalize 69 0% - # 68 0% - easy-menu-filter-return 68 0% - easy-menu-create-menu 67 0% easy-menu-convert-item 1 0% - recentf-make-menu-items 1 0% - mapcar 1 0% recentf-make-default-menu-element 16 0% - timer-event-handler 14 0% - apply 8 0% - # 8 0% jit-lock-context-fontify 3 0% - diff-hl-flydiff-update 1 0% - diff-hl-update 1 0% - diff-hl--update 1 0% diff-hl-remove-overlays 2 0% - which-key--update 2 0% - which-key--create-buffer-and-show 1 0% - apply 1 0% - message 1 0% - apply 1 0% - ad-Advice-message 1 0% - apply 1 0% # 1 0% - which-key--get-bindings 1 0% - which-key--get-current-bindings 1 0% - which-key--get-keymap-bindings 1 0% - which-key--get-keymap-bindings-1 1 0% - # 1 0% string-match 1 0% - activities-save-all 1 0% - activities--persist 1 0% persist-save 2 0% - timer-inc-time 2 0% timer-relative-time 6 0% - # 6 0% - let 6 0% - while 6 0% - if 6 0% - let* 6 0% - if 6 0% - progn 5 0% - funcall 4 0% - # 4 0% - funcall 4 0% - # 4 0% - if 4 0% - progn 4 0% - funcall 4 0% - # 4 0% - save-current-buffer 4 0% - apply 4 0% - # 4 0% - let 3 0% - while 3 0% - let 3 0% - let* 1 0% plist-get 1 0% - lsp--position-to-point 1 0% - let* 1 0% lsp--line-character-to-point 1 0% - lsp--label-from-inlay-hints-response 1 0% - cond 1 0% - string-join 1 0% - mapcar 1 0% - function 1 0% - cconv-make-interpreted-closure 1 0% - macroexpand-all 1 0% - macroexp--expand-all 1 0% - macroexp--all-forms 1 0% macroexp--expand-all 1 0% - let 1 0% - if 1 0% - let 1 0% - let* 1 0% - -filter 1 0% - # 1 0% - apply 1 0% - lsp--workspace-method-supported? 1 0% - let 1 0% - if 1 0% - or 1 0% - if 1 0% - progn 1 0% - lsp--capability 1 0% if 1 0% - # 1 0% - funcall 1 0% - # 1 0% - if 1 0% - progn 1 0% - funcall 1 0% - # 1 0% - save-current-buffer 1 0% - apply 1 0% - # 1 0% - lsp--remove-overlays 1 0% - save-restriction 1 0% remove-overlays 1 0% - condition-case 1 0% - let 1 0% - save-current-buffer 1 0% - unwind-protect 1 0% - and 1 0% - kill-buffer 1 0% - replace-buffer-in-windows 1 0% unrecord-window-buffer 1 0% - or 1 0% - and 1 0% - or 1 0% - not 1 0% verify-visited-file-modtime 1 0% - frame-monitor-workarea 1 0% - frame-monitor-attribute 1 0% display-monitor-attributes-list 1 0% display-line-numbers-update-width 1 0% - winner-save-old-configurations 1 0% winner-remember 1 0% - #:evil-activate-visual-state 1 0% - apply 1 0% - # 1 0% - evil-visual-state 1 0% - evil-normalize-keymaps 1 0% - evil-state-keymaps 1 0% - evil-state-keymaps 1 0% - evil-state-intercept-keymaps 1 0% evil-intercept-keymap-p 0 0% ... ``` Automatic GC take too much times, do you think this is expected? On 9/3/24 12:41 AM, Pip Cet wrote: > "Eval Exec" writes: > > > Hello, > > I'm helping to test scratch/igc branch on my local environment: > > Thank you! > > > ``` > > ❯ uname -a > > Linux Matrix 6.6.41 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jul 18 11:21:27 > > UTC 2024 x86_64 GNU/Linux > > ``` > > > > I get the source code of scratch/igc, commit hash: 6682d0e6c96 . > > And I append a new commit: > > ``` > > diff --git a/src/igc.c b/src/igc.c > > index f069a2becc9..4d792da75c8 100644 > > --- a/src/igc.c > > +++ b/src/igc.c > > @@ -4459,7 +4459,7 @@ make_arena (struct igc *gc) > > MPS_ARGS_END (args); > > IGC_CHECK_RES (res); > > > > - mps_gen_param_s gens[] = { { 128000, 0.8 }, { 5 * 128000, 0.4 } }; > > + mps_gen_param_s gens[] = { { 128000000, 0.8 }, { 5 * 128000000, 0.4 } }; > > res = mps_chain_create (&gc->chain, gc->arena, ARRAYELTS (gens), gens); > > IGC_CHECK_RES (res); > > } > > ``` > > Those numbers are in kilobytes, so that requests 640 gigabytes of memory > before it'll even start collecting in earnest. In theory, that should > work given enough RAM or swap, but I doubt anyone's tested MPS with such > extreme settings. > > > Then, I compile it by: > > ``` > > make extraclean > > ./autogen.sh \ > > && ./configure \ > > --prefix=$(realpath ../emacs-build/$(git branch --show-current | sed > > 's/\//_/g'))\ > > --with-mps=yes \ > > --with-imagemagick \ > > --with-modules --with-x-toolkit=gtk3 --without-compress-install \ > > --without-toolkit-scroll-bars --with-native-compilation --with-mailutils\ > > --enable-link-time-optimization \ > > --with-tree-sitter --with-xinput2 \ > > --with-dbus --with-native-compilation=aot \ > > --with-file-notification=inotify\ > > && make -j30 install > > ``` > > > > When I launch the emacs, editing rust files, emacs crashed. the > > backtrace is: > > How much memory was it using at the time? To me it looks conceivable > the crash happened because we failed to get enough memory for a new > stack frame, but if it's reproducible or happens again after reducing > the generation sizes, we need to investigate it further. > > > ``` > > (gdb) source /home/exec/Projects/git.savannah.gnu.org/git/emacs/src/.gdbinit > > warning: /home/exec/Projects/git.savannah.gnu.org/git/emacs/../lwlib: > > No such file or directory > > SIGINT is used by the debugger. > > Are you sure you want to change it? (y or n) [answered Y; input not > > from terminal] > > DISPLAY = :0 > > TERM = tmux-256color > > Breakpoint 1 at 0x428ca7: file > > /home/exec/Projects/git.savannah.gnu.org/git/emacs/src/emacs.c, line > > 432. > > Breakpoint 2 at 0x52db40: file > > /home/exec/Projects/git.savannah.gnu.org/git/emacs/src/xterm.c, line > > 27126. > > (gdb) bt > > #0 0x00007f36826a2efc in __pthread_kill_implementation () from > > /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6 > > #1 0x00007f3682652e86 in raise () from > > /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6 > > #2 0x0000000000428d5a in terminate_due_to_signal (sig=11, > > backtrace_limit=) at > > /home/exec/Projects/git.savannah.gnu.org/git/emacs/src/emacs.c:470 > > #3 0x0000000000429579 in handle_fatal_signal (sig=) at > > /home/exec/Projects/git.savannah.gnu.org/git/emacs/src/sysdep.c:1800 > > #4 0x00000000006c5a68 in deliver_thread_signal.constprop.0 (sig=11, > > handler=) at > > /home/exec/Projects/git.savannah.gnu.org/git/emacs/src/sysdep.c:1792 > > #5 > > #6 0x00007f368265316b in kill () from > > /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6 > > #7 0x00000000007551e9 in sigHandle () > > #8 > > #9 indirect_function (object=XIL(0)) at > > /home/exec/Projects/git.savannah.gnu.org/git/emacs/src/lisp.h:1198 > > It would be good to know whether 'object' is actually nil in this case > (in which case lisp.h:1198 is wrong) or whether the nil is wrong (and > the lisp.h:1198, possibly, correct), but I suspect the best bet is to > reduce the generation chain sizes and try again. > > > What information should I provide to help investigating this crash? > > Trying again with a more moderate generation size would be ideal, but > you might want to run Emacs in GDB and keep it connected after a crash > so we can investigate further. > > Thanks again > Pip > >