Opened 9 years ago

Closed 5 years ago

Last modified 5 years ago

#9407 closed Patches (fixed)

Patch to suppress valgrind error notifications + more entropy on Win

Reported by: Antony Polukhin Owned by: Andy Tompkins
Milestone: Boost 1.59.0 Component: uuid
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

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== 

Attachments (1)

uuid_valgrind.patch (3.3 KB ) - added by Antony Polukhin 9 years ago.

Download all attachments as: .zip

Change History (7)

by Antony Polukhin, 9 years ago

Attachment: uuid_valgrind.patch added

comment:1 by Antony Polukhin, 9 years ago

Type: BugsPatches

comment:2 by Antony Polukhin, 8 years ago

Pull request on github with fix for this issue.

comment:3 by nigel.stewart@…, 8 years ago

+1 for this

I needed to exclude boost uuid test coverage due to these UMRs. It undermines confidence in boost to be relying on that for entropy, IMHO.

comment:4 by xyzdragon@…, 7 years ago

Hi, I also have this problem. Seeing that the last post was almost 2 years ago, is there still progress on this one?

comment:5 by James E. King, III, 5 years ago

Milestone: To Be Determined
Resolution: fixed
Status: newclosed

This patch was merged into boost-1.59, so I am marking this as resolved. I will have someone else fix the milestone.

comment:6 by Michael Caisse, 5 years ago

Milestone: Boost 1.59.0
Note: See TracTickets for help on using tickets.