Commit da268d4
authored
CI: use free-threaded build for ASAN tests (numpy#28391)
While working on numpygh-28390 today, I realized that ASAN can detect issues in the free-threaded build that are impossible to hit on the GIL-enabled build. In that PR the test I added showed failures under ASAN using free-threaded Python if I ran it against a version of NumPy from last week that was susceptible to memory corruption by running the test. On the GIL-enabled build, the GIL prevents the memory corruption.
For that reason, I think we can get more bang for our buck using a free-threaded interpreter to run the ASAN tests. I think the free-threaded build will catch almost all issues that the GIL-enabled build would catch as well as any problems that address sanitizer can check that are caused by race conditions. The only things we'd miss are from code in the #else block of an #if Py_GIL_DISABLED macro, and we don't really have any nontrivial code like that.
I also thought about using a build matrix with both the GIL-enabled and free-threaded interpreters but given what I said above, I think just one ASAN build is fine.1 parent 9e557eb commit da268d4
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
0 commit comments