Skip to contentSkip to conversation

nv50: fix crash in nv50_pre_pipebuffer_map (nv50_screen->cur_ctx)

PATCH In review Marcin Slusarz 1 participant 2 messages Jan 20, 2010 – Jan 24, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nv50: fix crash in nv50_pre_pipebuffer_map (nv50_screen->cur_ctx)

nv50_pre_pipebuffer_map references screen->cur_ctx which points to freed memory after the context is destroyed.
This crash is easily triggerable by progs/xdemos/glxcontexts.

---
 src/gallium/drivers/nv50/nv50_context.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
src/gallium/drivers/nv50/nv50_context.c +4 -0
index d598f0e..952741c 100644
@@ -82,6 +82,10 @@ nv50_destroy(struct pipe_context *pipe)
 		so_ref(NULL, &nv50->state.vtxattr);
 
 	draw_destroy(nv50->draw);
+	
+	if (nv50->screen->cur_ctx == nv50)
+		nv50->screen->cur_ctx = NULL;
+	
 	FREE(nv50);
 }
 
Signature · 1 line
1.6.6

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 3 lines · Marcin Slusarz

nv50_pre_pipebuffer_map references screen->cur_ctx which points to freed memory after the context is destroyed.
This crash is easily triggerable by progs/xdemos/glxcontexts.

ping