Skip to content

Commit 1566cde

Browse files
KenoKristofferC
authored andcommitted
Fix CI hangs on win32
After much debugging, it turns out that OpenBlas is sometimes hanging on exit due to bad assumptions in its thread management. The upstream discussion is at OpenMathLib/OpenBLAS#2350, but this should fix our frequent win32 CI failures in the meantime.
1 parent f7d5d1e commit 1566cde

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

deps/patches/openblas-winexit.patch

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
commit 7f4a96a353c06c2fdecb0b2464800bcf8fab6fd7
1+
commit b16fa2e7111dc4dc1d9d987bd5dcbf89c82b9ee8
22
Author: Keno Fischer <[email protected]>
33
Date: Sun Dec 29 15:08:13 2019 -0500
44

@@ -10,18 +10,18 @@ Date: Sun Dec 29 15:08:13 2019 -0500
1010
of this function.
1111

1212
diff --git a/exports/dllinit.c b/exports/dllinit.c
13-
index 02ff092e..56aafa95 100644
13+
index 4a05c0e1..88f9af65 100644
1414
--- a/exports/dllinit.c
1515
+++ b/exports/dllinit.c
16-
@@ -48,7 +48,10 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
17-
}
18-
19-
if (reason == DLL_PROCESS_DETACH) {
20-
- gotoblas_quit();
21-
+ // If the process is about to exit, don't bother releasing any resources
22-
+ // The kernel is much better at bulk releasing then.
23-
+ if (!reserved)
24-
+ gotoblas_quit();
25-
}
26-
27-
return TRUE;
16+
@@ -50,7 +50,10 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
17+
gotoblas_init();
18+
break;
19+
case DLL_PROCESS_DETACH:
20+
- gotoblas_quit();
21+
+ // If the process is about to exit, don't bother releasing any resources
22+
+ // The kernel is much better at bulk releasing then.
23+
+ if (!reserved)
24+
+ gotoblas_quit();
25+
break;
26+
case DLL_THREAD_ATTACH:
27+
break;

0 commit comments

Comments
 (0)