public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
From: "jakub at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs-regex@sources.redhat.com
Subject: [Bug regex/12567] regexec leaks mem when used multiple times
Date: Fri, 11 Mar 2011 06:55:00 -0000	[thread overview]
Message-ID: <bug-12567-132-KUkgLHCOhM@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-12567-132@http.sourceware.org/bugzilla/>

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

Jakub Jelinek <jakub at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jakub at redhat dot com
         Resolution|                            |INVALID

--- Comment #1 from Jakub Jelinek <jakub at redhat dot com> 2011-03-11 06:54:54 UTC ---
You clearly don't understand what is a memory leak.  Just call regfree at the
end of the testcase and you'll see that no memory has been leaked.
glibc regex implementation is a DFA, which creates needed nodes on the fly.  If
you always search the same string, after a first regexec new nodes won't need
to be created, but if you always search different strings, it may be that they
need to.  All the memory allocated memory is tracked and freed upon regfree
though.

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


  parent reply	other threads:[~2011-03-11  6:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11  5:13 [Bug regex/12567] New: " vapier at gentoo dot org
2011-03-11  5:13 ` [Bug regex/12567] " vapier at gentoo dot org
2011-03-11  6:55 ` jakub at redhat dot com [this message]
2011-03-11  7:55 ` [Bug regex/12567] regexec sucks up mem when used multiple times with different strings vapier at gentoo dot org
2011-03-11  8:04 ` jakub at redhat dot com
2011-03-11  8:10 ` bonzini at gnu dot org
2014-06-27 13:45 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-12567-132-KUkgLHCOhM@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs-regex@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).