GNU bug report logs - #75569
30.0.93; Large /proc/* file are read incompletely

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Wed, 15 Jan 2025 00:22:01 UTC

Severity: normal

Found in version 30.0.93

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 75569 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mail <at> daniel-mendler.de, 75569 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#75569: 30.0.93; Large /proc/* file are read incompletely
Date: Thu, 16 Jan 2025 12:51:11 -0800
On 2025-01-16 00:55, Eli Zaretskii wrote:

> Then how about
> 
>    if ((regular && st.st_size > 0) || (!regular && seekable) || !NILP (end))

That should work too but I expect we're overthinking it; see bellow.


> That would exclude non-regular files that are seekable, which would be
> a regression, I think.

I expect it's a bugfix not a regression. For such files, end_offset
is TYPE_MAXIUMUM (off_t), which Emacs will try to create an enormous buffer.


> If the size is non-zero and
> inaccurate, do we currently support that, e.g., if the file grows
> while we read it?

That's the crux of the bug. If we don't support that, the code is 
unreliable pretty much everywhere, not just in /proc. If we fix that, 
the /proc problem goes away.

In other words, when reading a file Emacs should treat st_size as merely 
a heuristic, not as authoritative.




This bug report was last modified 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.