Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1512587 - data race in std::promise/std::future (reported by ThreadSanitizer)
data race in std::promise/std::future (reported by ThreadSanitizer)
Status: CLOSED ERRATA
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc (Show other bugs)
DTS 6.0 RHEL 6
All Linux
unspecified Severity medium
: alpha
: 7.1
Assigned To: Marek Polacek
Michael Petlan
Vladimír Slávik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-13 10:26 EST by Paulo Andrade
Modified: 2018-05-03 01:14 EDT (History)
8 users (show)

See Also:
Fixed In Version: devtoolset-7-gcc-7.2.1-6.el6
Doc Type: Bug Fix
Doc Text:
Previously, the code for the `std::promise` and `std::future` C++ standard library class templates contained a data race. The code has been fixed and the race condition no longer exists.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-05-03 01:13:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
racy2.C (454 bytes, text/plain)
2017-11-13 10:26 EST, Paulo Andrade
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1293 None None None 2018-05-03 01:14 EDT

  None (edit)
Description Paulo Andrade 2017-11-13 10:26:53 EST
Created attachment 1351594 [details]
racy2.C

There should be no race (likely a false positive), but libtsan reports
a race.

  Example:

$ scl enable devtoolset-6 bash
$ g++ -fsanitize=thread -static-libtsan -g -o racy racy2.C -lpthread
$ ./racy

  Expected results would be empty output, but actual output
is a report about a race:

[...]
SUMMARY: ThreadSanitizer: data race /opt/rh/devtoolset-6/root/usr/include/c++/6.3.1/bits/unique_ptr.h:308 in std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>::get() const

  The issue also happens in rhel7.
Comment 2 Marek Polacek 2017-12-05 08:51:30 EST
I could reproduce this with DTS 6, but DTS 7 looks fine:

# g++ --version
g++ (GCC) 7.2.1 20170829 (Red Hat 7.2.1-1)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# g++ -fsanitize=thread -static-libtsan -g -o racy racy.C -lpthread
# ./racy
#

So we should include this BZ in DTS 7.1.
Comment 5 Michael Petlan 2018-04-26 08:07:34 EDT
Successfully reproduced with DTS-6, verified for devtoolset-7-libtsan-devel-7.3.1-5.4.
No races are reported.
VERIFIED.
Comment 8 errata-xmlrpc 2018-05-03 01:13:47 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1293

Note You need to log in before you can comment on or make changes to this bug.