Subject: [Boost-bugs] [Boost C++ Libraries] #8245: strerror is not thread-safe on all platforms
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-05 09:12:34
#8245: strerror is not thread-safe on all platforms
------------------------------+---------------------------------------------
Reporter: andysem | Owner:
Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
libs/random/src/random_device.cpp uses strerror function which is not
thread-safe on many platforms (e.g. Linux). Its use should be replaced
with strerror_r, when possible. Also, the way errno is used is not correct
because it may be changed while the error string is composed.
The suggested solution would be to use system_error from Boost.System
instead of invalid_argument. The possible errors don't look like are
caused by an invalid argument anyway. The Boost.System implementation
already uses strerror_r when possible, so the switch to system_error would
resolve the problem.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8245> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC