From owner-freebsd-hackers Mon Jul 3 03:08:58 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id DAA28082 for hackers-outgoing; Mon, 3 Jul 1995 03:08:58 -0700 Received: from dns.netvision.net.il (root@dns.NetVision.net.il [194.90.1.5]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id DAA28074 for ; Mon, 3 Jul 1995 03:08:42 -0700 Received: from Burka.NetVision.net.il (root@burka.NetVision.net.il [194.90.6.15]) by dns.netvision.net.il (8.6.12/8.6.9) with ESMTP id NAA03043; Mon, 3 Jul 1995 13:08:33 +0300 Received: from gena@NetVision.net.il (burka.NetVision.net.il [194.90.6.15]) by Burka.NetVision.net.il (8.6.11/8.6.6) with SMTP id NAA00220; Mon, 3 Jul 1995 13:21:55 +0300 Date: Mon, 3 Jul 1995 13:21:55 +0300 In-Reply-To: <199507031001.DAA18102@gndrsh.aac.dev.com> Message-ID: X-Face: #v>4HN>#D_"[olq9y`HqTYkLVB89Xy|3')Vs9v58JQ*u-xEJVKY`xa.}E?z0RkLI/P&;BJmi0#u=W0).-Y'J4(dw{"54NhSG|YYZG@[)(`e! >jN#L!~qI5fE-JHS+< Organization: NetVision ltd. X-Mailer: XFMail 0.2-Beta on FreeBSD From: Gennady Sorokopud To: "Rodney W. Grimes" Subject: Re: gcc-2.6.3 with bounds checking Cc: Gennady Sorokopud , Sender: hackers-owner@FreeBSD.org Precedence: bulk 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