From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2622 invoked by alias); 5 Apr 2003 06:26:57 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 2615 invoked from network); 5 Apr 2003 06:26:55 -0000 Received: from unknown (HELO e4.eyal.emu.id.au) (203.51.32.18) by sources.redhat.com with SMTP; 5 Apr 2003 06:26:55 -0000 Received: from eyal.emu.id.au (e7.eyal.emu.id.au [192.168.2.7]) by e4.eyal.emu.id.au (8.11.6/8.11.6) with ESMTP id h356Qgq14645; Sat, 5 Apr 2003 16:26:44 +1000 Received: from eyal.emu.id.au (really [192.168.2.7]) by eyal.emu.id.au via smail with esmtp id (Debian Smail3.2.0.114) for ; Sat, 5 Apr 2003 16:26:42 +1000 (EST) Message-ID: <3E8E7721.FAAEF08F@eyal.emu.id.au> Date: Sat, 05 Apr 2003 11:18:00 -0000 From: Eyal Lebedinsky Organization: Eyal at Home X-Accept-Language: en MIME-Version: 1.0 To: "list, gcc" , "Eigler, Frank Ch." Subject: Re: mudflap: how do I give size for 'void *' objects? - example References: <3E8CCC43.3F317393@eyal.emu.id.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00213.txt.bz2 Eyal Lebedinsky wrote: > > I have a problem where I get a large number of reported violations > when accessing objects acquired through something like > p = shmat() > where the size of the object is unknown (unless mudflap uses > extra internal knowledge). Here is a simple program that demonstrates the problem with ctime(). Note how the fprintf() works OK (no violation) but the strlen() fails. I assume that mudflap has its own strlen() wrapper that trips on the "foreign" pointer returned from ctime(). ----------------------------------------------------- #!/bin/sh mf="/usr/local/gcc-mudflap" cat >zz.c < #include #include int main () { time_t t; char *p; int l; t = time (NULL); p = ctime (&t); fprintf (stderr, "%s", p); l = (int)strlen (p); return (0); } EOF export LD_LIBRARY_PATH="$mf/lib" cc="$mf/bin/i686-pc-linux-gnu-gcc-3.5-tree-ssa -fmudflap -g -O0" #cc="gcc" test -f zz && rm zz $cc -Wall -o zz zz.c ./zz ----------------------------------------------------- -- Eyal Lebedinsky (eyal@eyal.emu.id.au)