public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
@ 2011-10-27  2:08 ` bugdal at aerifal dot cx
  2011-10-27  2:08 ` bugdal at aerifal dot cx
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: bugdal at aerifal dot cx @ 2011-10-27  2:08 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

--- Comment #7 from Rich Felker <bugdal at aerifal dot cx> 2011-10-27 02:08:30 UTC ---
Created attachment 6036
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6036
Tiny test-case showing the bug.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
  2011-10-27  2:08 ` [Bug libc/1190] fgetc()/fread() behaviour is not POSIX compliant bugdal at aerifal dot cx
@ 2011-10-27  2:08 ` bugdal at aerifal dot cx
  2011-11-04 18:31 ` gotom at debian dot or.jp
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: bugdal at aerifal dot cx @ 2011-10-27  2:08 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |bugdal at aerifal dot cx
         Resolution|WORKSFORME                  |

--- Comment #6 from Rich Felker <bugdal at aerifal dot cx> 2011-10-27 02:07:43 UTC ---
This bug still exists; I'm reopening it and adding a new attachment that
demonstrates it trivially. Actually I wrote this test-case a while back as a
demonstration of one of the very few safe uses of gets(), which happened to
become unsafe due to the bug in glibc.

To see the bug, run the program (stdio_eof.c) and press ^D (or whatever your
EOF key on the terminal is). The program should exit, but under glibc, the
gets() call waits for a line of input and prints it back before exiting.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libc/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
  2011-10-27  2:08 ` [Bug libc/1190] fgetc()/fread() behaviour is not POSIX compliant bugdal at aerifal dot cx
  2011-10-27  2:08 ` bugdal at aerifal dot cx
@ 2011-11-04 18:31 ` gotom at debian dot or.jp
  2012-02-21  1:33 ` [Bug stdio/1190] " jsm28 at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: gotom at debian dot or.jp @ 2011-11-04 18:31 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

GOTO Masanori <gotom at debian dot or.jp> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gotom at debian dot or.jp
         AssignedTo|gotom at debian dot or.jp   |drepper.fsp at gmail dot
                   |                            |com

--- Comment #8 from GOTO Masanori <gotom at debian dot or.jp> 2011-11-04 18:31:35 UTC ---
It looks like "end-of-file" condition is cleared when gets() called (which
should be preserved according to the standard), like:

#include <stdio.h>
int main(void) {
  char buf[100];
  gets(buf);  // We need to type ^D
  gets(buf);  // We need to type ^D but the stream already received ^D
(end-of-file condition)
}

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-11-04 18:31 ` gotom at debian dot or.jp
@ 2012-02-21  1:33 ` jsm28 at gcc dot gnu.org
  2012-02-21  2:01 ` funtoos at yahoo dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-21  1:33 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |stdio

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-02-21  1:33 ` [Bug stdio/1190] " jsm28 at gcc dot gnu.org
@ 2012-02-21  2:01 ` funtoos at yahoo dot com
  2012-03-17 20:34 ` bugdal at aerifal dot cx
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: funtoos at yahoo dot com @ 2012-02-21  2:01 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

--- Comment #9 from Sunil <funtoos at yahoo dot com> 2012-02-21 01:41:06 UTC ---
Can't believe its almost 7 yrs since I opened this bug. And it still
exists...:)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2012-02-21  2:01 ` funtoos at yahoo dot com
@ 2012-03-17 20:34 ` bugdal at aerifal dot cx
  2012-03-18 14:23 ` jsm28 at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: bugdal at aerifal dot cx @ 2012-03-17 20:34 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

--- Comment #10 from Rich Felker <bugdal at aerifal dot cx> 2012-03-17 20:34:20 UTC ---
Ping. Now that there's a new willingness to fix longstanding glibc bugs, please
examine this report again.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2012-03-17 20:34 ` bugdal at aerifal dot cx
@ 2012-03-18 14:23 ` jsm28 at gcc dot gnu.org
  2012-09-13 13:33 ` siddhesh at redhat dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-03-18 14:23 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper.fsp at gmail dot    |unassigned at sourceware
                   |com                         |dot org

--- Comment #11 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-03-18 14:20:03 UTC ---
This report appears to be correct and still present in current sources (tested
x86_64).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2012-03-18 14:23 ` jsm28 at gcc dot gnu.org
@ 2012-09-13 13:33 ` siddhesh at redhat dot com
  2012-09-13 13:52 ` siddhesh at redhat dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: siddhesh at redhat dot com @ 2012-09-13 13:33 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |ASSIGNED
                 CC|                            |siddhesh at redhat dot com
         AssignedTo|unassigned at sourceware    |siddhesh at redhat dot com
                   |dot org                     |

--- Comment #12 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2012-09-13 13:32:49 UTC ---
I'll take a crack at this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2012-09-13 13:33 ` siddhesh at redhat dot com
@ 2012-09-13 13:52 ` siddhesh at redhat dot com
  2012-09-13 14:15 ` siddhesh at redhat dot com
  2022-09-23  5:25 ` fweimer at redhat dot com
  10 siblings, 0 replies; 11+ messages in thread
From: siddhesh at redhat dot com @ 2012-09-13 13:52 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

--- Comment #13 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2012-09-13 13:52:06 UTC ---
The change is quite simple, but a comment in fileops.c says that this behaviour
is retained for sysv compatibility:

...
int
_IO_new_file_underflow (fp)
     _IO_FILE *fp;
{
  _IO_ssize_t count;
#if 0
  /* SysV does not make this test; take it out for compatibility */
  if (fp->_flags & _IO_EOF_SEEN)
    return (EOF);
#endif

...

I'm not sure if this is valid anymore, so I'll try to find out what the current
status is, unless someone here already knows the answer.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2012-09-13 13:52 ` siddhesh at redhat dot com
@ 2012-09-13 14:15 ` siddhesh at redhat dot com
  2022-09-23  5:25 ` fweimer at redhat dot com
  10 siblings, 0 replies; 11+ messages in thread
From: siddhesh at redhat dot com @ 2012-09-13 14:15 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=1190

--- Comment #14 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2012-09-13 14:14:36 UTC ---
The discussion can be followed (and contributed to) here:

http://sourceware.org/ml/libc-alpha/2012-09/msg00343.html

I am currently of the opinion that this change may break a lot of existing
programs and hence this fix may not be a good idea.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug stdio/1190] fgetc()/fread() behaviour is not POSIX compliant
       [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2012-09-13 14:15 ` siddhesh at redhat dot com
@ 2022-09-23  5:25 ` fweimer at redhat dot com
  10 siblings, 0 replies; 11+ messages in thread
From: fweimer at redhat dot com @ 2022-09-23  5:25 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=1190

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=29601

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-09-23  5:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-1190-131@http.sourceware.org/bugzilla/>
2011-10-27  2:08 ` [Bug libc/1190] fgetc()/fread() behaviour is not POSIX compliant bugdal at aerifal dot cx
2011-10-27  2:08 ` bugdal at aerifal dot cx
2011-11-04 18:31 ` gotom at debian dot or.jp
2012-02-21  1:33 ` [Bug stdio/1190] " jsm28 at gcc dot gnu.org
2012-02-21  2:01 ` funtoos at yahoo dot com
2012-03-17 20:34 ` bugdal at aerifal dot cx
2012-03-18 14:23 ` jsm28 at gcc dot gnu.org
2012-09-13 13:33 ` siddhesh at redhat dot com
2012-09-13 13:52 ` siddhesh at redhat dot com
2012-09-13 14:15 ` siddhesh at redhat dot com
2022-09-23  5:25 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).