You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Liviu Nicoara (JIRA)" <ji...@apache.org> on 2012/09/27 01:11:08 UTC

[jira] [Created] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Liviu Nicoara created STDCXX-1071:
-------------------------------------

             Summary: numpunct facet cache initialization is not thread -safe
                 Key: STDCXX-1071
                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 22. Localization, Thread Safety
    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
         Environment: $ uname -a; CC -V
Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
CC: Sun C++ 5.12 Linux_i386 2011/11/16
            Reporter: Liviu Nicoara
            Priority: Critical
             Fix For: 4.2.x, 4.3.x, 5.0.0, 4.2.1


The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464302#comment-13464302 ] 

Liviu Nicoara commented on STDCXX-1071:
---------------------------------------

I have attached two minimal patches, one for 4.2.x and one for 4.3.x. They both eliminate the facet data caching. The former is binary compatible with 4.2.1, the other not. Application of either eliminates the failures in all the builds I have performed. As recorded in measurements performed for STDCXX-1056, perfect forwarding in the facet interface actually improves performance in multi-threaded environ. However, performance is worse in single-threaded builds.
                
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-4.3.x.diff, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment: patch-4.3.x.diff
                patch-4.2.x.diff
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-4.3.x.diff, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464667#comment-13464667 ] 

Liviu Nicoara commented on STDCXX-1071:
---------------------------------------

I have re-attached the timing measurements, file patch-timings.tgz, after re-verifying the results. They show an improved performance of the facet when not caching the locale data, in multi-threaded builds, with high contention.
                
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-4.3.x.diff, patch-timings.tgz, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464295#comment-13464295 ] 

Liviu Nicoara commented on STDCXX-1071:
---------------------------------------

The file library-reduction.cpp is a reduction of the numpunct library code down to the essentials that still have the defect. The test case is intentionally verbose (180LOC) so that it still shows the organization of the library code. It exhibits the same failures as the original library code it has been extracted from. It takes two defines on the command line: 

1. NO_USE_STDCXX_LOCALES -- if defined it mimics the setting of the facet data from the system locales
2. NO_USE_NUMPUNCT_CACHE -- if set, it does perfect forwarding, i.e., it does not cache "locale data" in the facet

The runs, with SUNPro 5.12 on Linux, exhibit failures (renamed to t.cpp):

{noformat}
$ CC -O -mt t.cpp && ./a.out 
"t.cpp", line 113: Warning: String literal converted to char* in assignment.
1 Warning(s) detected.
CC: Warning: failed to detect system linker version, falling back to custom linker usage
16, 10000000
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x0000000000622b40 ***
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x00007f6654000920 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x78f85)[0x7f666c031f85]
/lib64/libc.so.6(cfree+0x73)[0x7f666c035d93]
...
{noformat}

{noformat}
$ CC -DNO_USE_STDCXX_LOCALES -O -mt t.cpp && ./a.out 
"t.cpp", line 113: Warning: String literal converted to char* in assignment.
1 Warning(s) detected.
CC: Warning: failed to detect system linker version, falling back to custom linker usage
16, 10000000
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x0000000000622b40 ***
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x00007fda600008b0 ***
======= Backtrace: =========
/lib64/libc.so.6======= Backtrace: =========
/lib64/libc.so.6(cfree+0x73)[0x7fda6c8f2d93]
/lib64/libc.so.6(+0x78f85)[0x7fda6c8eef85]
<noformat>

The reduced program did not fail in my runs with NO_USE_NUMPUNCT_CACHE defined.
                
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment:     (was: library-reduction.cpp)
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464298#comment-13464298 ] 

Liviu Nicoara commented on STDCXX-1071:
---------------------------------------

The file punct-mt.cpp is a multi-threaded program that tests either the numpunct or the moneypunct facet accessor interface. If TEST_MONEYPUNCT is defined, the test tests moneypunct. The test fails with 4.2.x and presumably with all others. The moneypunct version does not fail in my local runs. I have used SUNPro 5.12 on Linux, but I noticed failures with gcc 4.7.1 as well. The test case is pointing at the numpunct facet caching code.
                
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Fix Version/s:     (was: 4.2.1)
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-5.0.x.diff, patch-timings.tgz, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara reassigned STDCXX-1071:
-------------------------------------

    Assignee: Liviu Nicoara
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Assignee: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-5.0.x.diff, patch-timings.tgz, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment: patch-timings.tgz
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-4.3.x.diff, patch-timings.tgz, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment: library-reduction.cpp
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment:     (was: patch-4.3.x.diff)
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-timings.tgz, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment: patch-5.0.x.diff
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-5.0.x.diff, patch-timings.tgz, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment: punct-mt.cpp
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464295#comment-13464295 ] 

Liviu Nicoara edited comment on STDCXX-1071 at 9/27/12 11:11 AM:
-----------------------------------------------------------------

