From owner-freebsd-stable Tue Jan 23 12: 7:47 2001 Delivered-To: freebsd-stable@freebsd.org Received: from mail.wgate.com (mail.wgate.com [38.219.83.4]) by hub.freebsd.org (Postfix) with ESMTP id D6F2037B400; Tue, 23 Jan 2001 12:07:28 -0800 (PST) Received: from jesup.eng.tvol.net ([10.32.2.26]) by mail.wgate.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id CX5HSM6D; Tue, 23 Jan 2001 15:07:27 -0500 Reply-To: Randell Jesup To: obrien@FreeBSD.ORG Cc: Randell Jesup , freebsd-stable@FreeBSD.ORG Subject: Re: "Malloc type lacks magic" show-stopper solved References: <20001105113907.B2656@dragon.nuxi.com> From: Randell Jesup Date: 23 Jan 2001 15:10:35 -0500 In-Reply-To: "David O'Brien"'s message of "Sun, 5 Nov 2000 11:39:07 -0800" Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "David O'Brien" writes: >On Thu, Nov 02, 2000 at 11:37:09AM -0500, Randell Jesup wrote: >> -O2 should work. I've never seen a bug with -O2 code generation >> from GCC (not that they can't happen, of course). Most bugs I've seen in >> my career with optimization levels were actually timing holes in the >> source code, where someone was accessing a shared resource and counting >> on ordering/etc, or bugs with accessing hardware registers where structures >> weren't properly marked volatile. >> >> If there's a problem, find it and report it. IMHO. > >Love to, but its often too hard -- unless handing over an entire kernel >source directory as the test case showing the bug is acceptable. (Response to an old article) The point I was trying to make was that my first assumption would be that the bug is due to race conditions or missing 'volatile' statements, probably in hardware drivers or code that interacts with CPU hardware (page tables, etc). Perhaps it's a holdover (in habits) from the days before useful optimizers in Unix C compilers. When one typically runs/compiles unoptimized code (or minimally optimized code), it's easy to get out of the habit of using volatile. (Witness all the 'register' statements in Unix kernels, which almost any compiler worth it's salt should ignore.) Now, certainly there are LOTS of volatile statements in the kernel - but it only takes a few (or even one) missing volatile to leave you in danger from optimizers. And just because -O happens to work doesn't mean there isn't a hole - it may just be smaller, or it may show up the next time the compiler is revved, or if someone uses a different compiler, or ports to a different architecture. And, as I mentioned, perhaps it's a -O2 compiler bug, in which case I want to see it fixed anyways. It wouldn't surprise me if there's only one or two problems (in the kernel or compiler). IMHO. -- Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94) rjesup@wgate.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message