{"action":"created","issue":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/697","labels_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/697/labels{/name}","comments_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/697/comments","events_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/697/events","html_url":"https://github.com/xianyi/OpenBLAS/issues/697","id":118342697,"number":697,"title":"Segfault in dgeev on Windows 64 bit","user":{"login":"tkelman","id":5934628,"avatar_url":"https://avatars.githubusercontent.com/u/5934628?v=3","gravatar_id":"","url":"https://api.github.com/users/tkelman","html_url":"https://github.com/tkelman","followers_url":"https://api.github.com/users/tkelman/followers","following_url":"https://api.github.com/users/tkelman/following{/other_user}","gists_url":"https://api.github.com/users/tkelman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkelman/subscriptions","organizations_url":"https://api.github.com/users/tkelman/orgs","repos_url":"https://api.github.com/users/tkelman/repos","events_url":"https://api.github.com/users/tkelman/events{/privacy}","received_events_url":"https://api.github.com/users/tkelman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xianyi/OpenBLAS/labels/Bug","name":"Bug","color":"d95050"}],"state":"open","locked":false,"assignee":{"login":"xianyi","id":371600,"avatar_url":"https://avatars.githubusercontent.com/u/371600?v=3","gravatar_id":"","url":"https://api.github.com/users/xianyi","html_url":"https://github.com/xianyi","followers_url":"https://api.github.com/users/xianyi/followers","following_url":"https://api.github.com/users/xianyi/following{/other_user}","gists_url":"https://api.github.com/users/xianyi/gists{/gist_id}","starred_url":"https://api.github.com/users/xianyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xianyi/subscriptions","organizations_url":"https://api.github.com/users/xianyi/orgs","repos_url":"https://api.github.com/users/xianyi/repos","events_url":"https://api.github.com/users/xianyi/events{/privacy}","received_events_url":"https://api.github.com/users/xianyi/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-11-23T09:14:46Z","updated_at":"2015-12-01T07:53:02Z","closed_at":null,"body":"I'm seeing this in 0.2.15 on both 64 bit Cygwin and MinGW-w64. Test program:\r\n```c\r\n#include <stdint.h>\r\n#include <stdlib.h>\r\n#include <stdio.h>\r\n#define BLASINT int32_t\r\nvoid dgeev_(char*, char*, BLASINT*, double*, BLASINT*, double*, double*,\r\n    double*, BLASINT*, double*, BLASINT*, double*, BLASINT*, BLASINT*);\r\nint main() {\r\nchar jobvl = 'N';\r\nchar jobvr = 'N';\r\nBLASINT n = 1000;\r\ndouble *A = malloc(n*n*sizeof(double));\r\nBLASINT lda = n;\r\ndouble *WR = malloc(n*sizeof(double));\r\ndouble *WI = malloc(n*sizeof(double));\r\ndouble *VL;\r\nBLASINT ldvl = n;\r\ndouble *VR;\r\nBLASINT ldvr = n;\r\ndouble *work = malloc(1*sizeof(double));\r\nBLASINT lwork = -1;\r\nBLASINT info[1];\r\nBLASINT i, j;\r\nfor (i=0; i<n; i++) {\r\n    for (j=0; j<n; j++) {\r\n        A[n*i+j] = n*(((double)rand()/(double)RAND_MAX) - 0.5);\r\n    }\r\n}\r\ndgeev_(&jobvl, &jobvr, &n, A, &lda, WR, WI,\r\n    VL, &ldvl, VR, &ldvr, work, &lwork, info);\r\nprintf(\"info[0] is %d\\n\", info[0]);\r\nprintf(\"lwork is %d\\n\", lwork);\r\nprintf(\"work[0] is %g\\n\", work[0]);\r\nlwork = work[0];\r\nfree(work);\r\nwork = malloc(lwork*sizeof(double));\r\ndgeev_(&jobvl, &jobvr, &n, A, &lda, WR, WI,\r\n    VL, &ldvl, VR, &ldvr, work, &lwork, info);\r\nprintf(\"info[0] is %d\\n\", info[0]);\r\nprintf(\"lwork is %d\\n\", lwork);\r\nprintf(\"work[0] is %g\\n\", work[0]);\r\n}\r\n```\r\n\r\ngdb output (this is with cygwin 64's openblas library, looks very similar with Julia's mingw-w64 build):\r\n```\r\nTony@TK-samsung ~/julia\r\n$ gcc -g 5728.c -o 5728 -llapack\r\n\r\nTony@TK-samsung ~/julia\r\n$ gdb -q ./5728\r\nReading symbols from ./5728...done.\r\n(gdb) r\r\nStarting program: /home/Tony/julia/5728\r\n[New Thread 10000.0xa7c]\r\n[New Thread 10000.0x19f8]\r\n[New Thread 10000.0x108c]\r\n[New Thread 10000.0x27cc]\r\n[New Thread 10000.0x200c]\r\n[New Thread 10000.0x21f0]\r\n[New Thread 10000.0x1398]\r\n[New Thread 10000.0x276c]\r\n[New Thread 10000.0x2118]\r\n[New Thread 10000.0xdb0]\r\ninfo[0] is 0\r\nlwork is -1\r\nwork[0] is 34000\r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x00000003f186ad50 in cygblas-0!blas_memory_free () from /usr/bin/cygblas-0.dll\r\n(gdb) bt\r\n#0  0x00000003f186ad50 in cygblas-0!blas_memory_free () from /usr/bin/cygblas-0.dll\r\n#1  0x00000003f161eff8 in dgemv_ () from /usr/bin/cygblas-0.dll\r\n#2  0x00000003d7c75fae in dlahr2_ () from /usr/lib/lapack/cyglapack-0.dll\r\n#3  0x00000003d7c2f8ec in dgehrd_ () from /usr/lib/lapack/cyglapack-0.dll\r\n#4  0x00000003d7c2c1f3 in dgeev_ () from /usr/lib/lapack/cyglapack-0.dll\r\n#5  0x0000000100401359 in main () at 5728.c:36\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/comments/160887063","html_url":"https://github.com/xianyi/OpenBLAS/issues/697#issuecomment-160887063","issue_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/697","id":160887063,"user":{"login":"tkelman","id":5934628,"avatar_url":"https://avatars.githubusercontent.com/u/5934628?v=3","gravatar_id":"","url":"https://api.github.com/users/tkelman","html_url":"https://github.com/tkelman","followers_url":"https://api.github.com/users/tkelman/followers","following_url":"https://api.github.com/users/tkelman/following{/other_user}","gists_url":"https://api.github.com/users/tkelman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkelman/subscriptions","organizations_url":"https://api.github.com/users/tkelman/orgs","repos_url":"https://api.github.com/users/tkelman/repos","events_url":"https://api.github.com/users/tkelman/events{/privacy}","received_events_url":"https://api.github.com/users/tkelman/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T07:53:02Z","updated_at":"2015-12-01T07:53:02Z","body":"@xianyi it looks from my local testing like this doesn't happen on Haswell, only earlier kernels. My laptop is a Sandy Bridge. I'm testing Marco's patch now, and will close this if 0.2.15 plus that patch is enough to fix the segfault."}}