Skip to content

Small memory leaks stemming from glXCreateNewContext

Valgrind reports the following leaks at exit. It looks like glXCreateNewContext is called without a corresponding glXDestroyContext call:

2,352 bytes in 49 blocks are definitely lost in loss record 9,692 of 9,846
   at 0x48447A8: malloc (vg_replace_malloc.c:446)
   by 0xAB30BCA: ralloc_size (ralloc.c:118)
   by 0xAB30BCA: ralloc_context (ralloc.c:105)
   by 0xAB57C8E: mesa_cache_db_open (mesa_cache_db.c:613)
   by 0xAB38873: mesa_cache_db_multipart_open (mesa_cache_db_multipart.c:42)
   by 0xAB2807B: disk_cache_type_create (disk_cache.c:145)
   by 0xAB28235: disk_cache_create (disk_cache.c:286)
   by 0xB22B1C5: lp_disk_cache_create (lp_screen.c:1016)
   by 0xB22B80A: llvmpipe_screen_late_init (lp_screen.c:1110)
   by 0xB22EA6B: llvmpipe_create_context (lp_context.c:206)
   by 0xABCA6B7: st_api_create_context (st_manager.c:986)
   by 0xAAE8954: dri_create_context (dri_context.c:178)
   by 0xAAEC708: driCreateContextAttribs (dri_util.c:652)
   by 0xAA202E9: drisw_create_context_attribs (drisw_glx.c:642)
   by 0xAA1F6B7: dri_common_create_context (dri_common.c:662)
   by 0xAA22EE1: CreateContext (glxcmds.c:322)
   by 0xAA23161: glXCreateNewContext (glxcmds.c:1449)
   by 0xA9DD768: glXCreateNewContext (libglx.c:261)
   by 0x127AC6: init_glx (compositor.c:1449)
   by 0x127AC6: compositorManageScreen (compositor.c:4938)
   by 0x137768: init_compositor_screen (main.c:452)
   by 0x137768: initialize (main.c:549)
   by 0x137768: main (main.c:702)

2,784 (128 direct, 2,656 indirect) bytes in 1 blocks are definitely lost in loss record 9,711 of 9,846
   at 0x48447A8: malloc (vg_replace_malloc.c:446)
   by 0xAB30C2D: ralloc_size (ralloc.c:118)
   by 0xAB2CC2F: _mesa_hash_table_create (hash_table.c:182)
   by 0xB06C45A: array_key_table_create (glsl_types.c:1242)
   by 0xB06C45A: glsl_array_type (glsl_types.c:1264)
   by 0xAFE0AE3: nir_lower_uniforms_to_ubo (nir_lower_uniforms_to_ubo.c:148)
   by 0xB80D436: ttn_finalize_nir (tgsi_to_nir.c:2537)
   by 0xB81804E: tgsi_to_nir (tgsi_to_nir.c:2654)
   by 0xB255460: llvmpipe_create_fs_state (lp_state_fs.c:3990)
   by 0xB147D8C: util_make_fs_clear_all_cbufs (u_simple_shaders.c:1337)
   by 0xB8043CE: util_blitter_cache_all_shaders (u_blitter.c:1372)
   by 0xB22ED28: llvmpipe_create_context (lp_context.c:317)
   by 0xABCA6B7: st_api_create_context (st_manager.c:986)
   by 0xAAE8954: dri_create_context (dri_context.c:178)
   by 0xAAEC708: driCreateContextAttribs (dri_util.c:652)
   by 0xAA202E9: drisw_create_context_attribs (drisw_glx.c:642)
   by 0xAA1F6B7: dri_common_create_context (dri_common.c:662)
   by 0xAA22EE1: CreateContext (glxcmds.c:322)
   by 0xAA23161: glXCreateNewContext (glxcmds.c:1449)
   by 0xA9DD768: glXCreateNewContext (libglx.c:261)
   by 0x127AC6: init_glx (compositor.c:1449)
   by 0x127AC6: compositorManageScreen (compositor.c:4938)
   by 0x137768: init_compositor_screen (main.c:452)
   by 0x137768: initialize (main.c:549)
   by 0x137768: main (main.c:702)

Version info: 94f5695b