From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Simen =?UTF-8?Q?Endsj=C3=B8?= Newsgroups: gmane.emacs.bugs Subject: bug#70914: 29.3; Crashes often on Windows Date: Tue, 14 May 2024 15:58:48 +0200 Message-ID: References: <86msouxamh.fsf@gnu.org> <86h6f0wsbv.fsf@gnu.org> <864jb0wp7p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35783"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70914@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 14 16:01:47 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 1s6sis-000948-9q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 May 2024 16:01:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6sia-0001cL-2z; Tue, 14 May 2024 10:01:24 -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 1s6siG-0001XF-KT for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 10:01:11 -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 1s6siD-0004Ta-7d for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 10:01:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6siE-0005ZO-9P for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 10:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Simen =?UTF-8?Q?Endsj=C3=B8?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2024 14:01: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.171569521221390 (code B ref 70914); Tue, 14 May 2024 14:01:02 +0000 Original-Received: (at 70914) by debbugs.gnu.org; 14 May 2024 14:00:12 +0000 Original-Received: from localhost ([127.0.0.1]:39532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6shQ-0005Yw-3x for submit@debbugs.gnu.org; Tue, 14 May 2024 10:00:12 -0400 Original-Received: from mail-lj1-f176.google.com ([209.85.208.176]:57541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6shL-0005XL-By for 70914@debbugs.gnu.org; Tue, 14 May 2024 10:00:10 -0400 Original-Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2e5218112a6so46769261fa.2 for <70914@debbugs.gnu.org>; Tue, 14 May 2024 07:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715695140; x=1716299940; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6BO/KcqFD6DtQ2JK2IihpioMdYzvSrnz2uBjymc4fyA=; b=Ut0h4PMCubx4jCTMA9yEzgWQUjlKIaqHgJxVQwxe1CuE/XFnAbMOUDcrC/deFLin9M WFqJLyRwAMsKkYHOXX4Hu51mvW03xRgWjSKxzr31yztdYky3n3YYorKS+TImv3/tKqYI Cl3E/dkkMggykN+5JPWlijkPZNDWRlZSjIavj3D5ewI0N3KB9QeRecePcOhjfwjtRZMa 5P1R+iuojrTUOTEvOQH4X9dPrYGrmwsJV9e4/7zpSRGpa6y62oUTdA9gPkrL7mSyqshy olOLnXu8nC0QYc/vac7ukM9ZKbW0+ZfDzR4cvu0qbLns+qUd8Qt9oKRf5yGHnaaacnTx JplQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715695140; x=1716299940; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6BO/KcqFD6DtQ2JK2IihpioMdYzvSrnz2uBjymc4fyA=; b=fXTVR6nRIc/sMTaeSvCjxChDX0MNFUQmeMaGaLpyYEZxJ1gE7vpUcA+3sb1M4MnpLk rHIlH1XwC0lq8XQ4Lu08BZAXwsInbwxz1yrPrdhHo7eRpxoklTX4hyqMIigvvtEnlzLn LdIUCRQq+52kF3s3CVlPKd4UyVbf7gFbucFyGnYG7L3OTbGDAhlqOWn7mm2+gRGhgQYs tfSN3U1gWUY4Un9RNwNZGaXV+MUh8CFLbMw8ZsoPQ3u9I4P2c3liKIoM9ORnhSO522HU mlccQo4frq7xiESFuWkdfl6xQrV17lLqqvNmuHGW12MFSO+iR78HntGO/9a3sJ8G8bIA jCVQ== X-Gm-Message-State: AOJu0YyDC6T1DW8u8bXe5q600/kUYQPNVUAttryJrcuinf+FVztBCKGB uLFcKftUP5Y80peu0KLzfTJaHN8llVZJ4wKwUtI9wCT8YfPTEnOi1x3lp4HGl8PV1dDRYaQp9QJ baxKqH2HblNgq7luJqLCsXdtplxk= X-Google-Smtp-Source: AGHT+IHRWmqVs4+wm9he+8H3ZFQ7NR8St8J0HDvF1ZibJbzInad5Ek9qZqfuGhNx8NK+pUh7H4N3YftFWmSiTqqze0o= X-Received: by 2002:a05:651c:50c:b0:2e0:ffea:4298 with SMTP id 38308e7fff4ca-2e52039c0c8mr104529301fa.34.1715695139970; Tue, 14 May 2024 06:58:59 -0700 (PDT) In-Reply-To: <864jb0wp7p.fsf@gnu.org> 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:285019 Archived-At: I'm not really sure why I've added these anymore. I've added them over time since 2016 first using Spacemacs, then Doom Emacs. >> ;; Windows doesn't set this, but some packages might depend on the var= iable >> (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 That's interesting. I usually just { M-x getenv }, and LANG isn't listed th= ere. (getenv "LANG") returns "ENU" though. Looking at the environment variables = for the process, I see LANG listed there. How is getenv *not* listing the varia= ble? Has it marked it special somehow and filter it out? > 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. Probably something I did after changing Windows to use utf-8, which also includes the clipboard. > 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". Maybe I broke something else when trying to get text to work properly and a= dded that hack as a workaround..? I really have no idea. Don't want to dig throu= gh my git commits to find out ;) > Again, I'm not sure this is relevant to the crashes. But it doesn't > do any harm to make your Emacs configuration healthier ;-) Yes, thanks a lot for the help! I'm a bit scared to remove these hacks I've accumulated over time as I probably added them there for a reason though. B= ut hopefully the workarounds was just for some symptoms and not the root cause= -- we'll see. On Tue, May 14, 2024 at 2:30=E2=80=AFPM Eli Zaretskii wrote: > > > From: Simen Endsj=C3=B8 > > 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=3DENU 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 va= riable > > (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 ;-)