Commit 057fb0f
fix: leak HDF5 library handle to prevent cleanup issues
Root cause: When the OnceLock<Library> was dropped at process exit,
dlclose() was called on the HDF5 library. This triggered HDF5's
internal cleanup routines which caused 'infinite loop closing library'
and SIGSEGV on Linux, especially during parallel test execution.
Solution: Use Box::leak() to intentionally leak the library handle.
This prevents dlclose() from being called, keeping the HDF5 library
loaded until process termination. This is safe because:
1. We only load the library once per process
2. The OS will reclaim all memory on process exit
3. This is a common pattern for libraries with problematic cleanup
Also reverts the CI workaround (--test-threads=1) since the root
cause is now fixed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent b049974 commit 057fb0f
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
835 | | - | |
| 835 | + | |
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
844 | | - | |
| 844 | + | |
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
875 | 882 | | |
876 | 883 | | |
877 | 884 | | |
| |||
0 commit comments