Issue Details (XML | Word | Printable)

Key: STDCXX-523
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Martin Sebor
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

data race in std::locale::classic()

Created: 16/Aug/07 11:40 PM   Updated: 30/Mar/08 06:41 PM
Return to search
Component/s: 22. Localization
Affects Version/s: 4.1.3, 4.1.4, 4.2.0
Fix Version/s: 4.3.0

Time Tracking:
Original Estimate: 8h
Original Estimate - 8h
Remaining Estimate: 8h
Remaining Estimate - 8h
Time Spent: Not Specified
Remaining Estimate - 8h

File Attachments:
  Size
HTML File Licensed for inclusion in ASF works 22.locale.statics.mt.566892.html 2007-08-17 12:43 AM Martin Sebor 3 kB
HTML File Licensed for inclusion in ASF works 22.locale.statics.mt.html 2007-08-17 12:07 AM Martin Sebor 4 kB
HTML File Licensed for inclusion in ASF works 22.locale.statics.mt.html 2007-08-16 11:45 PM Martin Sebor 4 kB
Issue Links:
Dependants
 

Severity: Resource Leak


 Description  « Hide
Intel Thread Checker reports the following data race in std::locale::classic():

$ tcheck_cl ./22.locale.statics.mt --no-global --nthreads=2
Intel(R) Thread Checker 3.1 command line instrumentation driver (24400)
Copyright (c) 2007 Intel Corporation. All rights reserved.
Building project

Running: /build/sebor/stdcxx-trunk-gcc-3.4.6_3-15D/tests/22.locale.statics.mt --no-global --nthreads=2

  1. INFO (S1) (10 lines):
  2. TEXT:
  3. COMPILER: gcc 3.4.6, _VERSION_ = "3.4.6 20060404 (Red Hat 3.4.6-3)"
  4. ENVIRONMENT: x86_64/LP64 running linux-elf (Red Hat Enterprise Linux AS release 4 (Nahant Update 4)) with glibc 2.3
  5. FILE: 22.locale.statics.mt.cpp
  6. COMPILED: Aug 16 2007, 19:32:08
  7. COMMENT: thread safety
    ############################################################
  1. CLAUSE: lib.locale.statics
  1. INFO (S1) (3 lines):
  2. TEXT: testing std::locale::classic() with 2 threads
  3. CLAUSE: lib.locale.statics
  1. NOTE (S2) (4 lines):
  2. TEXT: std::locale::global(const std::locale&) test disabled
  3. CLAUSE: lib.locale.statics
  4. LINE: 129
  1. -----------------------------------------------+
  2. DIAGNOSTIC ACTIVE TOTAL INACTIVE
  3. -----------------------------------------------+
  4. (S1) INFO 2 2 0%
  5. (S2) NOTE 1 2 50%
  6. -----------------------------------------------+

Application finished

_______________________________________________________________________________

ID Short De Seve C Context Description 1st Acc 2nd Acce
  scriptio rity o [Best]   ess[Bes ss[Best]
  n Name u     t]  
      n        
      t        

_______________________________________________________________________________

1 Write -> Erro 3 "22.loc Memory read at "_mutex "22.loca
  Read dat r 6 ale.sta "22.locale.statics.mt.cpp":78 .h":580 le.stati
  a-race     tics.mt conflicts with a prior memory   cs.mt.cp
        .cpp":6 write at "_mutex.h":580 (flow   p":78
        9 dependence)    

_______________________________________________________________________________

2 Read -> Erro 1 [libstd Memory write at [libstd15D.so, "locale [libstd1
  Write da r   15D.so, 0xb646b] conflicts with a prior _classi 5D.so,
  ta-race     0xb6460 memory read at c.cpp": 0xb646b]
        ] "locale_classic.cpp":45 (anti 45  
          dependence)    

_______________________________________________________________________________

3 Read -> Erro 1 [libstd Memory write at [libstd15D.so, "locale [libstd1
  Write da r   15D.so, 0xb646b] conflicts with a prior _classi 5D.so,
  ta-race     0xb6460 memory read at c.cpp": 0xb646b]
        ] "locale_classic.cpp":55 (anti 55  
          dependence)    

_______________________________________________________________________________

4 Thread t Info 1 Whole Thread termination at "thread "thread.
  erminati rmat   Program "thread.cpp":84 - includes stack .cpp":8 cpp":84
  on ion   1 allocation of 10.004 MB and use 4  
          of 10.203 KB    

_______________________________________________________________________________

5 Thread t Info 1 Whole Thread termination at "thread "thread.
  erminati rmat   Program "thread.cpp":84 - includes stack .cpp":8 cpp":84
  on ion   2 allocation of 10.004 MB and use 4  
          of 10.188 KB    

_______________________________________________________________________________

6 Thread t Info 1 Whole Thread termination at "22.loc "22.loca
  erminati rmat   Program "22.locale.statics.mt.cpp":171 - ale.sta le.stati
  on ion   3 includes stack allocation of 10 tics.mt cs.mt.cp
          MB and use of 8.094 KB .cpp":1 p":171
            71  

_______________________________________________________________________________



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 16/Aug/07 11:45 PM
Attached Intel Thread Checker output in HTML format.

Martin Sebor added a comment - 17/Aug/07 12:07 AM
Attached a more informative Intel Thread Checker output file obtained with Intel C++ 10.0.

Martin Sebor added a comment - 17/Aug/07 12:43 AM
Attached Intel Thread Checker output after the committed change (http://svn.apache.org/viewvc?view=rev&rev=566892) and after __rw_once() has been locally doctored to use a global pthread mutex instead of pthread_once() to work around the Intel Thread Checker bug documented in STDCXX-467.

Martin Sebor added a comment - 17/Aug/07 12:44 AM
The absence of ITC data race errors depends on the linked bug in the tool (or a workaround for it).

Martin Sebor added a comment - 11/Oct/07 01:29 AM
In 4.2.0 we don't have time to work around the Thread Checker bug that causes it to issue the diagnostic. We might want to revisit it in 4.2.1. Rescheduled.

Martin Sebor added a comment - 30/Mar/08 06:41 PM
No time to deal with bugs in third party add-on tools. Deferred until 4.3.