[Python-modules-commits] r23411 - in packages/scipy/trunk/debian (3 files)

jtaylor-guest at users.alioth.debian.org jtaylor-guest at users.alioth.debian.org
Sun Jan 27 16:53:50 UTC 2013


    Date: Sunday, January 27, 2013 @ 16:53:48
  Author: jtaylor-guest
Revision: 23411

fix-dbg-crash.patch, fixes test crash with python-dbg

Added:
  packages/scipy/trunk/debian/patches/fix-dbg-crash.patch
Modified:
  packages/scipy/trunk/debian/changelog
  packages/scipy/trunk/debian/patches/series

Modified: packages/scipy/trunk/debian/changelog
===================================================================
--- packages/scipy/trunk/debian/changelog	2013-01-27 16:53:43 UTC (rev 23410)
+++ packages/scipy/trunk/debian/changelog	2013-01-27 16:53:48 UTC (rev 23411)
@@ -14,6 +14,7 @@
       - BUG-fix-dependency-on-dict-ordering-in-test.patch
       - fix-test_basic.py-cephes_vs_amos_mass_te.patch
       - python3.3-incdir.diff
+      - fix-dbg-crash.patch
   * add autopkgtests
   * run fast tests during build
 

Added: packages/scipy/trunk/debian/patches/fix-dbg-crash.patch
===================================================================
--- packages/scipy/trunk/debian/patches/fix-dbg-crash.patch	                        (rev 0)
+++ packages/scipy/trunk/debian/patches/fix-dbg-crash.patch	2013-01-27 16:53:48 UTC (rev 23411)
@@ -0,0 +1,126 @@
+From 4d7e7be0b8cbab48f8a55bf3d23d5f1e2e785eb9 Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen <pav at iki.fi>
+Date: Fri, 14 Dec 2012 20:56:26 +0200
+Subject: [PATCH 1/3] BUG: sparse.linalg: initialize variables correctly in
+ init and dealloc
+
+---
+ scipy/sparse/linalg/dsolve/_superluobject.c |   14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/scipy/sparse/linalg/dsolve/_superluobject.c b/scipy/sparse/linalg/dsolve/_superluobject.c
+index 4017a86..4496eea 100644
+--- a/scipy/sparse/linalg/dsolve/_superluobject.c
++++ b/scipy/sparse/linalg/dsolve/_superluobject.c
+@@ -131,11 +131,15 @@
+ {
+   SUPERLU_FREE(self->perm_r);
+   SUPERLU_FREE(self->perm_c);
++  self->perm_r = NULL;
++  self->perm_c = NULL;
+   if (self->L.Store != NULL) {
+       Destroy_SuperNode_Matrix(&self->L);
++      self->L.Store = NULL;
+   }
+   if (self->U.Store != NULL) {
+       Destroy_CompCol_Matrix(&self->U);
++      self->U.Store = NULL;
+   }
+   PyObject_Del(self);
+ }
+@@ -390,7 +394,6 @@ int NCFormat_from_spMatrix(SuperMatrix *A, int m, int n, int nnz,
+   superlu_options_t options;
+   SuperLUStat_t stat;
+   int panel_size, relax;
+-  int trf_finished = 0;
+ 
+   n = A->ncol;
+ 
+@@ -407,6 +410,8 @@ int NCFormat_from_spMatrix(SuperMatrix *A, int m, int n, int nnz,
+   self->n = n;
+   self->perm_r = NULL;
+   self->perm_c = NULL;
++  self->L.Store = NULL;
++  self->U.Store = NULL;
+   self->type = intype;
+ 
+   if (setjmp(_superlu_py_jmpbuf)) goto fail;
+@@ -438,7 +443,6 @@ int NCFormat_from_spMatrix(SuperMatrix *A, int m, int n, int nnz,
+             etree, NULL, lwork, self->perm_c, self->perm_r,
+             &self->L, &self->U, &stat, &info);
+   }
+-  trf_finished = 1;
+ 
+   if (info) {
+     if (info < 0)
+@@ -461,12 +465,6 @@ int NCFormat_from_spMatrix(SuperMatrix *A, int m, int n, int nnz,
+   return (PyObject *)self;
+ 
+ fail:
+-  if (!trf_finished) {
+-      /* Avoid trying to free partially initialized matrices;
+-         might leak some memory, but avoids a crash */
+-      self->L.Store = NULL;
+-      self->U.Store = NULL;
+-  }
+   SUPERLU_FREE(etree);
+   Destroy_CompCol_Permuted(&AC);
+   StatFree(&stat);
+-- 
+1.7.10
+
+
+From e8295335e0ad73e1cc54fba8dac43b3bed772264 Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen <pav at iki.fi>
+Date: Fri, 14 Dec 2012 20:57:05 +0200
+Subject: [PATCH 2/3] BUG: sparse.linalg: deallocate Python object correctly
+ (fixes #1789)
+
+---
+ scipy/sparse/linalg/dsolve/_superluobject.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scipy/sparse/linalg/dsolve/_superluobject.c b/scipy/sparse/linalg/dsolve/_superluobject.c
+index 4496eea..8060bc9 100644
+--- a/scipy/sparse/linalg/dsolve/_superluobject.c
++++ b/scipy/sparse/linalg/dsolve/_superluobject.c
+@@ -468,7 +468,7 @@ int NCFormat_from_spMatrix(SuperMatrix *A, int m, int n, int nnz,
+   SUPERLU_FREE(etree);
+   Destroy_CompCol_Permuted(&AC);
+   StatFree(&stat);
+-  SciPyLU_dealloc(self);
++  Py_DECREF(self);
+   return NULL;
+ }
+ 
+-- 
+1.7.10
+
+
+From da1864d3b47bfd39b7c6dc49475ca3dd8a93c3d0 Mon Sep 17 00:00:00 2001
+From: Pauli Virtanen <pav at iki.fi>
+Date: Fri, 14 Dec 2012 21:14:42 +0200
+Subject: [PATCH 3/3] BUG: sparse.linalg: initialize yet more variables in
+ superlu
+
+---
+ scipy/sparse/linalg/dsolve/_superluobject.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/scipy/sparse/linalg/dsolve/_superluobject.c b/scipy/sparse/linalg/dsolve/_superluobject.c
+index 8060bc9..078b131 100644
+--- a/scipy/sparse/linalg/dsolve/_superluobject.c
++++ b/scipy/sparse/linalg/dsolve/_superluobject.c
+@@ -414,6 +414,9 @@ int NCFormat_from_spMatrix(SuperMatrix *A, int m, int n, int nnz,
+   self->U.Store = NULL;
+   self->type = intype;
+ 
++  memset(&AC, 0, sizeof(SuperMatrix));
++  memset(&stat, 0, sizeof(SuperLUStat_t));
++
+   if (setjmp(_superlu_py_jmpbuf)) goto fail;
+   
+   /* Calculate and apply minimum degree ordering*/
+-- 
+1.7.10
+

Modified: packages/scipy/trunk/debian/patches/series
===================================================================
--- packages/scipy/trunk/debian/patches/series	2013-01-27 16:53:43 UTC (rev 23410)
+++ packages/scipy/trunk/debian/patches/series	2013-01-27 16:53:48 UTC (rev 23411)
@@ -4,3 +4,4 @@
 BUG-remove-inline-statement-rejected-by-cython.patch
 fix-test_basic.py-cephes_vs_amos_mass_te.patch
 python3.3-incdir.diff
+fix-dbg-crash.patch
\ No newline at end of file




More information about the Python-modules-commits mailing list