[92299] trunk/dports/x11/mesa/files

jeremyhu at macports.org jeremyhu at macports.org
Tue Apr 24 10:48:58 PDT 2012


Revision: 92299
          https://trac.macports.org/changeset/92299
Author:   jeremyhu at macports.org
Date:     2012-04-24 10:48:58 -0700 (Tue, 24 Apr 2012)
Log Message:
-----------
mesa: Add the patches... svn add fail (#34193)

Added Paths:
-----------
    trunk/dports/x11/mesa/files/0001-glapi-Correct-size-of-allocated-_glapi_table-struct.patch
    trunk/dports/x11/mesa/files/0002-apple-Fix-a-use-after-free.patch
    trunk/dports/x11/mesa/files/0003-darwin-Eliminate-a-pthread-mutex-leak.patch

Added: trunk/dports/x11/mesa/files/0001-glapi-Correct-size-of-allocated-_glapi_table-struct.patch
===================================================================
--- trunk/dports/x11/mesa/files/0001-glapi-Correct-size-of-allocated-_glapi_table-struct.patch	                        (rev 0)
+++ trunk/dports/x11/mesa/files/0001-glapi-Correct-size-of-allocated-_glapi_table-struct.patch	2012-04-24 17:48:58 UTC (rev 92299)
@@ -0,0 +1,32 @@
+From bb30e76328e9dd80b0c7a7688828e3cf8e662b1b Mon Sep 17 00:00:00 2001
+From: Jonas Maebe <jonas.maebe at elis.ugent.be>
+Date: Sun, 22 Apr 2012 20:39:32 -0700
+Subject: [PATCH 1/3] glapi: Correct size of allocated _glapi_table struct
+
+The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
+as an array of _glapi_get_dispatch_table_size() pointers, so we have to
+allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather
+than sizeof(struct _glapi_struct) bytes.
+
+Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
+(cherry picked from commit 8d09f4d0cc8d2ac5398c8b26638d5659429a4280)
+---
+ src/mapi/glapi/glapi_gentable.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mapi/glapi/glapi_gentable.c b/src/mapi/glapi/glapi_gentable.c
+index 5c04801..640c495 100644
+--- a/src/mapi/glapi/glapi_gentable.c
++++ b/src/mapi/glapi/glapi_gentable.c
+@@ -105,7 +105,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) {
+ 
+ struct _glapi_table *
+ _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
+-    struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table));
++    struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void *));
+     char symboln[512];
+ 
+     if(!disp)
+-- 
+1.7.10
+

Added: trunk/dports/x11/mesa/files/0002-apple-Fix-a-use-after-free.patch
===================================================================
--- trunk/dports/x11/mesa/files/0002-apple-Fix-a-use-after-free.patch	                        (rev 0)
+++ trunk/dports/x11/mesa/files/0002-apple-Fix-a-use-after-free.patch	2012-04-24 17:48:58 UTC (rev 92299)
@@ -0,0 +1,37 @@
+From 6095a17534c2694760300701fee59a320950f271 Mon Sep 17 00:00:00 2001
+From: Jonas Maebe <jonas.maebe at elis.ugent.be>
+Date: Mon, 23 Apr 2012 16:02:16 -0700
+Subject: [PATCH 2/3] apple: Fix a use after free
+
+Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
+(cherry picked from commit c60ffd2840036af1ea6f2b6c6e1e9014bb8e2c34)
+---
+ src/glx/apple/apple_glx_surface.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c
+index 39f5130..d42fa3b 100644
+--- a/src/glx/apple/apple_glx_surface.c
++++ b/src/glx/apple/apple_glx_surface.c
+@@ -206,6 +206,10 @@ apple_glx_surface_destroy(unsigned int uid)
+    if (d) {
+       d->types.surface.pending_destroy = true;
+       d->release(d);
++
++      /* apple_glx_drawable_find_by_uid returns a locked drawable */
++      d->unlock(d);
++
+       /* 
+        * We release 2 references to the surface.  One was acquired by
+        * the find, and the other was leftover from a context, or 
+@@ -217,7 +221,5 @@ apple_glx_surface_destroy(unsigned int uid)
+        * by a glViewport callback (see apple_glx_context_update()).
+        */
+       d->destroy(d);
+-
+-      d->unlock(d);
+    }
+ }
+-- 
+1.7.10
+

Added: trunk/dports/x11/mesa/files/0003-darwin-Eliminate-a-pthread-mutex-leak.patch
===================================================================
--- trunk/dports/x11/mesa/files/0003-darwin-Eliminate-a-pthread-mutex-leak.patch	                        (rev 0)
+++ trunk/dports/x11/mesa/files/0003-darwin-Eliminate-a-pthread-mutex-leak.patch	2012-04-24 17:48:58 UTC (rev 92299)
@@ -0,0 +1,40 @@
+From 69d8a25d429bccf960e98e5c126e1ef2ae4ffe9d Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Mon, 23 Apr 2012 16:43:22 -0700
+Subject: [PATCH 3/3] darwin: Eliminate a pthread mutex leak
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+Tested-by: Charles Davis <cdavis at mines.edu>
+(cherry picked from commit 1a33c1b2b895566299ec76643659adacc239a3dc)
+---
+ src/glx/apple/apple_glx_drawable.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c
+index 5530224..db28302 100644
+--- a/src/glx/apple/apple_glx_drawable.c
++++ b/src/glx/apple/apple_glx_drawable.c
+@@ -135,6 +135,7 @@ release_drawable(struct apple_glx_drawable *d)
+ static bool
+ destroy_drawable(struct apple_glx_drawable *d)
+ {
++   int err;
+ 
+    d->lock(d);
+ 
+@@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d)
+ 
+    apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d);
+ 
++   err = pthread_mutex_destroy(&d->mutex);
++   if (err) {
++      fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err));
++      abort();
++   }
++   
+    free(d);
+ 
+    /* So that the locks are balanced and the caller correctly unlocks. */
+-- 
+1.7.10
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120424/08bed907/attachment.html>


More information about the macports-changes mailing list