Willy,

On 3/15/22 08:26, Willy Tarreau wrote:
Or perhaps you could ask and include
me in Cc, at least people already know you. I'll be happy to further improve
the existing Coccinelle patches and to further 'ist'ify the codebase, but
would need some handholding to get me started.

Note that beyond changing code, one thing that would be extremely useful
would be to build up a collection of patches to detect certain classes of
bugs. I wrote some scripts that used to match improbable expressions like:

     unlikely(E) < 0

But I can't figure how to make them match anymore, or they match too much
thus for me the behavior has always been a bit random and I never know if
I can trust the absence of a match.

If you send over your existing Coccinelle files I can have a look into cleaning them up and then committing them.

Overall this is still a fantastic tool but it requires a significant and
sustained investment to really unleash its power. Unfortunately in a small
project like haproxy most often it takes less time to perform a few changes
by hand than to try to figure a reliable way to express what we want.


At least for the ist.cocci new cases pop up every now and then and the rules within that file are all very very simple. So for that the investment into writing the patches is worth it I believe.

I think the hard part is not so much "performing the changes by hand", but rather "reliably finding the places by hand". Using grep to find accesses of '.ptr' for an ist is going to turn up all kinds of unrelated stuff.

Best regards
Tim Düsterhus

Reply via email to