LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
dlansy_1_norm_segfault.patch
Go to the documentation of this file.
1 Description: LAPACKE_dlansy et al cause segfault with 1-norm (upstream bug #135)
2 Origin: upstream, commit: r1587
3 Bug: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4793
4 Reviewed-by: Sébastien Villemot <sebastien@debian.org>
5 Last-Update: 2015-10-31
6 ---
7 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
8 --- a/lapacke/src/lapacke_clanhe.c
9 +++ b/lapacke/src/lapacke_clanhe.c
10 @@ -51,7 +51,7 @@ float LAPACKE_clanhe( int matrix_order,
11  #endif
12  /* Allocate memory for working array(s) */
13  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
14 - LAPACKE_lsame( norm, '0' ) ) {
15 + LAPACKE_lsame( norm, 'O' ) ) {
16  work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
17  if( work == NULL ) {
18  info = LAPACK_WORK_MEMORY_ERROR;
19 @@ -62,7 +62,7 @@ float LAPACKE_clanhe( int matrix_order,
20  res = LAPACKE_clanhe_work( matrix_order, norm, uplo, n, a, lda, work );
21  /* Release memory and exit */
22  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
23 - LAPACKE_lsame( norm, '0' ) ) {
24 + LAPACKE_lsame( norm, 'O' ) ) {
25  LAPACKE_free( work );
26  }
27  exit_level_0:
28 --- a/lapacke/src/lapacke_clansy.c
29 +++ b/lapacke/src/lapacke_clansy.c
30 @@ -51,7 +51,7 @@ float LAPACKE_clansy( int matrix_order,
31  #endif
32  /* Allocate memory for working array(s) */
33  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
34 - LAPACKE_lsame( norm, '0' ) ) {
35 + LAPACKE_lsame( norm, 'O' ) ) {
36  work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
37  if( work == NULL ) {
38  info = LAPACK_WORK_MEMORY_ERROR;
39 @@ -62,7 +62,7 @@ float LAPACKE_clansy( int matrix_order,
40  res = LAPACKE_clansy_work( matrix_order, norm, uplo, n, a, lda, work );
41  /* Release memory and exit */
42  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
43 - LAPACKE_lsame( norm, '0' ) ) {
44 + LAPACKE_lsame( norm, 'O' ) ) {
45  LAPACKE_free( work );
46  }
47  exit_level_0:
48 --- a/lapacke/src/lapacke_clantr.c
49 +++ b/lapacke/src/lapacke_clantr.c
50 @@ -52,7 +52,7 @@ float LAPACKE_clantr( int matrix_order,
51  #endif
52  /* Allocate memory for working array(s) */
53  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
54 - LAPACKE_lsame( norm, '0' ) ) {
55 + LAPACKE_lsame( norm, 'O' ) ) {
56  work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,m) );
57  if( work == NULL ) {
58  info = LAPACK_WORK_MEMORY_ERROR;
59 @@ -64,7 +64,7 @@ float LAPACKE_clantr( int matrix_order,
60  work );
61  /* Release memory and exit */
62  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
63 - LAPACKE_lsame( norm, '0' ) ) {
64 + LAPACKE_lsame( norm, 'O' ) ) {
65  LAPACKE_free( work );
66  }
67  exit_level_0:
68 --- a/lapacke/src/lapacke_dlansy.c
69 +++ b/lapacke/src/lapacke_dlansy.c
70 @@ -51,7 +51,7 @@ double LAPACKE_dlansy( int matrix_order,
71  #endif
72  /* Allocate memory for working array(s) */
73  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
74 - LAPACKE_lsame( norm, '0' ) ) {
75 + LAPACKE_lsame( norm, 'O' ) ) {
76  work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
77  if( work == NULL ) {
78  info = LAPACK_WORK_MEMORY_ERROR;
79 @@ -62,7 +62,7 @@ double LAPACKE_dlansy( int matrix_order,
80  res = LAPACKE_dlansy_work( matrix_order, norm, uplo, n, a, lda, work );
81  /* Release memory and exit */
82  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
83 - LAPACKE_lsame( norm, '0' ) ) {
84 + LAPACKE_lsame( norm, 'O' ) ) {
85  LAPACKE_free( work );
86  }
87  exit_level_0:
88 --- a/lapacke/src/lapacke_dlantr.c
89 +++ b/lapacke/src/lapacke_dlantr.c
90 @@ -52,7 +52,7 @@ double LAPACKE_dlantr( int matrix_order,
91  #endif
92  /* Allocate memory for working array(s) */
93  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
94 - LAPACKE_lsame( norm, '0' ) ) {
95 + LAPACKE_lsame( norm, 'O' ) ) {
96  work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
97  if( work == NULL ) {
98  info = LAPACK_WORK_MEMORY_ERROR;
99 @@ -64,7 +64,7 @@ double LAPACKE_dlantr( int matrix_order,
100  work );
101  /* Release memory and exit */
102  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
103 - LAPACKE_lsame( norm, '0' ) ) {
104 + LAPACKE_lsame( norm, 'O' ) ) {
105  LAPACKE_free( work );
106  }
107  exit_level_0:
108 --- a/lapacke/src/lapacke_slansy.c
109 +++ b/lapacke/src/lapacke_slansy.c
110 @@ -51,7 +51,7 @@ float LAPACKE_slansy( int matrix_order,
111  #endif
112  /* Allocate memory for working array(s) */
113  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
114 - LAPACKE_lsame( norm, '0' ) ) {
115 + LAPACKE_lsame( norm, 'O' ) ) {
116  work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
117  if( work == NULL ) {
118  info = LAPACK_WORK_MEMORY_ERROR;
119 @@ -62,7 +62,7 @@ float LAPACKE_slansy( int matrix_order,
120  res = LAPACKE_slansy_work( matrix_order, norm, uplo, n, a, lda, work );
121  /* Release memory and exit */
122  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
123 - LAPACKE_lsame( norm, '0' ) ) {
124 + LAPACKE_lsame( norm, 'O' ) ) {
125  LAPACKE_free( work );
126  }
127  exit_level_0:
128 --- a/lapacke/src/lapacke_slantr.c
129 +++ b/lapacke/src/lapacke_slantr.c
130 @@ -52,7 +52,7 @@ float LAPACKE_slantr( int matrix_order,
131  #endif
132  /* Allocate memory for working array(s) */
133  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
134 - LAPACKE_lsame( norm, '0' ) ) {
135 + LAPACKE_lsame( norm, 'O' ) ) {
136  work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,m) );
137  if( work == NULL ) {
138  info = LAPACK_WORK_MEMORY_ERROR;
139 @@ -64,7 +64,7 @@ float LAPACKE_slantr( int matrix_order,
140  work );
141  /* Release memory and exit */
142  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
143 - LAPACKE_lsame( norm, '0' ) ) {
144 + LAPACKE_lsame( norm, 'O' ) ) {
145  LAPACKE_free( work );
146  }
147  exit_level_0:
148 --- a/lapacke/src/lapacke_zlanhe.c
149 +++ b/lapacke/src/lapacke_zlanhe.c
150 @@ -51,7 +51,7 @@ double LAPACKE_zlanhe( int matrix_order,
151  #endif
152  /* Allocate memory for working array(s) */
153  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
154 - LAPACKE_lsame( norm, '0' ) ) {
155 + LAPACKE_lsame( norm, 'O' ) ) {
156  work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
157  if( work == NULL ) {
158  info = LAPACK_WORK_MEMORY_ERROR;
159 @@ -62,7 +62,7 @@ double LAPACKE_zlanhe( int matrix_order,
160  res = LAPACKE_zlanhe_work( matrix_order, norm, uplo, n, a, lda, work );
161  /* Release memory and exit */
162  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
163 - LAPACKE_lsame( norm, '0' ) ) {
164 + LAPACKE_lsame( norm, 'O' ) ) {
165  LAPACKE_free( work );
166  }
167  exit_level_0:
168 --- a/lapacke/src/lapacke_zlansy.c
169 +++ b/lapacke/src/lapacke_zlansy.c
170 @@ -51,7 +51,7 @@ double LAPACKE_zlansy( int matrix_order,
171  #endif
172  /* Allocate memory for working array(s) */
173  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
174 - LAPACKE_lsame( norm, '0' ) ) {
175 + LAPACKE_lsame( norm, 'O' ) ) {
176  work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
177  if( work == NULL ) {
178  info = LAPACK_WORK_MEMORY_ERROR;
179 @@ -62,7 +62,7 @@ double LAPACKE_zlansy( int matrix_order,
180  res = LAPACKE_zlansy_work( matrix_order, norm, uplo, n, a, lda, work );
181  /* Release memory and exit */
182  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
183 - LAPACKE_lsame( norm, '0' ) ) {
184 + LAPACKE_lsame( norm, 'O' ) ) {
185  LAPACKE_free( work );
186  }
187  exit_level_0:
188 --- a/lapacke/src/lapacke_zlantr.c
189 +++ b/lapacke/src/lapacke_zlantr.c
190 @@ -52,7 +52,7 @@ double LAPACKE_zlantr( int matrix_order,
191  #endif
192  /* Allocate memory for working array(s) */
193  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
194 - LAPACKE_lsame( norm, '0' ) ) {
195 + LAPACKE_lsame( norm, 'O' ) ) {
196  work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
197  if( work == NULL ) {
198  info = LAPACK_WORK_MEMORY_ERROR;
199 @@ -64,7 +64,7 @@ double LAPACKE_zlantr( int matrix_order,
200  work );
201  /* Release memory and exit */
202  if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
203 - LAPACKE_lsame( norm, '0' ) ) {
204 + LAPACKE_lsame( norm, 'O' ) ) {
205  LAPACKE_free( work );
206  }
207  exit_level_0: