By the way, It seems to me that the tool is using RegisterResourceReleaseCallback to reset the function nest level. But since there's a case where the mechanism doesn't work, I suspect that the callback can be missed in some cases of error return, which seems to be a bug if it is true..
# I haven't confirmed that behavior by myself, though.
it should be executed
/* * Register or deregister callback functions for resource cleanup * * These functions are intended for use by dynamically loaded modules. * For built-in modules we generally just hardwire the appropriate calls. * * Note that the callback occurs post-commit or post-abort, so the callback * functions can only do noncritical cleanup. */ void RegisterResourceReleaseCallback(ResourceReleaseCallback callback, void *arg) {
but it is based on resource owner, so timing can be different than you expect
Regards
Pavel
regards.
-- Kyotaro Horiguchi NTT Open Source Software Center