bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff-2.7.7 crashes on /proc/<pid>/maps


From: Alexander Viro
Subject: Re: diff-2.7.7 crashes on /proc/<pid>/maps
Date: Wed, 30 Jan 2002 19:28:02 -0500 (EST)

On Wed, 30 Jan 2002, Bruno Haible wrote:

> 
> On Linux, /proc/<pid>/maps is somewhat special. stat() says that it's a
> regular file of size 0, yet its contents is so large that it easily
> overflows the buffer GNU diff prepares for storing its contents. (See
> sample appended below).
> 
> Question: Is the kernel right in offering data of unknown size in the form
> of a regular file? I had set the mode of /proc/<pid>/maps to pr--r--r--
> some years ago, but since then some fellow hacker has removed the 'p'ipe flag.

You can lseek on it, reads are non-blocking, etc.  Doesn't look like a named
pipe semantics for me...
 
> Question: Is GNU diff right in assuming that the file contains no more
> bytes than its size says? Any regular file could grow while diff is
> running. After all, this situation is the entire purpose of "tail -f".

No, it isn't.  Looks like you've found a buffer overrun in diff(1) - happy,
happy, joy, joy...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]