From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Inter-procedural analysis.
Date: Sun, 23 Dec 2012 08:45:03 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.02.1212230835400.2003@hadrien> (raw)
In-Reply-To: <20121223001527.1af9e01b@vidarr>
On Sun, 23 Dec 2012, Rene Rydhof Hansen wrote:
> [...]
>
> One other thing you might consider is to first look for functions that
> acquire the lock and store the (names of) these functions in a
> hashtable, e.g., using the ocaml/python scripting capabilities of
> Coccinelle, and then use this hashtable to at least reduce the number
> of false positives.
>
> It doesn't solve all problems, but it's quick and easy to do.
Not so easy I think because there is no way to write a match that matches
any function that is stored in a hash table. You would have to do
something like the following:
find unbalanced functions and store them in a hash table
find
unlock at p1
... when any
when != unlock
f(...)
... when any
when != unlock
unlock at p
Look for f in the hash table. If it is found, put p1,p2 in another hash
table.
find
unlock at p1@p3
...
unlock at p2@p4
Look up p1,p2 in the hash table. If it is found, do
Coccilib.include_match false.
find
unlock at p3
...
unlock at p4
Report this as a bug.
But this is likely to be quite a bit slower to run than the previous
version, especially if there are a lot of function calls between locks.
And it only does one level of unfolding.
julia
next prev parent reply other threads:[~2012-12-23 7:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-22 20:39 [Cocci] Inter-procedural analysis Cyril Roelandt
2012-12-22 20:49 ` Julia Lawall
2012-12-22 21:31 ` Cyril Roelandt
2012-12-22 23:15 ` Rene Rydhof Hansen
2012-12-23 7:45 ` Julia Lawall [this message]
2012-12-23 7:33 ` Julia Lawall
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=alpine.DEB.2.02.1212230835400.2003@hadrien \
--to=julia.lawall@lip6.fr \
--cc=cocci@systeme.lip6.fr \
/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