Bug 64791

Summary: swrast crashes with compiz
Product: Mesa Reporter: Pierre Ossman <pierre-bugzilla>
Component: OtherAssignee: mesa-dev
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: medium CC: astrand
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Pierre Ossman 2013-05-20 14:18:21 UTC
I'm getting a crash when using the classic swrast driver together with compiz.

I have no idea how this is supposed to work, but the issue is that getImage() gets called with NULL as the destination buffer. The calling function is swrastSetTexBuffer2(), and to me it looks a bit off.

The function fetches the current texture image (creating one if needed), modifies the fields and then calls getImage(). At no point does it adjust the size of the buffer to match the new fields though. So I guess that happened implicitly at some point, but doesn't anymore.

I applied this (in the spirit of similiar functions) and that got rid of the crash:

Index: mesa/src/mesa/drivers/dri/swrast/swrast.c
===================================================================
--- mesa/src/mesa/drivers/dri/swrast/swrast.c	(revision 27412)
+++ mesa/src/mesa/drivers/dri/swrast/swrast.c	(working copy)
@@ -94,9 +94,15 @@
     else
 	texFormat = MESA_FORMAT_ARGB8888;
 
+    /* Free old texture image */
+    dri_ctx->Base.Driver.FreeTextureImageBuffer(&dri_ctx->Base, texImage);
+
     _mesa_init_teximage_fields(&dri_ctx->Base, texImage,
 			       w, h, 1, 0, internalFormat, texFormat);
 
+    /* Allocate texture memory (no pixel data yet) */
+    dri_ctx->Base.Driver.AllocTextureImageBuffer(&dri_ctx->Base, texImage);
+
     sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)swImage->Buffer,
 				   dPriv->loaderPrivate);
 


Unfortunately it doesn't seem to create something that actually works.
Comment 1 Timothy Arceri 2018-04-12 11:50:27 UTC
Compiz and swrast are both dead projects. Closing as won't fix.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.