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


View this message in rfc822 format

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: bug#75569: 30.0.93; Large /proc/* file are read incompletely
Date: Wed, 15 Jan 2025 22:58:31 -0800
On 2025-01-15 22:18, Eli Zaretskii wrote:

> So you are saying that the condition should be
> 
>     if ((regular && st.st_size > 0) || seekable || !NILP (end))

regular implies seekable, so that doesn't look right either. I was 
thinking that rather than replace "seekable" with "(seekable && st.size 
> 0)" or with "(regular && st.st_size > 0) || seekable", one should 
replace "seekable" with "(regular && st.st_size > 0)".


> AFAIU, the additional conditions are not needed for these two uses,
> because:
> 
>    . 'total' is already computed correctly at that point for the
>      regular zero-size files
>    . only non-regular files can be !seekable
> 
> Or am I missing something?

You've looked it more carefully than I. All I was thinking is that if 
'total' was guessed to be READ_BUF_SIZE earlier, it's still a guess here.

Anyway, I suppose it doesn't matter much, as 'total' is a guess 
regardless of how it's computed. Even a regular file with nonzero size 
can change size before we read it.

There's another thing. On some platforms these /proc regular files have 
nonzero size. On at least one of these platforms (Solaris) the size is 
accurate (though it may change at any time); on others, I vaguely recall 
that it's a small nonzero fixed size (I don't remember which systems do 
that, unfortunately).





This bug report was last modified 163 days ago.

Previous Next


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