The file library-reduction.cpp is a reduction of the numpunct library code down to the essentials that still have the defect. The test case is intentionally verbose (180LOC) so that it still shows the organization of the library code. It exhibits the same failures as the original library code it has been extracted from. It takes two defines on the command line: 

1. NO_USE_STDCXX_LOCALES -- if defined it mimics the setting of the facet data from the system locales
2. NO_USE_NUMPUNCT_CACHE -- if set, it does perfect forwarding, i.e., it does not cache "locale data" in the facet

The runs, with SUNPro 5.12 on Linux, exhibit failures (renamed to t.cpp):

{noformat}
$ CC -O -mt t.cpp && ./a.out 
"t.cpp", line 113: Warning: String literal converted to char* in assignment.
1 Warning(s) detected.
CC: Warning: failed to detect system linker version, falling back to custom linker usage
16, 10000000
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x0000000000622b40 ***
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x00007f6654000920 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x78f85)[0x7f666c031f85]
/lib64/libc.so.6(cfree+0x73)[0x7f666c035d93]
...

$ CC -DNO_USE_STDCXX_LOCALES -O -mt t.cpp && ./a.out 
"t.cpp", line 113: Warning: String literal converted to char* in assignment.
1 Warning(s) detected.
CC: Warning: failed to detect system linker version, falling back to custom linker usage
16, 10000000
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x0000000000622b40 ***
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x00007fda600008b0 ***
======= Backtrace: =========
/lib64/libc.so.6======= Backtrace: =========
/lib64/libc.so.6(cfree+0x73)[0x7fda6c8f2d93]
/lib64/libc.so.6(+0x78f85)[0x7fda6c8eef85]
{noformat}

The reduced program did not fail in my runs with NO_USE_NUMPUNCT_CACHE defined.
                
      was (Author: nikkoara):
    The file library-reduction.cpp is a reduction of the numpunct library code down to the essentials that still have the defect. The test case is intentionally verbose (180LOC) so that it still shows the organization of the library code. It exhibits the same failures as the original library code it has been extracted from. It takes two defines on the command line: 

1. NO_USE_STDCXX_LOCALES -- if defined it mimics the setting of the facet data from the system locales
2. NO_USE_NUMPUNCT_CACHE -- if set, it does perfect forwarding, i.e., it does not cache "locale data" in the facet

The runs, with SUNPro 5.12 on Linux, exhibit failures (renamed to t.cpp):

{noformat}
$ CC -O -mt t.cpp && ./a.out 
"t.cpp", line 113: Warning: String literal converted to char* in assignment.
1 Warning(s) detected.
CC: Warning: failed to detect system linker version, falling back to custom linker usage
16, 10000000
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x0000000000622b40 ***
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x00007f6654000920 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x78f85)[0x7f666c031f85]
/lib64/libc.so.6(cfree+0x73)[0x7f666c035d93]
...
{noformat}

{noformat}
$ CC -DNO_USE_STDCXX_LOCALES -O -mt t.cpp && ./a.out 
"t.cpp", line 113: Warning: String literal converted to char* in assignment.
1 Warning(s) detected.
CC: Warning: failed to detect system linker version, falling back to custom linker usage
16, 10000000
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x0000000000622b40 ***
*** glibc detected *** ./a.out: double free or corruption (fasttop): 0x00007fda600008b0 ***
======= Backtrace: =========
/lib64/libc.so.6======= Backtrace: =========
/lib64/libc.so.6(cfree+0x73)[0x7fda6c8f2d93]
/lib64/libc.so.6(+0x78f85)[0x7fda6c8eef85]
<noformat>

The reduced program did not fail in my runs with NO_USE_NUMPUNCT_CACHE defined.
                  
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp, patch-4.2.x.diff, patch-4.3.x.diff, punct-mt.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (STDCXX-1071) numpunct facet cache initialization is not thread -safe

Posted by "Liviu Nicoara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liviu Nicoara updated STDCXX-1071:
----------------------------------

    Attachment: library-reduction.cpp
    
> numpunct facet cache initialization is not thread -safe
> -------------------------------------------------------
>
>                 Key: STDCXX-1071
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1071
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization, Thread Safety
>    Affects Versions: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>         Environment: $ uname -a; CC -V
> Linux behemoth 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 AMD Opteron(tm) Processor 6134 AuthenticAMD GNU/Linux
> CC: Sun C++ 5.12 Linux_i386 2011/11/16
>            Reporter: Liviu Nicoara
>            Priority: Critical
>              Labels: DCII, localization, numpunct, thread-safety
>             Fix For: 4.2.1, 4.2.x, 4.3.x, 5.0.0
>
>         Attachments: library-reduction.cpp
>
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> The bug affects the initialization of the cached data in numpunct facet. The failing test is 22.locale.numpunct.cpp in certain builds: Linux with SUNPro 5.12, optimized, most likely to fail. It has been reported (see linked incidents) to fail on SPARC as well. It manifests in variate ways: sometimes as heap corruption, sometimes as access violations, etc. Test cases and library reduction programs to follow. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira