public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/16398] ftell stuck on file opened w+ for writing wide characters
  2014-01-06  9:02 [Bug stdio/16398] New: ftell stuck on file opened w+ for writing wide characters siddhesh at redhat dot com
@ 2014-01-06  9:02 ` siddhesh at redhat dot com
  2014-02-05  7:19 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: siddhesh at redhat dot com @ 2014-01-06  9:02 UTC (permalink / raw)
  To: glibc-bugs

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

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

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


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

* [Bug stdio/16398] New: ftell stuck on file opened w+ for writing wide characters
@ 2014-01-06  9:02 siddhesh at redhat dot com
  2014-01-06  9:02 ` [Bug stdio/16398] " siddhesh at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: siddhesh at redhat dot com @ 2014-01-06  9:02 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16398
           Summary: ftell stuck on file opened w+ for writing wide
                    characters
           Product: glibc
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: siddhesh at redhat dot com
          Reporter: siddhesh at redhat dot com

Created attachment 7338
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7338&action=edit
Reproducer program

ftell gets stuck in an infinite loop when it is called after an fputsw
(obviously for wide characters) and the buffer is not full, but does not have
enough space to convert the current wide character.

How Reproducible:

Always

Steps to Reproduce:

Build and run attached reproducer.

Actual Behaviour:

Infinite loop

Expected behaviour:

Program returns.

Patch coming up.

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


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

