public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/16734] New: fopen calls mmap to allocate its buffer
@ 2014-03-21 11:27 dancol at dancol dot org
  2014-06-13  9:18 ` [Bug stdio/16734] " fweimer at redhat dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dancol at dancol dot org @ 2014-03-21 11:27 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16734
           Summary: fopen calls mmap to allocate its buffer
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: dancol at dancol dot org

ALLOC_BUF in libioP.h unconditionally opens IO streams using mmap. That's silly
and quite inefficient, especially for Emacs, which (via GTK) ends up calling
mmap several times per user interaction.

The message linked below summarizes the problems with the mmap approach and
proposes a patch for using the standard allocator. Can we please revisit this
issue?

https://sourceware.org/ml/libc-alpha/2006-11/msg00061.html

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
@ 2014-06-13  9:18 ` fweimer at redhat dot com
  2015-02-14 22:55 ` ppluzhnikov at google dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13  9:18 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
  2014-06-13  9:18 ` [Bug stdio/16734] " fweimer at redhat dot com
@ 2015-02-14 22:55 ` ppluzhnikov at google dot com
  2015-02-19 20:49 ` crrodriguez at opensuse dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2015-02-14 22:55 UTC (permalink / raw)
  To: glibc-bugs

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

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppluzhnikov at google dot com
           Assignee|unassigned at sourceware dot org   |ppluzhnikov at google dot com

--- Comment #1 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
Discussion: https://sourceware.org/ml/libc-alpha/2015-02/msg00010.html
I think the consensus has been reached.

I'll send a patch shortly.

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
  2014-06-13  9:18 ` [Bug stdio/16734] " fweimer at redhat dot com
  2015-02-14 22:55 ` ppluzhnikov at google dot com
@ 2015-02-19 20:49 ` crrodriguez at opensuse dot org
  2015-03-08 16:50 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: crrodriguez at opensuse dot org @ 2015-02-19 20:49 UTC (permalink / raw)
  To: glibc-bugs

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

Cristian Rodríguez <crrodriguez at opensuse dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crrodriguez at opensuse dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.
>From glibc-bugs-return-27523-listarch-glibc-bugs=sources.redhat.com@sourceware.org Fri Feb 20 09:21:03 2015
Return-Path: <glibc-bugs-return-27523-listarch-glibc-bugs=sources.redhat.com@sourceware.org>
Delivered-To: listarch-glibc-bugs@sources.redhat.com
Received: (qmail 15247 invoked by alias); 20 Feb 2015 09:21:02 -0000
Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <glibc-bugs.sourceware.org>
List-Subscribe: <mailto:glibc-bugs-subscribe@sourceware.org>
List-Post: <mailto:glibc-bugs@sourceware.org>
List-Help: <mailto:glibc-bugs-help@sourceware.org>, <http://sourceware.org/lists.html#faqs>
Sender: glibc-bugs-owner@sourceware.org
Delivered-To: mailing list glibc-bugs@sourceware.org
Received: (qmail 15143 invoked by uid 48); 20 Feb 2015 09:20:58 -0000
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug stdio/17829] Incorrect handling of precision specifier in printf family
Date: Fri, 20 Feb 2015 09:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: glibc
X-Bugzilla-Component: stdio
X-Bugzilla-Version: 2.19
X-Bugzilla-Keywords:
X-Bugzilla-Severity: critical
X-Bugzilla-Who: fweimer at redhat dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at sourceware dot org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags: security-
X-Bugzilla-Changed-Fields: flagtypes.name
Message-ID: <bug-17829-131-l4o8eqWIAn@http.sourceware.org/bugzilla/>
In-Reply-To: <bug-17829-131@http.sourceware.org/bugzilla/>
References: <bug-17829-131@http.sourceware.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://sourceware.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-02/txt/msg00258.txt.bz2
Content-length: 991

https://sourceware.org/bugzilla/show_bug.cgi?id\x17829

Florian Weimer <fweimer at redhat dot com> changed:

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

--- Comment #4 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to nfxjfg from comment #3)
> >Certainly, this use is not recommended because printf will allocate tons of memory as part of the format processing.
>
> There's literally no reason why it'd need to allocate memory of the size of
> the maximum _possible_ length of the string. In fact, I'd argue printf
> doesn't need to do unbounded memory allocations at all.

But it's what the code does today.  It could be implemented differently, sure,
but until someone writes the code, submits it, and gets it through review, it's
how things are.

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
                   ` (2 preceding siblings ...)
  2015-02-19 20:49 ` crrodriguez at opensuse dot org
@ 2015-03-08 16:50 ` cvs-commit at gcc dot gnu.org
  2015-06-06  9:43 ` neleai at seznam dot cz
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-08 16:50 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 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  18d26750dd8fd328a78cf639fd0ec2494680a2a4 (commit)
      from  9f95dc5d227c5a155d39208dfd15aacaa509b59b (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=18d26750dd8fd328a78cf639fd0ec2494680a2a4

commit 18d26750dd8fd328a78cf639fd0ec2494680a2a4
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Sun Mar 8 09:46:53 2015 -0700

    Cleanup: in preparation for fixing BZ #16734, fix memory leaks exposed by
    switching fopen()ed streams from mmap to malloc.

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

Summary of changes:
 ChangeLog      |    7 +++++++
 libio/genops.c |   12 +++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
                   ` (3 preceding siblings ...)
  2015-03-08 16:50 ` cvs-commit at gcc dot gnu.org
@ 2015-06-06  9:43 ` neleai at seznam dot cz
  2015-06-07  2:27 ` ppluzhnikov at google dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: neleai at seznam dot cz @ 2015-06-06  9:43 UTC (permalink / raw)
  To: glibc-bugs

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

Ondrej Bilka <neleai at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |neleai at seznam dot cz
         Resolution|---                         |FIXED

--- Comment #3 from Ondrej Bilka <neleai at seznam dot cz> ---
closing as its already commited.

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
                   ` (4 preceding siblings ...)
  2015-06-06  9:43 ` neleai at seznam dot cz
@ 2015-06-07  2:27 ` ppluzhnikov at google dot com
  2015-08-13  1:57 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2015-06-07  2:27 UTC (permalink / raw)
  To: glibc-bugs

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

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

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

