title: Openblas cblas segmentation fault on non square matrix
body: <p>I'm having trouble running an openblas cblas test program. My Cblas runs perfectly when multiplying square matrixes, but when I try it with non square matrixes, I get the error "segmentation fault - core dumped"
  I checked and rechecked dimension problems but they seem to be right, so I am wondering what may be wrong. When I type m=200 instead of m=300 it works perfectly. </p>
  
  <p>For instance, the following program does not work </p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;stdlib.h&gt;
  
      extern "C"
      {
      #include &lt;cblas.h&gt;
      }
  
  
  
      using namespace std;
  
      int main()
      {
          double *a,*x, *y, *z;
          int m,k;
          m=300; k=200;
  
          a = (double *) malloc( m*k*sizeof( double ));
          x = (double *) malloc (k*sizeof(double));
          y = (double *) malloc (m*sizeof(double));
          z = (double *) malloc (m*sizeof(double));
  
          int i;
  
          for (i = 0; i &lt; (m*k); ++i)
          {
              a[i] = 1;
          }
  
          for (i = 0; i &lt; (k); ++i)
          {
              x[i] = 1;
          }
  
          for (i = 0; i &lt; (m); ++i)
          {
              y[i] = 100 ;
          }
  
          cblas_dcopy(m,y,1,z,1);
          cblas_dgemv(CblasRowMajor,CblasNoTrans,m,k,1.0, a ,m ,x, 1, 1.0, z, 1);
  
  
          for (int i = 0; i&lt;m; ++i)
          {
               cout&lt;&lt;z[i]&lt;&lt;endl;
          }
  
          free (a);
          free (x) ;
          free (y) ;
          free (z) ;
  
          return 0;
          }
  </code></pre>
  
  <p>Thanks a lot in advance</p>