From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70914: 29.3; Crashes often on Windows Date: Tue, 14 May 2024 15:30:18 +0300 Message-ID: <864jb0wp7p.fsf@gnu.org> References: <86msouxamh.fsf@gnu.org> <86h6f0wsbv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36496"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70914@debbugs.gnu.org To: Simen =?UTF-8?Q?Endsj=C3=B8?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 14 14:31:41 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1s6rJl-0009Mx-6M for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 May 2024 14:31:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6rJM-0001HW-HA; Tue, 14 May 2024 08:31:21 -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 1s6rJA-0001E8-B3 for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 08:31:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s6rJ7-00073C-Ux for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 08:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6rJ8-0004Mx-Hr for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 08:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 12:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70914 X-GNU-PR-Package: emacs Original-Received: via spool by 70914-submit@debbugs.gnu.org id=B70914.171568984916788 (code B ref 70914); Tue, 14 May 2024 12:31:02 +0000 Original-Received: (at 70914) by debbugs.gnu.org; 14 May 2024 12:30:49 +0000 Original-Received: from localhost ([127.0.0.1]:39073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6rIu-0004Mi-PE for submit@debbugs.gnu.org; Tue, 14 May 2024 08:30:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6rIr-0004Mc-4P for 70914@debbugs.gnu.org; Tue, 14 May 2024 08:30:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s6rIi-0006qg-F7; Tue, 14 May 2024 08:30:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=UtS9epTVa4RCvsjBGzZvhPU+gnJXojZBNJZC46Z0l2E=; b=MVtV6CPM+nxgxt5qDOJI 1J4540Y+g5UnfIuyr5v0WMso4K3bu0d6BKQhKz800TJ+ngAXO4NibeOsmW4v95dVBgvoczq6SoFpd CME2IrUC6vxie444wKaRE6FIpugKgDNzYyv/+ToSHSA8B4zdHhmsZ5uBSYvsHXLvOmsS6P859XVM/ cPWD5cU+UkXvPz4TxSLkcelLA5qdAQoae0aaVp4cDRq8YtaGTU3s/00sjaq+u/n8qsXi2RfImUxa5 THnDfpooemkyr+/KglJf1rcmBq0qI16WN88XhFrnBkZYle13+eZAHsAR9hI1ffLpLz1FAwRcVaLR9 2+fIVIa9zsAodg==; In-Reply-To: (message from Simen =?UTF-8?Q?Endsj=C3=B8?= on Tue, 14 May 2024 14:08:52 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285012 Archived-At: > From: Simen Endsjø > Date: Tue, 14 May 2024 14:08:52 +0200 > Cc: 70914@debbugs.gnu.org > > I understood it as writing outside the stack space for a completion. > Could be caused by some incorrect handling of coding systems where too > little space was reserved as you note. That's unlikely, since (a) I see no encoding in all-completions, and (b) the encoding routines don't use the stack. However, if I will see chkstk in all of your backtraces, I might change my mind about that. > I'm setting LANG to en_US both in the system environment and in my > emacs configuration. Why? You shouldn't need to do that on Windows. Emacs running on Windows determines the correct value of LANG from Windows-specific APIs, and sets LANG internally. If your language environment is English, Emacs should set LANG to "ENU" on Windows. "ENU" is the MS-Windows equivalent of the Posix en_US (the latter is not really supported on Windows). > I've also enabled UTF-8 everywhere on the systems (beta feature). I don't recommend that. But even if you do set it for the rest of your system, it is not a good idea to do that in Emacs, especially for communications with sub-processes, where UTF-8 is not supported on Windows -- quite a lot of programs we are used to invoke from Emacs, especially ports of GNU software (and console programs in general) will not be able to interpret UTF-8 command-line arguments passed to them by Emacs, not in general anyway. > But it's better to use LANG=ENU and the default coding system? Yes. And you shouldn't need to set any of these, neither LANG not the coding systems: Emacs will do that itself at startup, and should do it correctly. > Here's the relevant configuration from my init.el: > > ;; Windows doesn't set this, but some packages might depend on the variable > (setenv "LANG" "en_US") The comment is not correct. To see for yourself, ensure LANG is not set in the system-wide environment, start "emacs -Q", and then type M-: (getenv "LANG") RET > ;; While the Windows clipboard shouldn't change the coding system, > ;; I get latin-1 back when pasting in Emacs. > ;; See `list-coding-systems' > ;; NOTE: I've turned on the global utf8 beta feature in Windows, > ;; and we thus don't need this > ;;(set-clipboard-coding-system 'latin-1) > (set-clipboard-coding-system 'utf-8) This is a very bad idea, IME. The clipboard on Windows uses UTF-16, and Emacs knows how to decode it correctly. Customizing clipboard-coding-system to something else just gets in the way. I don't know where does the comment about latin-1 by default come from (maybe from Windows 9X days?), but it is not true on Windows for a very long time. The default value of selection-coding-system on Windows is utf-16le-dos, you can again verify that in "emacs -Q". Again, I'm not sure this is relevant to the crashes. But it doesn't do any harm to make your Emacs configuration healthier ;-)