Commit 0ac7498
test(cufile): prime libcufile before parameter-set tests to avoid SIGFPE
Under pytest-randomly, the cuFile test module fatally crashes with SIGFPE in
CUFileDrv::ReadVersionInfo (unguarded div %rcx with rcx=0) inside
libcufile.so cuFileDriverOpen+0xe. The crash is deterministic given specific
test orderings and was reproducible with seed 2758108007.
Root cause is a libcufile 1.17.1 bug. Calling cuFileSetParameterSizeT (or
other pre-open configuration APIs) BEFORE the first cuFileDriverOpen leaves
an internal version list uninitialized; the next driver_open then divides by
its zero length. Minimal repro:
pytest tests/test_cufile.py::test_set_get_parameter_size_t \\
tests/test_cufile.py::test_buf_register_invalid_flags
Fix: add a module-scope autouse _cufile_driver_prewarm fixture that performs
one driver_open/driver_close before any test in the module runs. That single
cycle initializes libcufile's version list; both test regimes
(driver-open tests via the function-scope `driver` fixture, and
driver-closed parameter-set tests) then work under any ordering.
Also swap test_set_parameter_posix_pool_slab_array's inline driver_open/close
for the `driver` fixture. pytest fixture ordering guarantees driver_config
(which calls set_parameter_posix_pool_slab_array while closed) runs before
`driver` opens, matching the previous manual ordering.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent a8805e5 commit 0ac7498
1 file changed
+48
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
143 | 189 | | |
144 | 190 | | |
145 | 191 | | |
| |||
1896 | 1942 | | |
1897 | 1943 | | |
1898 | 1944 | | |
1899 | | - | |
1900 | | - | |
| 1945 | + | |
1901 | 1946 | | |
1902 | 1947 | | |
1903 | 1948 | | |
| |||
1907 | 1952 | | |
1908 | 1953 | | |
1909 | 1954 | | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
| 1955 | + | |
1916 | 1956 | | |
1917 | 1957 | | |
1918 | 1958 | | |
| |||
0 commit comments