stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-449) [ITC/Linux] std::string Write -> Read data-race errors
Date Fri, 07 Mar 2008 00:06:58 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575967#action_12575967
] 

Travis Vitek commented on STDCXX-449:
-------------------------------------

Well, I haven't found any way suppress warnings from the thread checker utility using pragmas,
so I think option 1 is out.

The only way that I've seen that seems workable is to use the Intel Thread Tools library and
make the necessary calls to notify the thread checker that what we are doing is safe. I'm
pretty sure this is what you are saying with option 2. We can detect at compile time if the
user is building reentrant code with -tcheck option on the Intel compiler. If this is the
case we could enable the thread checker code. One problem with this is that we also need the
path to the include file libittnotify.h, as well as the link line to support linking to libittnotify.so
and libassuret40.so.

If we are going to be doing thread checker runs with any frequency, then we could just gather
up the thread checker output of all the tests/examples, and then run that output through a
filter to hide [or de-emphasize] the ones that we don't care about, and then generate some
fancy html output like the rest of the build infrastructure does.

> [ITC/Linux] std::string Write -> Read data-race errors
> ------------------------------------------------------
>
>                 Key: STDCXX-449
>                 URL: https://issues.apache.org/jira/browse/STDCXX-449
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 21. Strings
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: Intel Thread Checker 3.1 on Red Hat Enterprise Linux AS release
4 (Nahant Update 4)
>            Reporter: Martin Sebor
>            Assignee: Travis Vitek
>            Priority: Minor
>             Fix For: 4.2.1
>
>         Attachments: 21.string.cons.mt.itc-report.html
>
>
> Running the Intel Thread Checker on the string thread safety tests 21.string.cons.mt
and 21.string.push_back.mt produces errors suggesting potential thread safety problems even
though the tests run successfully to completion. See the text output below:
> {noformat}
> $ tcheck_cl -w 200 ./21.string.cons.mt --nloops=100 --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-icc-9.1_042-15s/tests/21.string.cons.mt --nloops=100 --nthreads=2
> # INFO (S1) (10 lines):
> # TEXT: 
> # COMPILER: Intel C++, __INTEL_COMPILER = 910, __INTEL_COMPILER_BUILD_DATE = 20060706,
__EDG_VERSION__ = 306
> # ENVIRONMENT: i386 running linux-elf 2.4.20 with glibc 2.3
> # FILE: 21.string.cons.mt.cpp
> # COMPILED: Jun 13 2007, 13:00:49
> # COMMENT: thread safety
> ############################################################
> # CLAUSE: lib.string.cons
> # INFO (S1) (3 lines):
> # TEXT: testing std::string with 2 threads, 100 iterations each
> # CLAUSE: lib.string.cons
> # INFO (S1) (3 lines):
> # TEXT: testing std::wstring with 2 threads, 100 iterations each
> # CLAUSE: lib.string.cons
> # +-----------------------+----------+----------+----------+
> # | DIAGNOSTIC            |  ACTIVE  |   TOTAL  | INACTIVE |
> # +-----------------------+----------+----------+----------+
> # | (S1) INFO             |        3 |        3 |       0% |
> # | (S7) ASSERTION        |        0 |       16 |     100% |
> # +-----------------------+----------+----------+----------+
> Application finished
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |ID |Short Description    |Severity   |Cou|Context[Best]      |Description          
                                                                      |1st Access[Best]  
 |2nd Access[Best]      |
> |   |                     |Name       |nt |                   |                     
                                                                      |                  
 |                      |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |1  |Write -> Read        |Error      |128|[21.string.cons.mt,|Memory read at "_strref.h":159
conflicts with a prior memory write at [21.string.cons.mt,   |[21.string.cons.mt, |"_strref.h":159
      |
> |   |data-race            |           |   |0xadf0]            |0x3475f] (flow dependence)
                                                                 |0x3475f]            |  
                   |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |2  |Read -> Write        |Error      |5  |[21.string.cons.mt,|Memory write at [21.string.cons.mt,
0x3475f] conflicts with a prior memory read at          |"_strref.h":159     |[21.string.cons.mt,
  |
> |   |data-race            |           |   |0x34755]           |"_strref.h":159 (anti
dependence)                                                           |                  
 |0x3475f]              |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |3  |Thread termination   |Information|1  |Whole Program 1    |Thread termination at
"thread.cpp":76 - includes stack allocation of 10.004 MB and use of   |"thread.cpp":76   
 |"thread.cpp":76       |
> |   |                     |           |   |                   |4.516 KB             
                                                                      |                  
 |                      |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |4  |Thread termination   |Information|1  |Whole Program 2    |Thread termination at
"thread.cpp":76 - includes stack allocation of 10.004 MB and use of   |"thread.cpp":76   
 |"thread.cpp":76       |
> |   |                     |           |   |                   |4.516 KB             
                                                                      |                  
 |                      |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |5  |Read -> Write        |Error      |7  |[21.string.cons.mt,|Memory write at [21.string.cons.mt,
0x3475f] conflicts with a prior memory read at          |"_strref.h":159     |[21.string.cons.mt,
  |
> |   |data-race            |           |   |0x34755]           |"_strref.h":159 (anti
dependence)                                                           |                  
 |0x3475f]              |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |6  |Thread termination   |Information|1  |Whole Program 3    |Thread termination at
"thread.cpp":76 - includes stack allocation of 10.004 MB and use of   |"thread.cpp":76   
 |"thread.cpp":76       |
> |   |                     |           |   |                   |4.516 KB             
                                                                      |                  
 |                      |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |7  |Thread termination   |Information|1  |Whole Program 4    |Thread termination at
"thread.cpp":76 - includes stack allocation of 10.004 MB and use of   |"thread.cpp":76   
 |"thread.cpp":76       |
> |   |                     |           |   |                   |4.516 KB             
                                                                      |                  
 |                      |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> |8  |Thread termination   |Information|1  |Whole Program 5    |Thread termination at
"21.string.cons.mt.cpp":237 - includes stack allocation of 10 MB and  |"21.string.cons.mt.c|"21.string.cons.mt.cpp|
> |   |                     |           |   |                   |use of 8.578 KB      
                                                                      |pp":237           
 |":237                 |
> ________________________________________________________________________________________________________________________________________________________________________________________________________
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message