public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/13583] New: __use_cache not threadsafe
@ 2004-01-06 12:17 peturr02 at ru dot is
  2004-01-06 18:48 ` [Bug libstdc++/13583] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: peturr02 at ru dot is @ 2004-01-06 12:17 UTC (permalink / raw)
  To: gcc-bugs

This fragment in __use_cache (taken from the 3.3 branch) is not threadsafe:

      if (__builtin_expect(!__cache, false))
        {
          __cache = new __locale_cache<_Facet>(__loc);
          __loc._M_impl->_M_install_cache(__cache, __i);
        }

If this code is executed by two threads at the same time, two instances of
the cache are created, of which one will be leaked.

The version on mainline has the same problem.

Since __use_cache first appeard in 3.3.1, this is a regression.

-- 
           Summary: __use_cache not threadsafe
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peturr02 at ru dot is
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
@ 2004-01-06 18:48 ` pinskia at gcc dot gnu dot org
  2004-01-10 11:14 ` steven at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-06 18:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-06 18:48 -------
Confirmed (note this is hard to happen but it still can happen).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-06 18:48:12
               date|                            |
            Summary|__use_cache not threadsafe  |[3.3/3.4 Regression]
                   |                            |__use_cache not threadsafe
   Target Milestone|---                         |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
  2004-01-06 18:48 ` [Bug libstdc++/13583] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2004-01-10 11:14 ` steven at gcc dot gnu dot org
  2004-01-10 11:33 ` paolo at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-01-10 11:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-01-10 11:14 -------
How does this happen in 3.4?  __locale_cache was removed on mainline: 
 
2003-06-26  Benjamin Kosnik  <bkoz@redhat.com> 
            Jerry Quinn  <jlquinn@optonline.net> 
(...) 
	(__locale_cache_base): Remove. 
	(__locale_cache): Remove. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
  2004-01-06 18:48 ` [Bug libstdc++/13583] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
  2004-01-10 11:14 ` steven at gcc dot gnu dot org
@ 2004-01-10 11:33 ` paolo at gcc dot gnu dot org
  2004-02-11  4:40 ` [Bug libstdc++/13583] [3.3/3.4/3.5 " ljrittle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: paolo at gcc dot gnu dot org @ 2004-01-10 11:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paolo at gcc dot gnu dot org  2004-01-10 11:33 -------
Hi Steven!
__use_cache and the whole locale caching machinery is definitely present
in mainline (just grep libstdc++-v3/include/bits), otherwise we wouldn't
be so blazingly fast ;)
The code is somewhat different, tough, I'm not deadly sure that it's
affected by the very same problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |s dot bosscher at student
                   |                            |dot tudelft dot nl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (2 preceding siblings ...)
  2004-01-10 11:33 ` paolo at gcc dot gnu dot org
@ 2004-02-11  4:40 ` ljrittle at gcc dot gnu dot org
  2004-03-17 19:48 ` bkoz at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ljrittle at gcc dot gnu dot org @ 2004-02-11  4:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ljrittle at gcc dot gnu dot org  2004-02-11 04:40 -------
Without discounting this type of report (i.e. we want to fix this): On
most/all supported CPU arches, we believe that this is a contained
memory leak (bounded by number of threads competing to build
the cache which itself is bound by number of threads) rather than
failing to be threadsafe...

As discussed on the list, we will not fix this for 3.3.X or 3.4. - Loren


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-01-06 18:48:12         |2004-02-11 04:40:40
               date|                            |
   Target Milestone|3.4.0                       |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (3 preceding siblings ...)
  2004-02-11  4:40 ` [Bug libstdc++/13583] [3.3/3.4/3.5 " ljrittle at gcc dot gnu dot org
@ 2004-03-17 19:48 ` bkoz at gcc dot gnu dot org
  2004-05-28  1:56 ` bkoz at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-03-17 19:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-03-17 19:48 -------

It is believed this can be fixed without messing with the libstdc++ ABI. 
Something like the __glibcxx_mutex_lock bits from locale::locale and
locale::global can be used, or we can do this right and do something equivalent
with RAII.

So, this is lower-priority than it looks at first glance.

-benjamin

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (4 preceding siblings ...)
  2004-03-17 19:48 ` bkoz at gcc dot gnu dot org
@ 2004-05-28  1:56 ` bkoz at gcc dot gnu dot org
  2004-06-06  3:46 ` giovannibajo at libero dot it
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-05-28  1:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-05-27 16:45 -------
Mine

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bkoz at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (5 preceding siblings ...)
  2004-05-28  1:56 ` bkoz at gcc dot gnu dot org
@ 2004-06-06  3:46 ` giovannibajo at libero dot it
  2004-06-06  3:47 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-06  3:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-06-06 03:46 -------
Since there is a proposed patch for 3.4, I'm tentatively moving back the target 
to 3.4.1. Benjamin, do you reckon the patch can be applied then?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (6 preceding siblings ...)
  2004-06-06  3:46 ` giovannibajo at libero dot it
@ 2004-06-06  3:47 ` giovannibajo at libero dot it
  2004-06-07 14:22 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-06  3:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |3.4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (7 preceding siblings ...)
  2004-06-06  3:47 ` giovannibajo at libero dot it
@ 2004-06-07 14:22 ` mmitchel at gcc dot gnu dot org
  2004-08-12  7:53 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-07 14:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-06-07 14:22 -------
This is OK for 3.4.1 if it goes in on mainline.  However, I'm not going to hold
the release for it -- so I've retargeted at 3.4.2.  If it goes in for 3.4.1,
please set the target back to 3.4.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.1                       |3.4.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (8 preceding siblings ...)
  2004-06-07 14:22 ` mmitchel at gcc dot gnu dot org
@ 2004-08-12  7:53 ` steven at gcc dot gnu dot org
  2004-08-29 18:45 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-08-12  7:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-08-12 07:53 -------
Benjamin, ping. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/3.5 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (9 preceding siblings ...)
  2004-08-12  7:53 ` steven at gcc dot gnu dot org
@ 2004-08-29 18:45 ` mmitchel at gcc dot gnu dot org
  2004-10-30 20:01 ` [Bug libstdc++/13583] [3.3/3.4/4.0 " mmitchel at gcc dot gnu dot org
  2005-01-27  0:31 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-29 18:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-08-29 18:45 -------
Postponed until GCC 3.4.3.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.2                       |3.4.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/4.0 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (10 preceding siblings ...)
  2004-08-29 18:45 ` mmitchel at gcc dot gnu dot org
@ 2004-10-30 20:01 ` mmitchel at gcc dot gnu dot org
  2005-01-27  0:31 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-30 20:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-10-30 20:01 -------
Postponed until GCC 3.4.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|3.4.1 4.0                   |3.4.1 4.0.0
   Target Milestone|3.4.3                       |3.4.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

* [Bug libstdc++/13583] [3.3/3.4/4.0 Regression] __use_cache not threadsafe
  2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
                   ` (11 preceding siblings ...)
  2004-10-30 20:01 ` [Bug libstdc++/13583] [3.3/3.4/4.0 " mmitchel at gcc dot gnu dot org
@ 2005-01-27  0:31 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-27  0:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-27 00:31 -------
Any news on this?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583


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

end of thread, other threads:[~2005-01-27  0:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-06 12:17 [Bug libstdc++/13583] New: __use_cache not threadsafe peturr02 at ru dot is
2004-01-06 18:48 ` [Bug libstdc++/13583] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
2004-01-10 11:14 ` steven at gcc dot gnu dot org
2004-01-10 11:33 ` paolo at gcc dot gnu dot org
2004-02-11  4:40 ` [Bug libstdc++/13583] [3.3/3.4/3.5 " ljrittle at gcc dot gnu dot org
2004-03-17 19:48 ` bkoz at gcc dot gnu dot org
2004-05-28  1:56 ` bkoz at gcc dot gnu dot org
2004-06-06  3:46 ` giovannibajo at libero dot it
2004-06-06  3:47 ` giovannibajo at libero dot it
2004-06-07 14:22 ` mmitchel at gcc dot gnu dot org
2004-08-12  7:53 ` steven at gcc dot gnu dot org
2004-08-29 18:45 ` mmitchel at gcc dot gnu dot org
2004-10-30 20:01 ` [Bug libstdc++/13583] [3.3/3.4/4.0 " mmitchel at gcc dot gnu dot org
2005-01-27  0:31 ` pinskia at gcc dot gnu dot 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).