Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 1995 03:01:24 -0700 (PDT)
From:      "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
To:        gena@NetVision.net.il (Gennady Sorokopud)
Cc:        hackers@FreeBSD.org
Subject:   Re: gcc-2.6.3 with bounds checking
Message-ID:  <199507031001.DAA18102@gndrsh.aac.dev.com>
In-Reply-To: <XFMail.950703125210.gena@NetVision.net.il> from "Gennady Sorokopud" at Jul 3, 95 12:59:17 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507031001.DAA18102>