[glm] 01/02: Fix FTBFS on i386. Closes: 860701

Guus Sliepen guus at moszumanska.debian.org
Wed Apr 19 14:43:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

guus pushed a commit to branch debian/master
in repository glm.

commit ffc6987f0b7a1daaa1d618b9c5ccf8f8bb29cb74
Author: Guus Sliepen <guus at debian.org>
Date:   Wed Apr 19 16:33:21 2017 +0200

    Fix FTBFS on i386. Closes: 860701
    
    - Prevent infinite loops in float_distance().
    - Use memcmp() in gtc_packing test to force comparisons in IEEE format.
---
 debian/patches/fix-infiloop     | 24 ++++++++++++++++
 debian/patches/fix-packing-test | 61 +++++++++++++++++++++++++++++++++++++++++
 debian/patches/series           |  2 ++
 3 files changed, 87 insertions(+)

diff --git a/debian/patches/fix-infiloop b/debian/patches/fix-infiloop
new file mode 100644
index 0000000..32fdb18
--- /dev/null
+++ b/debian/patches/fix-infiloop
@@ -0,0 +1,24 @@
+Description: Fix potential infinite loop in float_distance()
+Author: Guus Sliepen <guus at debian.org>
+Last-Update: 2017-04-19
+
+--- glm-0.9.8.3.orig/glm/gtc/ulp.inl
++++ glm-0.9.8.3/glm/gtc/ulp.inl
+@@ -287,7 +287,7 @@ namespace glm
+ 		if(x < y)
+ 		{
+ 			T temp = x;
+-			while(temp != y)// && ulp < std::numeric_limits<std::size_t>::max())
++			while(temp < y)// && ulp < std::numeric_limits<std::size_t>::max())
+ 			{
+ 				++ulp;
+ 				temp = next_float(temp);
+@@ -296,7 +296,7 @@ namespace glm
+ 		else if(y < x)
+ 		{
+ 			T temp = y;
+-			while(temp != x)// && ulp < std::numeric_limits<std::size_t>::max())
++			while(temp < x)// && ulp < std::numeric_limits<std::size_t>::max())
+ 			{
+ 				++ulp;
+ 				temp = next_float(temp);
diff --git a/debian/patches/fix-packing-test b/debian/patches/fix-packing-test
new file mode 100644
index 0000000..5251867
--- /dev/null
+++ b/debian/patches/fix-packing-test
@@ -0,0 +1,61 @@
+Description: Fix failure of gtc_packing test on i386 
+Author: Guus Sliepen <guus at debian.org>
+Last-Update: 2017-04-19
+
+--- glm-0.9.8.3.orig/test/gtc/gtc_packing.cpp
++++ glm-0.9.8.3/test/gtc/gtc_packing.cpp
+@@ -100,8 +100,8 @@ int test_Half4x16()
+ 		glm::u16vec4 p2 = glm::packHalf(v0);
+ 		glm::vec4 v2 = glm::unpackHalf(p2);
+ 
+-		Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
+-		Error += glm::all(glm::equal(v0, v2)) ? 0 : 1;
++		Error += !!memcmp(&v0, &v1, sizeof v0);
++		Error += !!memcmp(&v0, &v2, sizeof v0);
+ 	}
+ 
+ 	return Error;
+@@ -125,7 +125,7 @@ int test_I3x10_1x2()
+ 		glm::ivec4 v0 = glm::unpackI3x10_1x2(p0);
+ 		glm::uint32 p1 = glm::packI3x10_1x2(v0);
+ 		glm::ivec4 v1 = glm::unpackI3x10_1x2(p1);
+-		Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
++		Error += !!memcmp(&v0, &v1, sizeof v0);
+ 	}
+ 
+ 	return Error;
+@@ -149,7 +149,7 @@ int test_U3x10_1x2()
+ 		glm::uvec4 v0 = glm::unpackU3x10_1x2(p0);
+ 		glm::uint32 p1 = glm::packU3x10_1x2(v0);
+ 		glm::uvec4 v1 = glm::unpackU3x10_1x2(p1);
+-		Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
++		Error += !!memcmp(&v0, &v1, sizeof v0);
+ 	}
+ 
+ 	return Error;
+@@ -173,7 +173,7 @@ int test_Snorm3x10_1x2()
+ 		glm::vec4 v0 = glm::unpackSnorm3x10_1x2(p0);
+ 		glm::uint32 p1 = glm::packSnorm3x10_1x2(v0);
+ 		glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1);
+-		Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
++		Error += !!memcmp(&v0, &v1, sizeof v0);
+ 	}
+ 
+ 	return Error;
+@@ -197,7 +197,7 @@ int test_Unorm3x10_1x2()
+ 		glm::vec4 v0 = glm::unpackUnorm3x10_1x2(p0);
+ 		glm::uint32 p1 = glm::packUnorm3x10_1x2(v0);
+ 		glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1);
+-		Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
++		Error += !!memcmp(&v0, &v1, sizeof v0);
+ 	}
+ 
+ 	return Error;
+@@ -221,6 +221,7 @@ int test_F2x11_1x10()
+ 		glm::vec3 v0 = glm::unpackF2x11_1x10(p0);
+ 		glm::uint32 p1 = glm::packF2x11_1x10(v0);
+ 		glm::vec3 v1 = glm::unpackF2x11_1x10(p1);
++		Error += !!memcmp(&v0, &v1, sizeof v0);
+ 		Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
+ 	}
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 85f3cb9..59a61fc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 Fix-CMake-package-version-file.patch
+fix-infiloop
+fix-packing-test

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/glm.git



More information about the debian-science-commits mailing list