Bug#850033: libepoxy: diff for NMU version 1.3.1-1.1

2017-06-23 Thread Gianfranco Costamagna

Hello Jérémy


>I just tried and can confirm that:
>
>- it still crashes at version 1.3.1-1
>- it still does not crash when reverting 8d58c8906 after version 1.3.1-2


so, it seems 8d58c8906 was not really needed

>i'm tempted to upload that fix right now to unstable, but you clearly have a 
>better
>view of what's the best move - so i'll do as you think it's best.
yes please, and if you want, please include my add-null-checks.patch patch!

I have upstreamed it, even if now with 1.4.0 that code changed in some parts.
That patch should be safe for unstable since it just checks for more null 
pointers and return
false in case, instead of crashing

G.
--- libepoxy-1.3.1.orig/src/dispatch_common.c
+++ libepoxy-1.3.1/src/dispatch_common.c
@@ -347,7 +347,7 @@ epoxy_conservative_gl_version(void)
 bool
 epoxy_extension_in_string(const char *extension_list, const char *ext)
 {
-if (!extension_list)
+if (!extension_list || !ext)
 return false;
 const char *ptr = extension_list;
 int len = strlen(ext);
@@ -382,6 +382,7 @@ epoxy_internal_has_gl_extension(const ch
 
 for (i = 0; i < num_extensions; i++) {
 const char *gl_ext = (const char *)glGetStringi(GL_EXTENSIONS, i);
+if(! gl_ext) return false;
 if (strcmp(ext, gl_ext) == 0)
 return true;
 }
--- libepoxy-1.3.1.orig/src/dispatch_egl.c
+++ libepoxy-1.3.1/src/dispatch_egl.c
@@ -43,12 +43,16 @@ epoxy_egl_version(EGLDisplay dpy)
 {
 int major, minor;
 const char *version_string;
-int ret;
+int ret=0, sscanf_ret;
 
-version_string = eglQueryString(dpy, EGL_VERSION);
-ret = sscanf(version_string, "%d.%d", &major, &minor);
-assert(ret == 2);
-return major * 10 + minor;
+if ((version_string = eglQueryString(dpy, EGL_VERSION)))
+{
+sscanf_ret = sscanf(version_string, "%d.%d", &major, &minor);
+assert(sscanf_ret == 2);
+ret = major * 10 + minor;
+}
+
+return ret;
 }
 
 bool


debdiff
Description: Binary data


Bug#850033: libepoxy: diff for NMU version 1.3.1-1.1

2017-06-23 Thread Jérémy Lal
2017-06-24 0:12 GMT+02:00 Gianfranco Costamagna :

> control: unarchive -1
> control: reopen -1
>
> Hello,
> On Fri, 20 Jan 2017 23:32:45 +0100 =?UTF-8?B?SsOpcsOpbXkgTGFs?= <
> kapo...@melix.org> wrote:
> > 2017-01-20 23:26 GMT+01:00 Simon McVittie :
> >> Version: 1.3.1-1.1
> >>
> >> On Fri, 20 Jan 2017 at 23:19:54 +0100, Jérémy Lal wrote:
> >>> I thought i did what was necessary - the 1.3.1-2 i uploaded today has
> the
> >>> changelog entry of the 1.3.1-1.1 nmu.
> >>> Do i miss something ?
> >>
> >> Ah, I think I see what's happened... you didn't pass -v1.3.1-1 to
> >> dpkg-buildpackage (and the NMU never reached the archive because your
> >> maintainer upload preempted it), so the .changes didn't mention #850033,
> >> so the BTS didn't close the bug. Closing it now.
> >
> > Right. It's easy to forget that. Thank you for fixing it.
> >
>
> one of the three commits is causing a lot of problems, and I think it
> should be reverted
> https://bugs.launchpad.net/ubuntu/+source/libepoxy/+bug/1698233
> https://github.com/anholt/libepoxy/issues/130
>
> I'm asking upstream to revert it right now, please try to see if the issue
> is fixed anyway without it
> https://github.com/anholt/libepoxy/commit/8d58c890646fc1f43bcab702bb9ed6
> bae94daefe


I just tried and can confirm that:

- it still crashes at version 1.3.1-1
- it still does not crash when reverting 8d58c8906

after
version 1.3.1-2

i'm tempted to upload that fix right now to unstable, but you clearly have
a better
view of what's the best move - so i'll do as you think it's best.

Jérémy


Bug#850033: libepoxy: diff for NMU version 1.3.1-1.1

2017-06-23 Thread Gianfranco Costamagna

Hello,
On Fri, 20 Jan 2017 23:32:45 +0100 =?UTF-8?B?SsOpcsOpbXkgTGFs?= 
 wrote:
> 2017-01-20 23:26 GMT+01:00 Simon McVittie :
>> Version: 1.3.1-1.1
>>
>> On Fri, 20 Jan 2017 at 23:19:54 +0100, Jérémy Lal wrote:
>>> I thought i did what was necessary - the 1.3.1-2 i uploaded today has the
>>> changelog entry of the 1.3.1-1.1 nmu.
>>> Do i miss something ?
>>
>> Ah, I think I see what's happened... you didn't pass -v1.3.1-1 to
>> dpkg-buildpackage (and the NMU never reached the archive because your
>> maintainer upload preempted it), so the .changes didn't mention #850033,
>> so the BTS didn't close the bug. Closing it now.
>
> Right. It's easy to forget that. Thank you for fixing it.
>

one of the three commits is causing a lot of problems, and I think it should be 
reverted
https://bugs.launchpad.net/ubuntu/+source/libepoxy/+bug/1698233
https://github.com/anholt/libepoxy/issues/130

I'm asking upstream to revert it right now, please try to see if the issue is 
fixed anyway without it
https://github.com/anholt/libepoxy/commit/8d58c890646fc1f43bcab702bb9ed6bae94daefe

G.




signature.asc
Description: OpenPGP digital signature


Bug#850033: libepoxy: diff for NMU version 1.3.1-1.1

2017-06-23 Thread Gianfranco Costamagna
control: unarchive -1
control: reopen -1

Hello,
On Fri, 20 Jan 2017 23:32:45 +0100 =?UTF-8?B?SsOpcsOpbXkgTGFs?= 
 wrote:
> 2017-01-20 23:26 GMT+01:00 Simon McVittie :
>> Version: 1.3.1-1.1
>>
>> On Fri, 20 Jan 2017 at 23:19:54 +0100, Jérémy Lal wrote:
>>> I thought i did what was necessary - the 1.3.1-2 i uploaded today has the
>>> changelog entry of the 1.3.1-1.1 nmu.
>>> Do i miss something ?
>>
>> Ah, I think I see what's happened... you didn't pass -v1.3.1-1 to
>> dpkg-buildpackage (and the NMU never reached the archive because your
>> maintainer upload preempted it), so the .changes didn't mention #850033,
>> so the BTS didn't close the bug. Closing it now.
>
> Right. It's easy to forget that. Thank you for fixing it.
>

one of the three commits is causing a lot of problems, and I think it should be 
reverted
https://bugs.launchpad.net/ubuntu/+source/libepoxy/+bug/1698233
https://github.com/anholt/libepoxy/issues/130

I'm asking upstream to revert it right now, please try to see if the issue is 
fixed anyway without it
https://github.com/anholt/libepoxy/commit/8d58c890646fc1f43bcab702bb9ed6bae94daefe

G.




signature.asc
Description: OpenPGP digital signature


Bug#850033: libepoxy: diff for NMU version 1.3.1-1.1

2017-01-20 Thread Simon McVittie
On Thu, 19 Jan 2017 at 01:34:22 +0100, Jeremy Lal wrote:
> I've prepared an NMU for libepoxy (versioned as 1.3.1-1.1) and
> uploaded it to DELAYED/5. Please feel free to tell me if I
> should delay it longer.

Now that you're the maintainer, do you want to incorporate your own NMU? :-)

Ubuntu have a patch for some NULL dereferences which might cover more than
this one. Perhaps include any fixes that remain in that, and reference

in the changelog? The origin of that patch seems to be
.

Regards,
S



Bug#850033: libepoxy: diff for NMU version 1.3.1-1.1

2017-01-18 Thread Jeremy Lal
Control: tags 850033 + patch
Control: tags 850033 + pending

Dear maintainer,

I've prepared an NMU for libepoxy (versioned as 1.3.1-1.1) and
uploaded it to DELAYED/5. Please feel free to tell me if I
should delay it longer.

Regards.
diff -Nru libepoxy-1.3.1/debian/changelog libepoxy-1.3.1/debian/changelog
--- libepoxy-1.3.1/debian/changelog 2015-08-29 16:10:12.0 +0200
+++ libepoxy-1.3.1/debian/changelog 2017-01-19 01:19:17.0 +0100
@@ -1,3 +1,10 @@
+libepoxy (1.3.1-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport three upstream commits. (Closes: #850033) 
+
+ -- Jérémy Lal   Thu, 19 Jan 2017 01:19:17 +0100
+
 libepoxy (1.3.1-1) unstable; urgency=low
 
   * Upgrade to upstream v1.3.1 release and make the -dev package multi-arch.
diff -Nru libepoxy-1.3.1/debian/patches/series 
libepoxy-1.3.1/debian/patches/series
--- libepoxy-1.3.1/debian/patches/series1970-01-01 01:00:00.0 
+0100
+++ libepoxy-1.3.1/debian/patches/series2017-01-19 00:40:06.0 
+0100
@@ -0,0 +1,3 @@
+upstream/b3b8bd9af7bf1fcfe544fd131f4d4f0d117ae7bc.patch
+upstream/8d58c890646fc1f43bcab702bb9ed6bae94daefe.patch
+upstream/b8d609e8f9fc1f9c4ff359adb2c1c44619a9e7cf.patch
diff -Nru 
libepoxy-1.3.1/debian/patches/upstream/8d58c890646fc1f43bcab702bb9ed6bae94daefe.patch
 
libepoxy-1.3.1/debian/patches/upstream/8d58c890646fc1f43bcab702bb9ed6bae94daefe.patch
--- 
libepoxy-1.3.1/debian/patches/upstream/8d58c890646fc1f43bcab702bb9ed6bae94daefe.patch
   1970-01-01 01:00:00.0 +0100
+++ 
libepoxy-1.3.1/debian/patches/upstream/8d58c890646fc1f43bcab702bb9ed6bae94daefe.patch
   2017-01-19 00:41:22.0 +0100
@@ -0,0 +1,50 @@
+From: Yaron Cohen-Tal 
+Date: Mon, 21 Sep 2015 19:58:03 +0300
+Subject: [PATCH] Fix "epoxy_egl_get_current_gl_context_api" to use
+ "eglQueryContext" with "EGL_CONTEXT_CLIENT_TYPE" as "attribute".
+
+---
+ src/dispatch_common.c | 32 +++-
+ 1 file changed, 7 insertions(+), 25 deletions(-)
+
+--- a/src/dispatch_common.c
 b/src/dispatch_common.c
+@@ -569,31 +569,13 @@
+ static EGLenum
+ epoxy_egl_get_current_gl_context_api(void)
+ {
+-EGLenum save_api = eglQueryAPI();
+-EGLContext ctx;
+-
+-if (eglBindAPI(EGL_OPENGL_API)) {
+-ctx = eglGetCurrentContext();
+-if (ctx) {
+-eglBindAPI(save_api);
+-return EGL_OPENGL_API;
+-}
+-} else {
+-(void)eglGetError();
+-}
+-
+-if (eglBindAPI(EGL_OPENGL_ES_API)) {
+-ctx = eglGetCurrentContext();
+-eglBindAPI(save_api);
+-if (ctx) {
+-eglBindAPI(save_api);
+-return EGL_OPENGL_ES_API;
+-}
+-} else {
+-(void)eglGetError();
+-}
+-
+-return EGL_NONE;
++EGLDisplay eglDisplay = eglGetCurrentDisplay();
++EGLContext eglContext = eglGetCurrentContext();
++EGLint eglContextClientType = EGL_NONE;
++return  eglQueryContext(eglDisplay, eglContext, 
EGL_CONTEXT_CLIENT_TYPE,
++&eglContextClientType) == EGL_TRUE
++   ?(EGLenum)eglContextClientType
++   :EGL_NONE;
+ }
+ #endif /* PLATFORM_HAS_EGL */
+ 
diff -Nru 
libepoxy-1.3.1/debian/patches/upstream/b3b8bd9af7bf1fcfe544fd131f4d4f0d117ae7bc.patch
 
libepoxy-1.3.1/debian/patches/upstream/b3b8bd9af7bf1fcfe544fd131f4d4f0d117ae7bc.patch
--- 
libepoxy-1.3.1/debian/patches/upstream/b3b8bd9af7bf1fcfe544fd131f4d4f0d117ae7bc.patch
   1970-01-01 01:00:00.0 +0100
+++ 
libepoxy-1.3.1/debian/patches/upstream/b3b8bd9af7bf1fcfe544fd131f4d4f0d117ae7bc.patch
   2017-01-19 00:41:15.0 +0100
@@ -0,0 +1,51 @@
+From: Yaron Cohen-Tal 
+Date: Tue, 29 Sep 2015 11:57:55 +0300
+Subject: [PATCH] Fix "epoxy_glx_version" to handle the case when GLX is not
+ active on the display.
+
+---
+ src/dispatch_glx.c | 29 +++--
+ 1 file changed, 15 insertions(+), 14 deletions(-)
+
+diff --git a/src/dispatch_glx.c b/src/dispatch_glx.c
+index f1ff447..36d513a 100644
+--- a/src/dispatch_glx.c
 b/src/dispatch_glx.c
+@@ -54,22 +54,23 @@ epoxy_glx_version(Display *dpy, int screen)
+ int client_major, client_minor;
+ int server, client;
+ const char *version_string;
+-int ret;
++int ret=0, sscanf_ret;
+ 
+-version_string = glXQueryServerString(dpy, screen, GLX_VERSION);
+-ret = sscanf(version_string, "%d.%d", &server_major, &server_minor);
+-assert(ret == 2);
+-server = server_major * 10 + server_minor;
++if ((version_string = glXQueryServerString(dpy, screen, GLX_VERSION)))
++{
++sscanf_ret = sscanf(version_string, "%d.%d", &server_major, 
&server_minor);
++assert(sscanf_ret == 2);
++server = server_major * 10 + server_minor;
++if ((version_string = glXGetClientString(dpy, GLX_VERSION)))
++{
++sscanf_ret = sscanf(version_string, "%d.%d", &client_major, 
&client_minor);
++assert(sscanf_ret == 2);
++