From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32371 invoked by alias); 22 Jul 2013 12:33:35 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29938 invoked by uid 48); 22 Jul 2013 12:31:33 -0000 From: "f.heckenbach@fh-soft.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/57920] [c++11] Linux: std::random_device reads too much from /dev/urandom Date: Mon, 22 Jul 2013 12:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: f.heckenbach@fh-soft.de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00999.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57920 --- Comment #6 from Frank Heckenbach --- (In reply to Paolo Carlini from comment #3) > I'm going to attach a patchlet which does the trick (fread -> read) for me. > Note I'm on purpose disabling the use of __builtin_ia32_rdrand32_step on my > x86_64 machine, the undef would not be in the committed patch of course. > > It would be great if you could test the change on your machines (in 4.7.x > just change random.h, no need to rebuild) and confirm that everything is > fine. I did the equivalent change to /usr/include/c++/4.7/bits/random.h and it works for me, thanks.