public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eyal Lebedinsky <eyal@eyal.emu.id.au>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: "list, gcc" <gcc@gcc.gnu.org>
Subject: Re: mudflap: how do I give size for 'void *' objects? - example
Date: Sun, 06 Apr 2003 13:39:00 -0000	[thread overview]
Message-ID: <3E8F9FE5.ED8FFCE@eyal.emu.id.au> (raw)
In-Reply-To: <20030405152716.GA16333@redhat.com>

"Frank Ch. Eigler" wrote:
> 
> Hi -
> 
> On Sat, Apr 05, 2003 at 04:26:41PM +1000, 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).
> 
> In general, libmudflap does not have suitable wrapper functions
> already, the application may manually register/unregister
> objects using functions declared in mf-runtime.h.

Good, I now wrapped ctime() and shmat() with __mf_[un]register()
calls and this removed the reports. BTW, for such foreign objects,
how do I set the size when it is unknown (e.g. for 'ctime' I now
cheat and say '64'), and what type do I use (I use GUESS)?

And just to be sure I did not miss a post, the getmem/usemem example
does show a real problem, right? It is this one that gets me mostly,
filling up my logs (it trips a few times per record in a sort
program).

> You're not looking at a stack trace.  These strings are not extracted
> from the debugging information, but is rather constructed at compile-time
> into literal strings from the trees, to identify the check site or
> variable.

So, the "location=`zz.c:19 (usemem)'" is from compile time, but the
following traceback is from glibc runtime? I never saw line numbers
in this trace, only hex offsets, and I do use '-g'. Can I make it
show line numbers (am I missing an option)? Just to indicate what
gives me this trouble, here is an example report which I find very
hard to use:

*******
mudflap violation 2 (check/read): time=1049594102.444443 ptr=415aba22
size=2 pc=
40b39bac location=`(memcmp 1st arg)'
      /usr/local/gcc-mudflap/lib/libmudflap.so.0(__mfwrap_memcmp+0x13c)
[0x40b39
bac]
      /ssa/builds/20030404n/bin/libssaiok.so [0x40a85d51]
      /ssa/builds/20030404n/bin/libssaiok.so [0x40a84c93]
Nearby object 1: checked region begins 444922B into and ends 444923B
into
mudflap object 083ab778: name=`malloc region'
Nearby object 2: checked region begins 444922B into and ends 444923B
into
mudflap object 08398d20: name=`malloc region'

My libssaiok.so is very large, and use extensively, and I do not see
how I can relate the report context to my sources.

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

  reply	other threads:[~2003-04-06  3:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04  1:27 mudflap: how do I give size for 'void *' objects? Eyal Lebedinsky
2003-04-05 11:18 ` mudflap: how do I give size for 'void *' objects? - example Eyal Lebedinsky
2003-04-05 21:17   ` Frank Ch. Eigler
2003-04-06 13:39     ` Eyal Lebedinsky [this message]
2003-04-07 19:54       ` Frank Ch. Eigler
2003-04-08  0:08         ` Eyal Lebedinsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E8F9FE5.ED8FFCE@eyal.emu.id.au \
    --to=eyal@eyal.emu.id.au \
    --cc=fche@redhat.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).