--- Comment #4 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
What's committed are partial fixes to test cases.

There is one more test case that needs to be fixed,
and *then* a change from mmap to malloc can be made.

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
                   ` (5 preceding siblings ...)
  2015-06-07  2:27 ` ppluzhnikov at google dot com
@ 2015-08-13  1:57 ` cvs-commit at gcc dot gnu.org
  2015-08-13  2:00 ` ppluzhnikov at google dot com
  2015-10-29 16:28 ` jsm28 at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-13  1:57 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 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  8a29509dd9aa179bfe4ef96d49d72f6816ec878f (commit)
      from  84895dca70f972df3842fb88f7b33b5d695cc599 (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=8a29509dd9aa179bfe4ef96d49d72f6816ec878f

commit 8a29509dd9aa179bfe4ef96d49d72f6816ec878f
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Wed Aug 12 18:56:08 2015 -0700

    Fix BZ #16734 -- fopen calls mmap to allocate its buffer

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

Summary of changes:
 ChangeLog            |   15 +++++++++++++++
 NEWS                 |    4 ++--
 libio/filedoalloc.c  |    4 +++-
 libio/genops.c       |   12 +++++++-----
 libio/libio.h        |    3 +--
 libio/libioP.h       |   40 ----------------------------------------
 libio/wfiledoalloc.c |    4 +++-
 libio/wgenops.c      |    9 +++++----
 8 files changed, 36 insertions(+), 55 deletions(-)

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
                   ` (6 preceding siblings ...)
  2015-08-13  1:57 ` cvs-commit at gcc dot gnu.org
@ 2015-08-13  2:00 ` ppluzhnikov at google dot com
  2015-10-29 16:28 ` jsm28 at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2015-08-13  2:00 UTC (permalink / raw)
  To: glibc-bugs

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

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

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

--- Comment #7 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
And fixed. Sorry it took 9 years.

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


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

* [Bug stdio/16734] fopen calls mmap to allocate its buffer
  2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
                   ` (7 preceding siblings ...)
  2015-08-13  2:00 ` ppluzhnikov at google dot com
@ 2015-10-29 16:28 ` jsm28 at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-10-29 16:28 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.23

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


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

end of thread, other threads:[~2015-10-29 16:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 11:27 [Bug stdio/16734] New: fopen calls mmap to allocate its buffer dancol at dancol dot org
2014-06-13  9:18 ` [Bug stdio/16734] " fweimer at redhat dot com
2015-02-14 22:55 ` ppluzhnikov at google dot com
2015-02-19 20:49 ` crrodriguez at opensuse dot org
2015-03-08 16:50 ` cvs-commit at gcc dot gnu.org
2015-06-06  9:43 ` neleai at seznam dot cz
2015-06-07  2:27 ` ppluzhnikov at google dot com
2015-08-13  1:57 ` cvs-commit at gcc dot gnu.org
2015-08-13  2:00 ` ppluzhnikov at google dot com
2015-10-29 16:28 ` jsm28 at gcc dot gnu.org

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).