From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#68546: 29.1.90; end-of-file has incorrect data when signaled within a load Date: Thu, 25 Jan 2024 09:05:19 -0500 Message-ID: References: <797f3211-068f-4b7f-bb34-f3c9ee12241b@gutov.dev> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000d10a2060fc5ac8d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32481"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68546@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 25 15:06:13 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 1rT0Mu-0008Bm-OK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Jan 2024 15:06:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT0Mi-0005Li-KH; Thu, 25 Jan 2024 09:06:00 -0500 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 1rT0Mg-0005LJ-8K for bug-gnu-emacs@gnu.org; Thu, 25 Jan 2024 09:05:58 -0500 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 1rT0Me-0000bR-KG for bug-gnu-emacs@gnu.org; Thu, 25 Jan 2024 09:05:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rT0Mj-0000yB-SX for bug-gnu-emacs@gnu.org; Thu, 25 Jan 2024 09:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jan 2024 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68546 X-GNU-PR-Package: emacs Original-Received: via spool by 68546-submit@debbugs.gnu.org id=B68546.17061915463707 (code B ref 68546); Thu, 25 Jan 2024 14:06:01 +0000 Original-Received: (at 68546) by debbugs.gnu.org; 25 Jan 2024 14:05:46 +0000 Original-Received: from localhost ([127.0.0.1]:47668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT0MT-0000xi-TF for submit@debbugs.gnu.org; Thu, 25 Jan 2024 09:05:46 -0500 Original-Received: from mxout1.mail.janestreet.com ([38.105.200.78]:41481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT0MQ-0000xU-Vq for 68546@debbugs.gnu.org; Thu, 25 Jan 2024 09:05:43 -0500 Original-Received: from mail-ej1-f70.google.com ([209.85.218.70]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.97.1) id 1rT0MG-0000000BMWW-2uLw for 68546@debbugs.gnu.org; Thu, 25 Jan 2024 09:05:31 -0500 Original-Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a330b31c1fcso9804066b.2 for <68546@debbugs.gnu.org>; Thu, 25 Jan 2024 06:05:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1706191530; x=1706796330; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0NrVEeeRZWfe3TQDNYncKn1J9oYvgeAkeZy/V/kNSTU=; b=sF9xRbuRtpXmSiYOrozNVMs7vqAFy4btoSWRNmuJOAE8xvdOgKZNaR6OgzvlIh8jwo hdbHYcwK5KTJTKoSnW4o0dcous6pdTpNvxMyuE0lZi3Ri30Jktrrhjdp75zPsfbeCST0 lli68che50LUFD0WpH/1+sf7V6rdyzRy1uNcY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1706191531; bh=0NrVEeeRZWfe3TQDNYncKn1J9oYvgeAkeZy/V/kNSTU=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=V+QeY/sI6BW70TjxfIlP96i3qmXLe8HpSRyncBbGtlodac8NT3+7xNIWzFsxxOq3i d7uObhEik8HWBTqTW5011lkVfJsYYlpN4XqTUOLMt6+ghwAOr4fdIOGmDGGQsBgvGA IWpyPhBDX8Dvh6VjxCh03uVLUeMw2U/ZD4k4ZNXnY9pLZtsqrRllclT4rY3xCr1myT AcfvQaA4NN2gzA8CObazp82GGuXtwfa0jmZjNxYRUaAS759nhFv40HwpNJIK6d+EDW bVJlUe+ZPipPqzatHGAdOsIuzEqcXin0jkD7cgyMUgPi4r6v18bioQrQVqCze4597G mXOqC/YW5FNTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706191530; x=1706796330; h=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=0NrVEeeRZWfe3TQDNYncKn1J9oYvgeAkeZy/V/kNSTU=; b=no05DsOn2CvkeHEuBHjoqATgUJZROBZNwvgPRWKzdd3Mi+GkCh7/LgX1C9du8kBOY0 9V635yyVQt/37133fNvfr7C7RMUhE02jVxnNQECI25VPFZjOITQK+QSJrUjBLTo58Ux5 FYzpfejZ86YEmTH3i7M8PVQ4nm09x3hmKXXTn+/daD1oqZR9JBvR4EYmGE8r3+A2ahkG j8mQ0kzeFi3OF/iNUhexcgfOV0iHRDsK/2Evqo67jwkYUHHJEHyu+fUDTmsLF0qnduft x8FWATiAecEfO9SXjzZGtGOvgYdOe6vQzYcb/67D4IvadnxWUcfq4Y6n6XvI8Eu+gwhL ddAg== X-Gm-Message-State: AOJu0YxiZHtX4OVQ/QFCzv6EBW+TpFa7qo1ziya4h5x1Ivk6JmH4f7Tl oY3Vy2g+Xvd15S78xra8LeZPM/TYF4+I+aw+2tFLlcG8sIQ0ji6SnhbkFz0ApBrZP40j4JpT5zM 0Odipc09HYqCR0No4gjiwag9NhpTFJ1mIVoDb8GPlBXivYemf7AY1OEU7XGTEPFXARwS7YG9NUr mXEKwPyxhMyyy+fWQZaDv+jYVib2mlcBBTHQ== X-Received: by 2002:a17:907:6e92:b0:a31:4108:9707 with SMTP id sh18-20020a1709076e9200b00a3141089707mr644824ejc.13.1706191530115; Thu, 25 Jan 2024 06:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqtE1Arp3jQsDZvuQS0kr+MdzevzAHINBc5gXneM1RZlk+SOUDbHQHAzYURe0qav1icrgWBt5iX+/NNHKAPOk= X-Received: by 2002:a17:907:6e92:b0:a31:4108:9707 with SMTP id sh18-20020a1709076e9200b00a3141089707mr644814ejc.13.1706191529769; Thu, 25 Jan 2024 06:05:29 -0800 (PST) In-Reply-To: <797f3211-068f-4b7f-bb34-f3c9ee12241b@gutov.dev> 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:278851 Archived-At: --0000000000000d10a2060fc5ac8d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 17, 2024 at 3:55=E2=80=AFPM Dmitry Gutov wro= te: > On 17/01/2024 21:04, Spencer Baugh wrote: > > As one particular example of the confusing current behavior, a user had > > corrupted their ~/.emacs.d/projects so that reading it failed. Also, > > they had a call to (project-forget-zombie-projects) in their init.el. > > In combination, this meant Emacs startup errored with: > > > > End of file during parsing:/home/user/.emacs.d/init.el > > > > even though there was no syntax error in init.el at all. > > Would something like this help with this particular sub-problem? > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index a6f14a0865c..196a82757b2 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -1694,7 +1694,9 @@ project--read-project-list > (let ((name (car elem))) > (list (if (file-remote-p name) name > (abbreviate-file-name name))))) > - (read (current-buffer)))))) > + (condition-case nil > + (read (current-buffer)) > + (end-of-file (warn "Failed to read the projects list > file"))))))) > (unless (seq-every-p > (lambda (elt) (stringp (car-safe elt))) > project--list) > > Yes, I think that would be great. Especially because this allows startup to continue. If it's okay with you too, I think it's reasonable to push. This de-facto resets the contents of the projects list file (since the corrupted version will get saved over), but I think that's fine - it's not especially hard information to rebuild, and if it's corrupt anyway then it's probably already at least partially lost (in my case, a user had an empty projects file for some reason, not sure why). Oh and I guess we already reset the contents if it's in the wrong format. So yeah, this seems great. --0000000000000d10a2060fc5ac8d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jan 17, 2024 at 3:55=E2=80=AFPM Dmitr= y Gutov <dmitry@gutov.dev> wr= ote:
On 17/01/20= 24 21:04, Spencer Baugh wrote:
> As one particular example of the confusing current behavior, a user ha= d
> corrupted their ~/.emacs.d/projects so that reading it failed.=C2=A0 A= lso,
> they had a call to (project-forget-zombie-projects) in their init.el.<= br> > In combination, this meant Emacs startup errored with:
>
> End of file during parsing:/home/user/.emacs.d/init.el
>
> even though there was no syntax error in init.el at all.

Would something like this help with this particular sub-problem?

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index a6f14a0865c..196a82757b2 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1694,7 +1694,9 @@ project--read-project-list
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let (= (name (car elem)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(list (if (file-remote-p name) name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(abbreviate-file-name name)))))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(read (current-buff= er))))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(condition-case nil=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(read= (current-buffer))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end-of-file= (warn "Failed to read the projects list
file")))))))
=C2=A0 =C2=A0 =C2=A0 (unless (seq-every-p
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (elt) (strin= gp (car-safe elt)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0project--list)


Yes, I think that would be great.=C2= =A0 Especially because this allows startup to continue.=C2=A0 If it's o= kay with you too, I think it's reasonable to push.

=
This de-facto resets the contents of the projects list file (since the= corrupted version will get saved over), but I think=C2=A0that's fine -= =C2=A0 it's not especially hard information to rebuild, and if it's= corrupt anyway then it's probably already at least partially lost (in = my case, a user had an empty projects file for some reason, not sure why).= =C2=A0 Oh and I guess we already reset the contents if it's in the wron= g format.=C2=A0 So yeah, this seems great.
--0000000000000d10a2060fc5ac8d--