Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 1995 13:21:55 +0300
From:      Gennady Sorokopud <gena@NetVision.net.il>
To:        "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
Cc:        Gennady Sorokopud <gena@NetVision.net.il>, <hackers@FreeBSD.org>
Subject:   Re: gcc-2.6.3 with bounds checking
Message-ID:  <XFMail.950703131811.gena@NetVision.net.il>
In-Reply-To: <199507031001.DAA18102@gndrsh.aac.dev.com>

next in thread | previous in thread | raw e-mail | index | archive | help

In message <199507031001.DAA18102@gndrsh.aac.dev.com> Rodney W. Grimes writes:
>> 
>> 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.

Hmm....seems like you right :-), but it still works...
Also the error disappeared after i changed the statement
to: if (ptr == NULL) ..

>
>> 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?

Not yet..i'm working on it...

>
>> 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 :-) :-).

That would be great, but i doubt it will work after reading
the documentation (it's huge - about 900k ps file)

>
>-- 
>Rod Grimes                                      rgrimes@gndrsh.aac.dev.com
>Accurate Automation Company                 Reliable computers for FreeBSD

--------
 Gennady B. Sorokopud - System programmer at NetVision Israel.
 E-Mail: gena@NetVision.net.il
 Homepage: http://www.netvision.net.il/~gena

 This message was sent at 07/03/95 13:18:11 by XF-Mail



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