Issue Details (XML | Word | Printable)

Key: STDCXX-452
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Travis Vitek
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

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

std::numpunct not thread safe

Created: 21/Jun/07 08:27 PM   Updated: 22/Apr/08 03:06 AM
Return to search
Component/s: 22. Localization, Thread Safety
Affects Version/s: 4.1.2, 4.1.3
Fix Version/s: 4.2.0

Time Tracking:
Not Specified

File Attachments:
  Size
HTML File Licensed for inclusion in ASF works 22.locale.numpunct.mt.html 2007-06-21 08:29 PM Martin Sebor 31 kB
Text File Licensed for inclusion in ASF works punct.patch 2007-09-28 11:43 PM Travis Vitek 0.5 kB
Environment: all

Resolution Date: 01/Oct/07 02:39 PM


 Description  « Hide
The 22.locale.numpunct.mt thread safety tests aborts at runtime indicating that there is a thread safety issue in the locale implementation. Running the test through the Intel Thread Checker reveals possible causes of the problem.

$ tcheck_cl -v && make 22.locale.numpunct.mt && tcheck_cl -f html -o 22.locale.numpunct.mt ./22.locale.numpunct.mt --nthreads=2 --nloops=1000
Intel(R) Thread Checker 3.1 command line instrumentation driver (24400)
Copyright (c) 2007 Intel Corporation. All rights reserved.
make: `22.locale.numpunct.mt' is up to date.
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-icc-9.1_049-15S/tests/22.locale.numpunct.mt --nthreads=2 --nloops=1000

  1. INFO (S1) (10 lines):
  2. TEXT:
  3. COMPILER: Intel C++, _INTEL_COMPILER = 910, __INTEL_COMPILER_BUILD_DATE = 20070320, __EDG_VERSION_ = 306
  4. ENVIRONMENT: x86_64/LP64 running linux-elf 2.4.20 with glibc 2.3
  5. FILE: 22.locale.numpunct.mt.cpp
  6. COMPILED: Jun 13 2007, 14:05:31
  7. COMMENT: thread safety
    ############################################################
  1. CLAUSE: lib.locale.numpunct
  1. NOTE (S2) (5 lines):
  2. TEXT: executing "locale -a > /tmp/tmpfile-FZLyTh"
  3. CLAUSE: lib.locale.numpunct
  4. FILE: process.cpp
  5. LINE: 274
  1. INFO (S1) (3 lines):
  2. TEXT: testing std::numpunct<charT> with 2 threads, 1000 iterations each, in locales { "aa_DJ" "aa_DJ.iso88591" "aa_DJ.utf8" "aa_ER" "aa_ER@saaho" "aa_ER.utf8" "aa_ER.utf8@saaho" "aa_ET" "aa_ET.utf8" "af_ZA" "af_ZA.iso88591" "af_ZA.utf8" "am_ET" "am_ET.utf8" "an_ES" "an_ES.iso885915" "an_ES.utf8" "ar_AE" "ar_AE.iso88596" "ar_AE.utf8" "ar_BH" "ar_BH.iso88596" "ar_BH.utf8" "ar_DZ" "ar_DZ.iso88596" "ar_DZ.utf8" "ar_EG" "ar_EG.iso88596" "ar_EG.utf8" "ar_IN" "ar_IN.utf8" "ar_IQ" }
  3. CLAUSE: lib.locale.numpunct
  1. INFO (S1) (3 lines):
  2. TEXT: exercising std::numpunct<char>
  3. CLAUSE: lib.locale.numpunct

/amd/devco/sebor/stdcxx/tests/localization/22.locale.numpunct.mt.cpp:128: void *thread_func(void *): Assertion '0 == rw_strncmp (fn.c_str (), data->falsename_)' failed.
/build/sebor/stdcxx-icc-9.1_049-15S/tests/./22.locale.numpunct.mt[0x8ad9fc]

Application finished



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 21/Jun/07 08:29 PM
Attached Intel Thread Checker output.

Martin Sebor made changes - 21/Jun/07 08:29 PM
Field Original Value New Value
Attachment 22.locale.numpunct.mt.html [ 12360323 ]
Martin Sebor made changes - 21/Jun/07 10:00 PM
Affects Version/s 4.1.3 [ 12310191 ]
Martin Sebor added a comment - 30/Jul/07 12:43 AM
Added Thread Safety to the list of components affected by this issue.

Martin Sebor made changes - 30/Jul/07 12:43 AM
Component/s Thread Safety [ 12311880 ]
Martin Sebor added a comment - 26/Aug/07 08:58 PM
Scheduled for 4.2.

Martin Sebor made changes - 26/Aug/07 08:58 PM
Fix Version/s 4.2 [ 12311945 ]
Travis Vitek made changes - 25/Sep/07 12:07 AM
Assignee Travis Vitek [ vitek ]
Travis Vitek made changes - 25/Sep/07 12:07 AM
Status Open [ 1 ] In Progress [ 3 ]
Travis Vitek added a comment - 28/Sep/07 11:43 PM

2007-09-28 Travis Vitek <vitek@roguewave.com>

STDCXX-452

  • punct.cpp (__rw_get_numpunct): After creating __rw_setlocale
    object check if the locale data is initialized by another thread
    to avoid doing unnecessary work and leaking memory.

Travis Vitek made changes - 28/Sep/07 11:43 PM
Attachment punct.patch [ 12366787 ]
Travis Vitek made changes - 28/Sep/07 11:45 PM
Status In Progress [ 3 ] Open [ 1 ]
Repository Revision Date User Message
ASF #580959 Mon Oct 01 13:56:49 UTC 2007 faridz 2007-10-01 Farid Zaripov <farid_zaripov@epam.com>

STDCXX-452
STDCXX-453
* punct.cpp (__rw_get_moneypunct): After creating __rw_setlocale
object check if the locale data is initialized by another thread
to avoid doing unnecessary work and leaking memory.
(__rw_get_numpunct): Ditto.
Files Changed
MODIFY /incubator/stdcxx/branches/4.2.0/src/punct.cpp

Repository Revision Date User Message
ASF #580961 Mon Oct 01 13:58:30 UTC 2007 faridz 2007-10-01 Travis Vitek <vitek@roguewave.com>

STDCXX-452
* setlocale.cpp (~__rw_setlocale): Restore the previous
locale in a threadsafe manner. Simplified.
Files Changed
MODIFY /incubator/stdcxx/branches/4.2.0/src/setlocale.cpp

Farid Zaripov made changes - 01/Oct/07 02:39 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Martin Sebor added a comment - 22/Apr/08 03:06 AM
Merged to trunk in r580979.