From owner-svn-src-head@FreeBSD.ORG Tue Oct 9 18:25:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1608932 for ; Tue, 9 Oct 2012 18:25:00 +0000 (UTC) (envelope-from ache@vniz.net) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 67C428FC0A for ; Tue, 9 Oct 2012 18:25:00 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so3943700lag.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=P9L+3BetbwHXs23vZec/2IL3am3ZEIfTqWmCPAfYl/6HrR+pLCjWsbSjXb3ucJlxQj fSxhVC3Cf272yVj7O4Bc/o7u68C3gWHYgSnmBNvn4i1PMU/QZq4a+A3ANqU9X080nLUS HE0Bf1tXZLMhPJfoCu2I1Qc+vgPR1vaWhIqzq7gbmY5ayy6QhUdIqwm4ZM8FcAiMt+Wu 8u2n/PGUjIKnVx/zPgikd3eOY6wtFmV7J6rvGVamkeM4pitd51RZSNzPb0RYfUbZ5ga9 ekF67usj0HQyfLLavtqCrRdrEf6qSxHebdZk/beuBolH2TGdNOJ/UU/heJ8NVEOHJ0ap gCsw== 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: ALoCoQkdpTCkupTZqClGWeM4BQdki84ZN+W4DIVncaGO+v1jFCaYpnme4cGizHSWWAJUo+8LdSvu Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, theraven@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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.