[Boost-bugs] [Boost C++ Libraries] #9407: Patch to suppress valgrind error notifications + more entropy on Win

Subject: [Boost-bugs] [Boost C++ Libraries] #9407: Patch to suppress valgrind error notifications + more entropy on Win
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-19 08:11:54


#9407: Patch to suppress valgrind error notifications + more entropy on Win
------------------------------+-----------------------
 Reporter: apolukhin | Owner: atompkins
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: uuid
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------+-----------------------
 Valgrind reports "read of unitialized memory" while running the regression
 tests of uuid library:
 {{{
 ==11806== Conditional jump or move depends on uninitialised value(s)
 ==11806== at 0x407AF2: boost::random::mersenne_twister_engine<unsigned
 int, 32ul, 624ul, 397ul, 31ul, 2567483615u, 11ul, 4294967295u, 7ul,
 2636928640u, 15ul, 4022730752u, 18ul, 1812433253u>::normalize_state()
 (mersenne_twister.hpp:341)
 ==11806== by 0x40715E: void
 boost::random::mersenne_twister_engine<unsigned int, 32ul, 624ul, 397ul,
 31ul, 2567483615u, 11ul, 4294967295u, 7ul, 2636928640u, 15ul, 4022730752u,
 18ul,
 1812433253u>::seed<boost::uuids::detail::generator_iterator<boost::uuids::detail::seed_rng>
>(boost::uuids::detail::generator_iterator<boost::uuids::detail::seed_rng>&,
 boost::uuids::detail::generator_iterator<boost::uuids::detail::seed_rng>)
 (mersenne_twister.hpp:173)
 ==11806== by 0x40611E: void
 boost::uuids::detail::seed<boost::random::mersenne_twister_engine<unsigned
 int, 32ul, 624ul, 397ul, 31ul, 2567483615u, 11ul, 4294967295u, 7ul,
 2636928640u, 15ul, 4022730752u, 18ul, 1812433253u>
>(boost::random::mersenne_twister_engine<unsigned int, 32ul, 624ul, 397ul,
 31ul, 2567483615u, 11ul, 4294967295u, 7ul, 2636928640u, 15ul, 4022730752u,
 18ul, 1812433253u>&) (seed_rng.hpp:249)
 ==11806== by 0x404FE8:
 boost::uuids::basic_random_generator<boost::random::mersenne_twister_engine<unsigned
 int, 32ul, 624ul, 397ul, 31ul, 2567483615u, 11ul, 4294967295u, 7ul,
 2636928640u, 15ul, 4022730752u, 18ul, 1812433253u>
>::basic_random_generator() (random_generator.hpp:50)
 ==11806== by 0x402B8A: main (test_random_generator.cpp:38)

 }}}

 This is done intentionally, however it hardens debugging of code.
 Attached patch adds ability to gather entropy using CryptGenRandom and
 replaces read of initialized memory with two other operations that gather
 entropy in more valgrind-friendly way.

 After applying that patch valgrind reports no errors:
 {{{
 ==13997== Command: ./test_random_generator
 ==13997==
 No errors detected.
 ==13997==
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9407>
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:14 UTC