On Wed, Oct 17, 2001 at 07:44:02PM -0700, Mark Vojkovich wrote:
> On Wed, 17 Oct 2001, Justin Husted wrote:
> 
> > Hi,
> > 
> > I've been looking for a useful way to debug client resource leaks with X
> > without much luck, so I thought I'd ask here.
> 
>   In xc/programs/Xserver/dix/resource.c:FreeClientResources() the 
> resources that are left unfreed when the client quits/dies are cleaned
> up.  You can see their XIDs and types (ie. pixmap, colormap, etc...)
> in that function.  Maybe that is of use to you.

Thanks...

This seems to work fairly well, though of course the information given is
somewhat limited.

Perhaps a better approach would be to build a debugging capability into Xlib,
so (when the debug mode is on) all calls that allocate a resource on the X
server also allocate some data on the client's heap (and where data is already
allocated on the heap, make sure some data is allocated that will only be freed
with the proper free/destroy call, to catch something like an incorrect call to
XFree).  This would allow a developer to use standard heap leak tracing
methodologies, which work pretty well and can give one more useful information,
such as a stack trace.

I suspect such a debug mode could be free (eg., no performance hit when off) on
platforms like Linux, by using some LD_PRELOAD tricks...


Thank you,
Justin Husted

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to