[beignet] 03/03: Fail, don't assert, on failed context creation (Closes: #848792)

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Tue Jan 3 22:29:09 UTC 2017


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

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit 59e697a6bfa0eccc13f801e23e3dc9a828de37bf
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Tue Jan 3 22:25:54 2017 +0000

    Fail, don't assert, on failed context creation (Closes: #848792)
---
 debian/changelog                             |  1 +
 debian/patches/noassert-failed-context.patch | 40 ++++++++++++++++++++++++++++
 debian/patches/series                        |  1 +
 3 files changed, 42 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8060dc9..e7ccb8c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ beignet (1.2.1-2) UNRELEASED; urgency=medium
 
   * Fix invalid-iterator crash when compiling large kernels.
   * Switch to LLVM 3.9.
+  * Fail, don't assert, on failed context creation.  (Closes: #848792)
 
  -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Tue, 03 Jan 2017 21:52:36 +0000
 
diff --git a/debian/patches/noassert-failed-context.patch b/debian/patches/noassert-failed-context.patch
new file mode 100644
index 0000000..16e9d08
--- /dev/null
+++ b/debian/patches/noassert-failed-context.patch
@@ -0,0 +1,40 @@
+Description: Return error, don't assert-fail, on failed context_create
+
+As this function is used in the "check whether this is supported
+hardware" stage, it needs to not crash on failure.
+
+(The bug reporter's hardware was much too old for this package
+to actually work, but I don't know whether that is also the trigger
+for the bug.)
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Bug-Debian: https://bugs.debian.org/848792
+Forwarded: todo
+
+--- beignet-1.2.1.orig/src/intel/intel_driver.c
++++ beignet-1.2.1/src/intel/intel_driver.c
+@@ -133,11 +133,13 @@ intel_driver_memman_init(intel_driver_t
+   return 1;
+ }
+ 
+-static void
++static int
+ intel_driver_context_init(intel_driver_t *driver)
+ {
+   driver->ctx = drm_intel_gem_context_create(driver->bufmgr);
+-  assert(driver->ctx);
++  if (!driver->ctx)
++    return 0;
++  return 1;
+ }
+ 
+ static void
+@@ -156,7 +158,7 @@ intel_driver_init(intel_driver_t *driver
+   pthread_mutex_init(&driver->ctxmutex, NULL);
+ 
+   if (!intel_driver_memman_init(driver)) return 0;
+-  intel_driver_context_init(driver);
++  if (!intel_driver_context_init(driver)) return 0;
+ 
+ #if EMULATE_GEN
+   driver->gen_ver = EMULATE_GEN;
diff --git a/debian/patches/series b/debian/patches/series
index b5cad71..396ec2c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ docs-broken-links.patch
 cl_accelerator_intel.patch
 llvm39-support.patch
 avoid-invalid-iterator.patch
+noassert-failed-context.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list