From owner-svn-src-all@FreeBSD.ORG Tue Oct 9 18:25:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A4CF933 for ; Tue, 9 Oct 2012 18:25:01 +0000 (UTC) (envelope-from ache@vniz.net) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 82CFB8FC0C for ; Tue, 9 Oct 2012 18:25:00 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so4785689lbd.13 for ; Tue, 09 Oct 2012 11:24:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:disposition-notification-to:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:openpgp :content-type:content-transfer-encoding:x-gm-message-state; bh=TVjcFz5S/PGFmD+VTcRMCphFZ9Eo0k+AYJLG+DfzOqY=; b=fIDeYpLIroOl0yFJ6ASw5eoSjaQHAxJbM1e0jK/HnSVxkmlQpJ0dl7JvyGBPhVUvZ1 MDd1mANQwOzGo0Q7ztLI8brwb2LRmRlB3rRw1ya9t7R2RK98kB6oKaiq+r6/sQG7bkjM UAUVmHpbk8Vp80tglZt1qHXj50WJzTCLw1FGGvvL7ZHHbKkSpl9wHH3uHu+gj42GZ+JR /SVoq4Y0aEGzmrjd3HisJ/VsEGcyfMNHbIkm9J/QeyLwaBskBXItokPaRQbfOmgdibW+ +YhumPKxUbaQskLXqOEmsdboJ93PtJ78vMw4B0Go5JBTorjyXSZMZoTtbzqNqgs6AP+C rwMQ== Received: by 10.112.38.134 with SMTP id g6mr8483301lbk.39.1349807098838; Tue, 09 Oct 2012 11:24:58 -0700 (PDT) Received: from [192.168.1.2] ([89.169.140.97]) by mx.google.com with ESMTPS id e4sm84017lby.12.2012.10.09.11.24.57 (version=SSLv3 cipher=OTHER); Tue, 09 Oct 2012 11:24:58 -0700 (PDT) Sender: "Chernov, Andrey" Message-ID: <50746BF8.5010307@freebsd.org> Date: Tue, 09 Oct 2012 22:24:56 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r241373 - head/lib/libc/stdlib References: <201210091425.q99EPFS6020787@svn.freebsd.org> <507451DE.9060909@freebsd.org> In-Reply-To: OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlcomfv8X3hQ+GdUa6WWXXuV6Q3Xrf6kFvCxYvvrE0Ns4P5KzOmGRvywbb/sQXLN7Pp5Rot Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, theraven@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2012 18:25:01 -0000 On 09.10.2012 21:47, Eitan Adler wrote: > On 9 October 2012 12:33, Andrey Chernov wrote: >> Do you check assembler output for _both_ cases? > > Yes. ... > http://blog.eitanadler.com/2012/10/reduced-entropy-in-rand-and-random.html At this URL I see only already known buggy assembler without 'volatile' keyword (which is fixed by adding 'volatile' in srandomdev()). As I already mention, adding 'volatile' helps any gcc and clang finally generated assembler code (checked by cc -S ...). What happens with LLVM intermediate code, I mean mentioned by David call void @srand(i32 undef) is a big question and perhaps clang bug. Please note that we use 'volatile' a lot in the kernel, just 'grep -r volatile /sys'. Some of that potentially can hit the same (probably) bug. And, in case it is the bug, it should be fixed in clang. > volatile is still undefined: see 5.1.2.2.3 and 6.7.2.4 of ISO9899 I don't have ISO9899 nearby, could you directly quote mentioned sections, please? Do you against 'volatile' usage at all? It seems whole kernel (see above) contradicts with such point of view.