Hi,

with the attached simple program I can always see that calling
XShmQueryExtension makes valgrind report a "still reachable" block:
$ valgrind --leak-check=full \
  --show-reachable=yes ./XShmQueryExtension_test

...
==27577== 24 bytes in 1 blocks are still reachable in loss record 1 of 1
==27577==    at 0x402894D: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27577==    by 0x4A30AFD: XextCreateExtension (in 
/usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==27577==    by 0x4A305A4: ??? (in /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==27577==    by 0x4A3091C: ??? (in /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==27577==    by 0x4A30D31: XextAddDisplay (in 
/usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==27577==    by 0x4A2B5B8: XShmQueryExtension (in 
/usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==27577==    by 0x4006D5: main (in 
/home/ao2/WIP/am7xxx-play/tests/XShmQueryExtension_test)
...

Maybe this is intended and not an actual bug, but I wanted to ask
here for confirmation.
So, is this message OK or a symptom of an actual bug?

I tried taking a look to libXext to figure out what is going on, but I
still lack precise knowledge about what a Display is in this context
and how the extension mechanism works so it is hard for me.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
/* 
 * Test to show a "still reachable" block when using XShmQueryExtension
 *
 * Compile with:
 * gcc -o XShmQueryExtension_test $(pkg-config --cflags --libs xext) XShmQueryExtension_test.c
 *
 * Run under valgrind:
 * valgrind --leak-check=full --show-reachable=yes ./XShmQueryExtension_test
 *
 */
#include <X11/Xlib.h>
#include <X11/extensions/XShm.h>

int main(void)
{
	Display *dpy;
	int use_shm;

	dpy = XOpenDisplay(":0.0");
	use_shm = XShmQueryExtension(dpy);

	XCloseDisplay(dpy);
	return 0;
}

Attachment: pgpAh09HGGqtJ.pgp
Description: PGP signature

_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com

Reply via email to