* [Bug stdio/16398] ftell stuck on file opened w+ for writing wide characters
  2014-01-06  9:02 [Bug stdio/16398] New: ftell stuck on file opened w+ for writing wide characters siddhesh at redhat dot com
  2014-01-06  9:02 ` [Bug stdio/16398] " siddhesh at redhat dot com
@ 2014-02-05  7:19 ` cvs-commit at gcc dot gnu.org
  2014-02-05  7:20 ` siddhesh at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-02-05  7:19 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  df675f9933c5d5461cea9224ed43beddef1a7b3a (commit)
       via  68159946307adfc95a6e99d1c4af5c3de0c030f9 (commit)
      from  ae2f53e1eb3cd454d833ce9cb3bc78d791a0cb3e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=df675f9933c5d5461cea9224ed43beddef1a7b3a

commit df675f9933c5d5461cea9224ed43beddef1a7b3a
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 12:49:00 2014 +0530

    Fix infinite loop in ftell when writing wide char data (BZ #16398)

    ftell tries to avoid flushing the buffer when it is in write mode by
    converting the wide char data and placing it into the binary buffer.
    If the output buffer space is full and there is data to write, the
    code reverts to flushing the buffer.  This breaks when there is space
    in the buffer but it is not enough to convert the next character in
    the wide data buffer, due to which __codecvt_do_out returns a
    __codecvt_partial status.  In this case, ftell keeps running in an
    infinite loop.

    The fix here is to detect the __codecvt_partial status in addition to
    checking if the buffer is full.  I have also added a test case that
    demonstrates the infinite loop.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=68159946307adfc95a6e99d1c4af5c3de0c030f9

commit 68159946307adfc95a6e99d1c4af5c3de0c030f9
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 12:22:58 2014 +0530

    Update contrib.texi

    This may not be a complete list of new contributors added to the list,
    so I'd love it if more people look at contributions and suggest
    additions.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                      |    6 ++
 libio/Makefile                 |    2 +-
 libio/tst-ftell-partial-wide.c |  107 ++++++++++++++++++++++++++++++++++++++++
 libio/wfileops.c               |   11 +++--
 manual/contrib.texi            |   19 ++++++--
 5 files changed, 136 insertions(+), 9 deletions(-)
 create mode 100644 libio/tst-ftell-partial-wide.c

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


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

* [Bug stdio/16398] ftell stuck on file opened w+ for writing wide characters
  2014-01-06  9:02 [Bug stdio/16398] New: ftell stuck on file opened w+ for writing wide characters siddhesh at redhat dot com
  2014-01-06  9:02 ` [Bug stdio/16398] " siddhesh at redhat dot com
  2014-02-05  7:19 ` cvs-commit at gcc dot gnu.org
@ 2014-02-05  7:20 ` siddhesh at redhat dot com
  2014-02-05 11:23 ` cvs-commit at gcc dot gnu.org
  2014-06-13  9:12 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: siddhesh at redhat dot com @ 2014-02-05  7:20 UTC (permalink / raw)
  To: glibc-bugs

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

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Siddhesh Poyarekar <siddhesh at redhat dot com> ---
Fixed in master.

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


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

* [Bug stdio/16398] ftell stuck on file opened w+ for writing wide characters
  2014-01-06  9:02 [Bug stdio/16398] New: ftell stuck on file opened w+ for writing wide characters siddhesh at redhat dot com
                   ` (2 preceding siblings ...)
  2014-02-05  7:20 ` siddhesh at redhat dot com
@ 2014-02-05 11:23 ` cvs-commit at gcc dot gnu.org
  2014-06-13  9:12 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-02-05 11:23 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, siddhesh/benchmarks has been created
        at  9749af672ed40292e11ceccc4f78e740db4eecfb (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9749af672ed40292e11ceccc4f78e740db4eecfb

commit 9749af672ed40292e11ceccc4f78e740db4eecfb
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 16:49:46 2014 +0530

    Validate bench.out against a JSON schema

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ca3e834f15af830ab6d240f3270f7e1a903ed3f8

commit ca3e834f15af830ab6d240f3270f7e1a903ed3f8
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 15:57:22 2014 +0530

    benchtests: move machine-info.sh into benchtests/scripts/

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=706a60f32d8cf683841ae51693f5e551436c82fc

commit 706a60f32d8cf683841ae51693f5e551436c82fc
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 15:55:10 2014 +0530

    benchtests: Move bench.py to benchtests/scripts/

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6e830a79dfc66f8c9b6ae49c1235ce40e4bc0328

commit 6e830a79dfc66f8c9b6ae49c1235ce40e4bc0328
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 15:50:31 2014 +0530

    benchtests: Mention a constraint on a valid variant name

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9c259cce38ee580737bde71c54aa400bb261342a

commit 9c259cce38ee580737bde71c54aa400bb261342a
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Tue Feb 4 21:31:23 2014 +0530

    Actually do json output

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=909a952c995852c8193dabf306ac2d51d3418fd0

commit 909a952c995852c8193dabf306ac2d51d3418fd0
Author: David Holsgrove <david.holsgrove@xilinx.com>
Date:   Tue Feb 4 09:30:34 2014 +1000

    microblaze: Update libm-test-ulps

    Update libm-test-ulps for microblaze, and remove unneeded copy
    libm-test-ulps_new.

    ports/ChangeLog.microblaze

     2014-02-04  David Holsgrove <david.holsgrove@xilinx.com>

       * sysdeps/microblaze/libm-test-ulps: Update.
       * sysdeps/microblaze/libm-test-ulps_new: Deleted redundant file.

    Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=22af99fa7227e7a60ae1ec792260bf868a8cdd3e

commit 22af99fa7227e7a60ae1ec792260bf868a8cdd3e
Author: David Holsgrove <david.holsgrove@xilinx.com>
Date:   Tue Feb 4 09:26:15 2014 +1000

    microblaze BZ #15705: Define MMAP2_PAGE_SHIFT

    Define MMAP2_PAGE_SHIFT to -1 for microblaze so the correct shift
    for the syscall is determined dynamically using getpagesize

    ports/ChangeLog.microblaze

     2014-02-04  David Holsgrove <david.holsgrove@xilinx.com>

       * sysdeps/unix/sysv/linux/microblaze/mmap64.c: New file.

    Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e4dfbefc63fc67fee2f9a74163dcc0bd0aa66ef

commit 9e4dfbefc63fc67fee2f9a74163dcc0bd0aa66ef
Author: David Holsgrove <david.holsgrove@xilinx.com>
Date:   Tue Feb 4 09:22:42 2014 +1000

    microblaze: Use <fenv.h> fallback functions

    Delete redundant fegetround.c and fesetround.c for microblaze
    and use the fallback functions instead.

    ports/ChangeLog.microblaze

     2014-02-04  David Holsgrove <david.holsgrove@xilinx.com>

        * sysdeps/microblaze/fegetround.c: Delete redundant file.
        * sysdeps/microblaze/fesetround.c: Likewise.

    Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=be6406a872b0e7e142cb326db07fb8e4c795ceb9

commit be6406a872b0e7e142cb326db07fb8e4c795ceb9
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 12:50:22 2014 +0530

    Update NEWS for #16398

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cf015393a0a8e137fef06c3bc18f76c11cff3c6a

commit cf015393a0a8e137fef06c3bc18f76c11cff3c6a
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 12:49:00 2014 +0530

    Fix infinite loop in ftell when writing wide char data (BZ #16398)

    ftell tries to avoid flushing the buffer when it is in write mode by
    converting the wide char data and placing it into the binary buffer.
    If the output buffer space is full and there is data to write, the
    code reverts to flushing the buffer.  This breaks when there is space
    in the buffer but it is not enough to convert the next character in
    the wide data buffer, due to which __codecvt_do_out returns a
    __codecvt_partial status.  In this case, ftell keeps running in an
    infinite loop.

    The fix here is to detect the __codecvt_partial status in addition to
    checking if the buffer is full.  I have also added a test case that
    demonstrates the infinite loop.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3672eb9056332bf1b05a0275f85db70d7fbcfe4c

commit 3672eb9056332bf1b05a0275f85db70d7fbcfe4c
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 12:22:58 2014 +0530

    Update contrib.texi

    This may not be a complete list of new contributors added to the list,
    so I'd love it if more people look at contributions and suggest
    additions.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dc52d4171b01963c36bc80afb2d2e23fc096e0dc

commit dc52d4171b01963c36bc80afb2d2e23fc096e0dc
Author: David S. Miller <davem@davemloft.net>
Date:   Tue Feb 4 20:54:58 2014 -0800

    Adjust sparc ULPs.

        * sysdeps/sparc/fpu/libm-test-ulps: Update for some 64-bit differences
from
        32-bit.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fdda5919e204128906e53ad8619e874ee96f193

commit 2fdda5919e204128906e53ad8619e874ee96f193
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Feb 4 09:49:34 2014 -0200

    PowerPC: powerpc64le abilist for 2.17

    This patch is the abifiles for powerpc64le based on GLIBC 2.17.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=01dcbb8a166c2974c8c34a996a9d1513ea9b1431

commit 01dcbb8a166c2974c8c34a996a9d1513ea9b1431
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Feb 4 09:49:08 2014 -0200

    PowerPC: Change powerpc64le start ABI to 2.17.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b99620786823c57f54c9447af27e1191095386ec

commit b99620786823c57f54c9447af27e1191095386ec
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Feb 4 09:48:47 2014 -0200

    abilist-pattern configurability

    This patch creates implicit rules to match the abifiles if
    abilist-pattern is defined in the architecture Makefile. This allows
    machine specific Makefiles to define different abifiles names
    (for instance *-le.abilist for powerpc64le).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=13674005345deeac71debaa994fe89cecf6cdb2a

commit 13674005345deeac71debaa994fe89cecf6cdb2a
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Feb 3 12:36:15 2014 +0530

    Make bench.out in json format

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1d68d06ad65bca949ddeeacfce1d5be34c05c30b

commit 1d68d06ad65bca949ddeeacfce1d5be34c05c30b
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Jan 17 18:14:57 2014 +0530

    Add machine info

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b7b08b0cafeef894193e8201e4307d776851c6d1

commit b7b08b0cafeef894193e8201e4307d776851c6d1
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Jan 16 15:09:10 2014 +0530

    Remove bench-modf.c

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=12387852c7e6d76c7f109366f5e94040d0330175

commit 12387852c7e6d76c7f109366f5e94040d0330175
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Jan 15 12:48:09 2014 +0530

    Detailed benchmark numbers

    Store timings per input.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5f2f18db8382f26580b23004e6f2f87b9b80318b

commit 5f2f18db8382f26580b23004e6f2f87b9b80318b
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Dec 6 13:51:09 2013 +0530

    Implement benchmarking script in python

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f7f684602ff498d9f81e07c5fe37338c8a806a81

commit f7f684602ff498d9f81e07c5fe37338c8a806a81
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Tue Oct 8 16:36:19 2013 +0530

    TMP: probes for math functions

    Temporary probes at various branch points in the functions.

-----------------------------------------------------------------------

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


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

* [Bug stdio/16398] ftell stuck on file opened w+ for writing wide characters
  2014-01-06  9:02 [Bug stdio/16398] New: ftell stuck on file opened w+ for writing wide characters siddhesh at redhat dot com
                   ` (3 preceding siblings ...)
  2014-02-05 11:23 ` cvs-commit at gcc dot gnu.org
@ 2014-06-13  9:12 ` fweimer at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13  9:12 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

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


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

end of thread, other threads:[~2014-06-13  9:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-06  9:02 [Bug stdio/16398] New: ftell stuck on file opened w+ for writing wide characters siddhesh at redhat dot com
2014-01-06  9:02 ` [Bug stdio/16398] " siddhesh at redhat dot com
2014-02-05  7:19 ` cvs-commit at gcc dot gnu.org
2014-02-05  7:20 ` siddhesh at redhat dot com
2014-02-05 11:23 ` cvs-commit at gcc dot gnu.org
2014-06-13  9:12 ` 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).