Boost C++ Libraries: Ticket #8245: strerror is not thread-safe on all platforms https://svn.boost.org/trac10/ticket/8245 <p> 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. </p> <p> 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. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8245 Trac 1.4.3 Andrey Semashev Tue, 05 Mar 2013 09:14:48 GMT component changed; owner set https://svn.boost.org/trac10/ticket/8245#comment:1 https://svn.boost.org/trac10/ticket/8245#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">No-Maintainer</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">random</span> </li> </ul> Ticket Andrey Semashev Tue, 05 Mar 2013 09:17:27 GMT owner changed https://svn.boost.org/trac10/ticket/8245#comment:2 https://svn.boost.org/trac10/ticket/8245#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">No-Maintainer</span> to <span class="trac-author">Steven Watanabe</span> </li> </ul> Ticket Steven Watanabe Thu, 13 Mar 2014 22:17:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8245#comment:3 https://svn.boost.org/trac10/ticket/8245#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in <a class="ext-link" href="http://github.com/boostorg/random/commit/dac48f62a8481560c2e8005bb6edcbfd409b3004"><span class="icon">​</span>http://github.com/boostorg/random/commit/dac48f62a8481560c2e8005bb6edcbfd409b3004</a>. </p> Ticket Andrey Semashev Fri, 14 Mar 2014 06:28:32 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/8245#comment:4 https://svn.boost.org/trac10/ticket/8245#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> The use of errno is still not fixed. It should be read once immediately at the beginning of error(const char * msg). Otherwise it may be clobbered by construction of other arguments to system_error constructor. </p> Ticket Andrey Semashev Fri, 14 Mar 2014 06:38:53 GMT <link>https://svn.boost.org/trac10/ticket/8245#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8245#comment:5</guid> <description> <p> Pull request: <a class="ext-link" href="https://github.com/boostorg/random/pull/2"><span class="icon">​</span>https://github.com/boostorg/random/pull/2</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 14 Mar 2014 14:30:46 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8245#comment:6 https://svn.boost.org/trac10/ticket/8245#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket Andrey Semashev Tue, 08 Apr 2014 09:52:45 GMT <link>https://svn.boost.org/trac10/ticket/8245#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8245#comment:7</guid> <description> <p> Steven, you closed the ticket but did not merge the pull request. Was this intentional? Are you rejecting the proposed fix? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Tue, 08 Apr 2014 14:23:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8245#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8245#comment:8</guid> <description> <p> Don't expect me to merge pull requests in general. Especially for things that are this simple, it's easier for me to type it in myself than to figure out the git commands I would need. I also generally make some changes when applying patches. In this case, the fix I applied is not quite the same as your pull request because I used the name error_code instead of err, to be consistent with the name in the Windows implementation. </p> </description> <category>Ticket</category> </item> </channel> </rss>