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#57129: 29.0.50; Improve behavior of conditionals in Eshell Date: Tue, 16 Aug 2022 20:04:49 +0300 Message-ID: <83sflwdsr2.fsf__49242.5286139891$1660669578$gmane$org@gnu.org> References: <1871347.6tgchFWduM@nimes> <838rnofgad.fsf@gnu.org> <4165399.mogB4TqSGs@nimes> <83wnb8dukz.fsf@gnu.org> <206e38df-2db4-a46a-e0ff-952bc8ab939c@cs.ucla.edu> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5764"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, larsi@gnus.org, bug-gnulib@gnu.org, 57129@debbugs.gnu.org, bruno@clisp.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 16 19:06:10 2022 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 1oO013-0001HG-TU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 19:06:10 +0200 Original-Received: from localhost ([::1]:60202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oO012-0001K0-FF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 13:06:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oO00w-0001Jl-B7 for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 13:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oO00w-0006ar-2B for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 13:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oO00v-0001Hi-Tn for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 13:06:01 -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, 16 Aug 2022 17:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57129 X-GNU-PR-Package: emacs Original-Received: via spool by 57129-submit@debbugs.gnu.org id=B57129.16606695114874 (code B ref 57129); Tue, 16 Aug 2022 17:06:01 +0000 Original-Received: (at 57129) by debbugs.gnu.org; 16 Aug 2022 17:05:11 +0000 Original-Received: from localhost ([127.0.0.1]:48167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oO006-0001GY-QF for submit@debbugs.gnu.org; Tue, 16 Aug 2022 13:05:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oO004-0001GI-OQ for 57129@debbugs.gnu.org; Tue, 16 Aug 2022 13:05:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNzzy-0006FD-Ge; Tue, 16 Aug 2022 13:05:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0K+5E/MZjkx6L76pLY1tsyafXk2V0HKi+RD5SuC7Gj4=; b=nfcXL2uAWrzR XcYUa6Y4hrXssGfeWCClD6+dbDlo/qI/3nIw2FXyD9ZI1DdM8aikNf/5k9Ez7cPNrYj9B8CPNFa7Q Swb3b2pIXcvXc1OywzJWXEobS8ugI24uaBeqbFG/7exUt5soR9h+zXshUfqLwRTq2l7Bt93YJ97MM piDZc95xx2UHWMa0w83sBwoH1ltLn1ZdXvD7Y6lwEeuszj9b0JW4WqFI44/ZFw/R4E+Uwhyo084dA zep8xNaB0z0Nl2wwhGPyu3SA7un6b9zDhw8ltLlaYdbs+18BroC0Pt3FWvDNbDhA8mpNsh9/4bYfu C5YgzUFr2PJmBVqMe8UAhA==; Original-Received: from [87.69.77.57] (port=3989 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNzzx-0006Xh-QA; Tue, 16 Aug 2022 13:05:02 -0400 In-Reply-To: <206e38df-2db4-a46a-e0ff-952bc8ab939c@cs.ucla.edu> (message from Paul Eggert on Tue, 16 Aug 2022 09:54:25 -0700) 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" Xref: news.gmane.io gmane.emacs.bugs:239975 Archived-At: > Date: Tue, 16 Aug 2022 09:54:25 -0700 > Cc: bug-gnulib@gnu.org, larsi@gnus.org, 57129@debbugs.gnu.org, > jporterbugs@gmail.com, Bruno Haible > From: Paul Eggert > > On 8/16/22 09:25, Eli Zaretskii wrote: > > The programmer didn't > > expect that because it is natural to expect each call to a function > > that creates a temporary file to create a file under a new name, not > > reuse the same name. > > Regardless of whether the programmer expects a random name or a > predictable-but-unique name, there are only a finite number of names to > choose from so the programmer must take into account the possibility > that the chosen name clashes with names that the programmer would prefer > not to be chosen. Then what is this comment and the following assertion in Bruno's code about? /* With 6 'X' and a good pseudo-random number generator behind the scenes, the probability of getting the same file name twice in a row should be 1/62^6 < 1/10^10. */ ASSERT (strcmp (filename1, filename2) != 0); That "finite number" of 62^6 sounds pretty close to infinity to me! > This means an Emacs patch such as [1] is needed regardless of whether > Gnulib's gen_tempname is changed to be more random than it is. Although > it's true that the bug fixed by [1] is less likely if gen_tempname > generates more-random names, the bug can occur no matter what we do > about gen_tempname. No, sorry. I object to this patch, because it hides the problem under the carpet. That there's a file-visiting buffer that records the name of a temporary file is just one case where this issue gets in the way. The general problem is still there. And it isn't an Emacs problem, so Emacs is not the place to solve it. Therefore, if there's no intention to fix this in Gnulib, I'm going to update the documentation of make-temp-file so that Emacs users and programmers will be informed about that and will be careful enough to side-step these issues in all the situations. (Not that I understand why won't Gnulib provide consistent behavior on all platforms, but I guess it's above my pay grade.)