From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#9800: Incomplete truncated file buffers from the /proc filesystem Date: Sun, 12 Feb 2023 17:24:51 +0800 Message-ID: <25D00A5A-372F-47BA-AFC0-AE1529ED178D@netyu.xyz> References: <838rh3ib9i.fsf@gnu.org> Reply-To: Ruijie Yu Mime-Version: 1.0 (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="30043"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@jurta.org, Paul Eggert , Andreas Schwab , 9800@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 12 10:26:18 2023 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 1pR8ck-0007Rd-MV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Feb 2023 10:26:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pR8cV-0006N5-4B; Sun, 12 Feb 2023 04:26:03 -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 1pR8cU-0006Mu-3F for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 04:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pR8cT-0004I5-Qi for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 04:26:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pR8cT-0000mS-JS for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 04:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 09:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9800 X-GNU-PR-Package: emacs Original-Received: via spool by 9800-submit@debbugs.gnu.org id=B9800.16761939392969 (code B ref 9800); Sun, 12 Feb 2023 09:26:01 +0000 Original-Received: (at 9800) by debbugs.gnu.org; 12 Feb 2023 09:25:39 +0000 Original-Received: from localhost ([127.0.0.1]:44065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR8c6-0000ln-TC for submit@debbugs.gnu.org; Sun, 12 Feb 2023 04:25:39 -0500 Original-Received: from netyu.xyz ([152.44.41.246]:48932 helo=mail.netyu.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR8c2-0000lc-Bv for 9800@debbugs.gnu.org; Sun, 12 Feb 2023 04:25:36 -0500 Original-Received: from smtpclient.apple ( [112.97.63.218]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 6c3501f4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 12 Feb 2023 09:25:33 +0000 (UTC) In-Reply-To: <838rh3ib9i.fsf@gnu.org> X-Mailer: iPhone Mail (20D47) 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:255391 Archived-At: There is /proc/config.gz which does report a size, contrary to other files w= hich report a size of 0.=20 > On Feb 12, 2023, at 15:41, Eli Zaretskii wrote: >=20 > =EF=BB=BF >>=20 >> From: Andreas Schwab >> Date: Thu, 20 Oct 2011 10:44:57 +0200 >> Cc: Juri Linkov , 9800@debbugs.gnu.org >>=20 >> Eli Zaretskii writes: >>=20 >>> Does lseek work on these files? >>=20 >> No. The contents are completely dynamic, generated on-the-fly when >> reading. >>=20 >>> Or we could treat those files as non-regular, >>=20 >> That is the only option. >=20 > Are all the files in "/proc" of this nature? If so, we could consider > all of the files in that directory non-regular; if that is all that's > needed to visit /proc/foo files, insert-file-contents already has code > to deal with non-regular files. >=20 > Paul, do you see any downsides to such heuristic? We could make it a > user option if the heuristic could sometimes backfire, I guess. Best, RY=