[fred@fredo-arch ~]$ valgrind --track-origins=yes ./glxtest ==1989== Memcheck, a memory error detector ==1989== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==1989== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info ==1989== Command: ./glxtest ==1989== ==1989== Invalid read of size 4 ==1989== at 0x8DBA0BE: nouveau_fence_wait (nouveau_fence.c:205) ==1989== by 0x8E4AFF4: nv50_screen_destroy (nv50_screen.c:293) ==1989== by 0x8DAACDE: dri_destroy_screen_helper (dri_screen.c:378) ==1989== by 0x8DAAD74: dri_destroy_screen (dri_screen.c:388) ==1989== by 0x8AB13D6: driDestroyScreen (dri_util.c:234) ==1989== by 0x69A06C1: dri2DestroyScreen (dri2_glx.c:712) ==1989== by 0x697CFE5: FreeScreenConfigs.isra.3 (glxext.c:208) ==1989== by 0x697D064: glx_display_free (glxext.c:231) ==1989== by 0x697D164: __glXCloseDisplay (glxext.c:272) ==1989== by 0x50569F1: XCloseDisplay (in /usr/lib/libX11.so.6.3.0) ==1989== by 0x4010BE: glxtest() (in /home/fred/glxtest) ==1989== by 0x40110A: main (in /home/fred/glxtest) ==1989== Address 0x67cbaa0 is 16 bytes inside a block of size 48 free'd ==1989== at 0x4C2999C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1989== by 0x8DB9F73: nouveau_fence_update (nouveau_fence.h:48) ==1989== by 0x8DBA0BD: nouveau_fence_wait (nouveau_fence.c:203) ==1989== by 0x8E4AFF4: nv50_screen_destroy (nv50_screen.c:293) ==1989== by 0x8DAACDE: dri_destroy_screen_helper (dri_screen.c:378) ==1989== by 0x8DAAD74: dri_destroy_screen (dri_screen.c:388) ==1989== by 0x8AB13D6: driDestroyScreen (dri_util.c:234) ==1989== by 0x69A06C1: dri2DestroyScreen (dri2_glx.c:712) ==1989== by 0x697CFE5: FreeScreenConfigs.isra.3 (glxext.c:208) ==1989== by 0x697D064: glx_display_free (glxext.c:231) ==1989== by 0x697D164: __glXCloseDisplay (glxext.c:272) ==1989== by 0x50569F1: XCloseDisplay (in /usr/lib/libX11.so.6.3.0) ==1989== VENDOR nouveau RENDERER Gallium 0.4 on NVA8 VERSION 3.0 Mesa 10.1.0 TFP TRUE ==1989== ==1989== HEAP SUMMARY: ==1989== in use at exit: 22,964 bytes in 87 blocks ==1989== total heap usage: 3,614 allocs, 3,527 frees, 2,299,201 bytes allocated ==1989== ==1989== LEAK SUMMARY: ==1989== definitely lost: 768 bytes in 3 blocks ==1989== indirectly lost: 0 bytes in 0 blocks ==1989== possibly lost: 0 bytes in 0 blocks ==1989== still reachable: 22,196 bytes in 84 blocks ==1989== suppressed: 0 bytes in 0 blocks ==1989== Rerun with --leak-check=full to see details of leaked memory ==1989== ==1989== For counts of detected and suppressed errors, rerun with: -v ==1989== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 1 from 1)