Package: armadillo Version: 1:7.600.2+dfsg-1 Severity: important Tags: upstream
The upstream author has indicated that array sizes are being set incorrectly in the convolution functions, causing an aliasing bug. This impedes an essential functionality in armadillo. The upstream author has contributed the applied patch. -- System Information: Debian Release: 9.0 APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.9.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_IN.UTF-8, LC_CTYPE=en_IN.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) -- Kumar Appaiah
diff -cr armadillo-7.600.2/include/armadillo_bits/glue_conv_meat.hpp armadillo-7.600.2-bugfix/include/armadillo_bits/glue_conv_meat.hpp *** armadillo-7.600.2/include/armadillo_bits/glue_conv_meat.hpp 2016-06-17 02:16:11.000000000 +1000 --- armadillo-7.600.2-bugfix/include/armadillo_bits/glue_conv_meat.hpp 2016-06-17 02:16:12.000000000 +1000 *************** *** 28,35 **** const uword x_n_elem = x.n_elem; const uword out_n_elem = ((h_n_elem + x_n_elem) > 0) ? (h_n_elem + x_n_elem - 1) : uword(0); - (A_is_col) ? out.set_size(out_n_elem, 1) : out.set_size(1, out_n_elem); - if( (h_n_elem == 0) || (x_n_elem == 0) ) { out.zeros(); return; } --- 28,33 ---- *************** *** 52,57 **** --- 50,57 ---- arrayops::copy( &(xx_mem[h_n_elem_m1]), x_mem, x_n_elem ); + (A_is_col) ? out.set_size(out_n_elem, 1) : out.set_size(1, out_n_elem); + eT* out_mem = out.memptr(); for(uword i=0; i < out_n_elem; ++i) *************** *** 132,141 **** const uword out_n_rows = ((W.n_rows + G.n_rows) > 0) ? (W.n_rows + G.n_rows - 1) : uword(0); const uword out_n_cols = ((W.n_cols + G.n_cols) > 0) ? (W.n_cols + G.n_cols - 1) : uword(0); - out.set_size( out_n_rows, out_n_cols ); - if(G.is_empty() || W.is_empty()) { out.zeros(); return; } Mat<eT> H(G.n_rows, G.n_cols); // flipped filter coefficients const uword H_n_rows = H.n_rows; --- 132,140 ---- const uword out_n_rows = ((W.n_rows + G.n_rows) > 0) ? (W.n_rows + G.n_rows - 1) : uword(0); const uword out_n_cols = ((W.n_cols + G.n_cols) > 0) ? (W.n_cols + G.n_cols - 1) : uword(0); if(G.is_empty() || W.is_empty()) { out.zeros(); return; } + Mat<eT> H(G.n_rows, G.n_cols); // flipped filter coefficients const uword H_n_rows = H.n_rows; *************** *** 159,164 **** --- 158,166 ---- X( H_n_rows_m1, H_n_cols_m1, arma::size(W) ) = W; // zero padded version of 2D image + + out.set_size( out_n_rows, out_n_cols ); + for(uword col=0; col < out_n_cols; ++col) { eT* out_colptr = out.colptr(col);