From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8775 invoked by alias); 21 Jul 2013 20:40:18 -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 6457 invoked by uid 48); 21 Jul 2013 20:38:16 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/57920] [c++11] Linux: std::random_device reads too much from /dev/urandom Date: Sun, 21 Jul 2013 20:40: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: paolo.carlini at oracle dot com 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: bug_status cf_reconfirmed_on assigned_to everconfirmed 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/msg00961.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57920 Paolo Carlini changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2013-07-21 Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com Ever confirmed|0 |1 --- Comment #3 from Paolo Carlini --- 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.