On Mon, Jan 07, 2013 at 02:09:02PM -0500, Stephen Gallagher wrote:
>One concern I expressed to Simo on IRC is that we'd have to
be more
>careful with long-lived requests such as resolving deep nested group
>memberships, otherwise the parent context will grow out of control.
>
>If SSS_FREE_MEM_CTX was used rigorously, then it would be much less of
>an issue. Maybe we could write a small GCC plugin to issue a warning for
>functions that call SSS_MEM_CTX but not SSS_FREE_MEM_CTX.
I'm not really familiar with GCC plugins, but can we model that to
detect whether a branch decision could allow it to exit without
calling SSS_FREE_MEM_CTX? I think some of the static analysis tools
like Coverity can do this, but I don't know if GCC itself can.
There is a plugin that tracks reference counts in Python plugins written
in C:
https://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html#refer...
I haven't seen its source code so I can't comment on how easy/hard it
is, but it seems doable.