From owner-freebsd-hackers Mon Jul 3 03:02:18 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id DAA27796 for hackers-outgoing; Mon, 3 Jul 1995 03:02:18 -0700 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id DAA27789 for ; Mon, 3 Jul 1995 03:02:13 -0700 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.11/8.6.9) id DAA18102; Mon, 3 Jul 1995 03:01:25 -0700 From: "Rodney W. Grimes" Message-Id: <199507031001.DAA18102@gndrsh.aac.dev.com> Subject: Re: gcc-2.6.3 with bounds checking To: gena@NetVision.net.il (Gennady Sorokopud) Date: Mon, 3 Jul 1995 03:01:24 -0700 (PDT) Cc: hackers@FreeBSD.org In-Reply-To: from "Gennady Sorokopud" at Jul 3, 95 12:59:17 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1539 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > Hello! > > In the last 2 days i experimented with bounds-checking gcc. > I find that it's very usefull debugging tool but it also has it's > drawbacks: > > 1) it's too strict :-( > For example it reports "reference to undefined pointer" > when you try something like: if (!ptr) ... > and ptr was not initialized before (i know, it's a bad style, > but not an error) It _is_ an error, referencing an object that is undefined is an undefined operation, the above if (!ptr) is indeterminate and would depend on what ever trash was in ptr :-(. This is more than just ``bad style'', the bounds-checking gcc has indeed pointed to a program flaw. > 2) if it finds an error it aborts the program, and this really bothers > if error is in some system library :-) > (I modified libcheck.a to "recover" after such situation but > it's still unstable) Humm, well, in a critical application that must not ever use bad data I would want it to abort and call my exit routines so I could get a bug report about it, but in a debug situation I would just like to see the errors flagged and the program continue. When you added this ``recover'' function, did you make it possible to turn it on and off with some type of knob? > If you want to try it, you can ftp it from: > ftp://Burka.NetVision.net.il/pub/bounds/cc_bounds.tar.gz Humm... wonder if it would work on the kernel :-) :-). -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Reliable computers for FreeBSD