Skip to content

test_custom_weighted[client_RMSD0] yields "Fatal Python error: Segmentation fault" #5385

@sanvila

Description

@sanvila

Hello. While building the Debian package of mdanalysis, version 2.10.0, on machines with 1 and 2 CPUs from AWS, I get a segmentation fault from Python, and the tests timeout to the point that sbuild has to kill the building process.

testsuite/MDAnalysisTests/analysis/test_rms.py::TestRMSD::test_custom_weighted[client_RMSD0] Fatal Python error: Segmentation fault

Current thread 0x00007fe76eb9c200 (most recent call first):
  Garbage-collecting
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_mdanalysis/build/MDAnalysis/coordinates/XDR.py", line 204 in close
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_mdanalysis/build/MDAnalysis/coordinates/base.py", line 1533 in __del__
  File "/usr/lib/python3.13/logging/__init__.py", line 1498 in debug
  File "/usr/lib/python3/dist-packages/duecredit/injections/injector.py", line 310 in __import
  File "/usr/lib/python3.13/multiprocessing/reduction.py", line 51 in dumps
  File "/usr/lib/python3.13/multiprocessing/queues.py", line 391 in put
  File "/usr/lib/python3.13/multiprocessing/pool.py", line 131 in worker
  File "/usr/lib/python3.13/multiprocessing/process.py", line 108 in run
  File "/usr/lib/python3.13/multiprocessing/process.py", line 313 in _bootstrap
  File "/usr/lib/python3.13/multiprocessing/popen_fork.py", line 74 in _launch
  File "/usr/lib/python3.13/multiprocessing/popen_fork.py", line 20 in __init__
  File "__init__", line ??? in __init__
  <invalid frame>

Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, msgpack._cmsgpack, MDAnalysis.lib._cutil, _transformations, MDAnalysis.lib._augment, MDAnalysis.lib.nsgrid, MDAnalysis.lib.c_distances, MDAnalysis.lib.c_distances_openmp, MDAnalysis.lib.formats.cython_util, MDAnalysis.lib.formats.libmdaxdr, MDAnalysis.lib.formats.libdcd, cython.cimports.libc.math, sci
py._lib._ccallback_c, _cyutility, scipy._cyutility, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._pcg64, numpy.random._generator, numpy.random._mt19937, numpy.random._philox, numpy.random._sfc64, numpy.random.mtrand, charset_normalizer.md, charset_normalizer.cd, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetool
s, scipy.spatial._ckdtree, scipy._lib.messagestream, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg.cython_lapack, scipy.linalg._cythonized_array_utils, scipy.linalg._solve_toeplitz, scipy.linalg._decomp_lu_cython, scipy.linalg._matfuncs_schur_sqrtm, scipy.linalg._matfuncs_expm, scipy.linalg._linalg_pythran, scipy.linalg.cython_blas, scipy.linalg._decomp_update, scipy
.spatial._qhull, scipy.spatial._voronoi, scipy.special._ufuncs_cxx, scipy.special._ellip_harm_2, scipy.special._special_ufuncs, scipy.special._gufuncs, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.spatial._hausdorff, scipy.spatial._distance_wrap, scipy.spatial.transform._rotation, scipy.spatial.transform._rigid_transform, MDAnalysis.coordinates.time
step, gsd.fl, scipy.io.matlab._mio_utils, scipy.io.matlab._streams, scipy.io.matlab._mio5_utils, cftime._cftime, netCDF4._netCDF4, h5py._debian_h5py_serial._errors, h5py._debian_h5py_serial.defs, h5py._debian_h5py_serial._objects, h5py._debian_h5py_serial.h5, h5py._debian_h5py_serial.utils, h5py._debian_h5py_serial.h5t, h5py._debian_h5py_serial.h5s, h5py._debian_h5py_serial.h5a
c, h5py._debian_h5py_serial.h5p, h5py._debian_h5py_serial.h5r, h5py._debian_h5py_serial._npystrings, h5py._debian_h5py_serial._proxy, h5py._debian_h5py_serial._conv, h5py._debian_h5py_serial.h5z, h5py._debian_h5py_serial.h5a, h5py._debian_h5py_serial.h5d, h5py._debian_h5py_serial.h5ds, h5py._debian_h5py_serial.h5g, h5py._debian_h5py_serial.h5i, h5py._debian_h5py_serial.h5o, h5p
y._debian_h5py_serial.h5f, h5py._debian_h5py_serial.h5fd, h5py._debian_h5py_serial.h5pl, h5py._debian_h5py_serial.h5l, h5py._debian_h5py_serial._selector, h5py.atexit, h5py._errors, h5py.defs, h5py._objects, h5py.h5, h5py.utils, h5py.h5t, h5py.h5s, h5py.h5ac, h5py.h5p, h5py.h5r, h5py._npystrings, h5py._proxy, h5py._conv, h5py.h5z, h5py.h5a, h5py.h5d, h5py.h5ds, h5py.h5g, h5py.h
5i, h5py.h5o, h5py.h5f, h5py.h5fd, h5py.h5pl, h5py.h5l, h5py._selector, MDAnalysis.lib.qcprot, PIL._imaging, kiwisolver._cext, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.linalg._propack._spropack, scipy.sparse.linalg._propack._dpropack, scipy.sparse.linalg._propack._cpropack, scipy.sparse.linalg._propack._zpropack, scipy.optimi
ze._group_columns, scipy.optimize._trlib._trlib, scipy.optimize._lbfgsb, _moduleTNC, scipy.optimize._moduleTNC, scipy.optimize._slsqplib, scipy.optimize._minpack, scipy.optimize._lsq.givens_elimination, scipy.optimize._zeros, scipy._lib._uarray._uarray, scipy.linalg._decomp_interpolative, scipy.optimize._bglu_dense, scipy.optimize._lsap, scipy.optimize._direct, Bio.Nexus.cnexus
, scipy.integrate._odepack, scipy.integrate._quadpack, scipy.integrate._vode, scipy.integrate._dop, scipy.integrate._lsoda, scipy.interpolate._fitpack, scipy.interpolate._dfitpack, scipy.interpolate._dierckx, scipy.interpolate._ppoly, scipy.interpolate._interpnd, scipy.interpolate._rbfinterp_pythran, scipy.interpolate._rgi_cython, scipy.special.cython_special, scipy.stats._stat
s, scipy.stats._biasedurn, scipy.stats._stats_pythran, scipy.stats._levy_stable.levyst, scipy.stats._ansari_swilk_statistics, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.stats._sobol, 
scipy.stats._qmc_cy, scipy.stats._rcont.rcont, scipy.stats._qmvnt_cy, scipy.ndimage._nd_image, scipy.ndimage._rank_filter_1d, _ni_label, scipy.ndimage._ni_label, lz4._version, lz4.frame._frame, sklearn.__check_build._check_build, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pan
das._libs.tslibs.timezones, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.strptime, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_disp
atch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.lib, pandas._libs.ops, pandas._libs.hashing, pandas._libs.arrays, pandas._libs.tslib, pandas._libs.sparse, pandas._libs.internals, pandas._libs.indexing, pandas._libs.index, pandas._libs.writers, pandas._libs.join, pandas._libs.window.aggregations, pandas._libs.window.ind
exers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.json, pandas._libs.parsers, pandas._libs.testing, sklearn._cyutility, sklearn.utils._isfinite, sklearn.utils.sparsefuncs_fast, sklearn.utils.murmurhash, sklearn.utils._openmp_helpers, sklearn.metrics.cluster._expected_mutual_info_fast, sklearn.metrics._dist_metrics, sklearn.metrics._pairwise_distances_reduction._da
tasets_pair, sklearn.utils._cython_blas, sklearn.metrics._pairwise_distances_reduction._base, sklearn.metrics._pairwise_distances_reduction._middle_term_computer, sklearn.utils._heap, sklearn.utils._sorting, sklearn.metrics._pairwise_distances_reduction._argkmin, sklearn.metrics._pairwise_distances_reduction._argkmin_classmode, sklearn.utils._vector_sentinel, sklearn.metrics._pairwise_distances_reduction._radius_neighbors, sklearn.metrics._pairwise_distances_reduction._radius_neighbors_classmode, sklearn.metrics._pairwise_fast, sklearn.preprocessing._csr_polynomial_expansion, sklearn.preprocessing._target_encoder_fast, sklearn.utils._fast_dict, sklearn.cluster._hierarchical_fast, sklearn.cluster._k_means_common, sklearn.cluster._k_means_elkan, sklearn.cluster._k_means_lloyd, sklearn.cluster._k_means_minibatch, sklearn.cluster._dbscan_inner, sklearn.neighbors._partition_nodes, sklearn.neighbors._ball_tree, sklearn.neighbors._kd_tree, sklearn.utils.arrayfuncs, sklearn.utils._random, sklearn.utils._seq_dataset, sklearn.linear_model._cd_fast, _loss, sklearn._loss._loss, sklearn.linear_model._sag_fast, sklearn.svm._liblinear, sklearn.svm._libsvm, sklearn.svm._libsvm_sparse, sklearn.utils._weight_vector, sklearn.linear_model._sgd_fast, sklearn.decomposition._online_lda_fast, sklearn.decomposition._cdnmf_fast, sklearn.cluster._hdbscan._tree, sklearn.cluster._hdbscan._linkage, sklearn.cluster._hdbscan._reachability, sklearn._isotonic, sklearn.tree._utils, sklearn.tree._tree, sklearn.tree._partitioner, sklearn.tree._splitter, sklearn.tree._criterion, sklearn.neighbors._quad_tree, sklearn.manifold._barnes_hut_tsne, sklearn.manifold._utils, MDAnalysis.analysis.encore.cutils, MDAnalysis.analysis.encore.clustering.affinityprop, MDAnalysis.analysis.encore.dimensionality_reduction.stochasticproxembed (total: 274)
E: Build killed with signal TERM after 120 minutes of inactivity
--------------------------------------------------------------------------------
Build finished at 2026-05-25T03:21:49Z

This is essentially the same as #5078, which I probably closed prematurely, but I've decided to report it separately because the symptoms are now slightly different.

The python segfault suggests that some resources are being freed while they are still being used.

For reference, I've put several build logs here:

https://people.debian.org/~sanvila/build-logs/mdanalysis/

In the above directory:

  • version 2.10.0-1.5 was a private test where I took 2.10.0-1 and enabled tests again. The builds are "successful" except for the two failing tests (reported as TestXTCReader_offsets.test_offset_lock_created and TestTRRReader_offsets.test_offset_lock_created always fail #5382). Note that those builds were done using the old schroot backend of sbuild, where the segfaults did not happen yet.

  • version 2.10.0-2 is the version finally uploaded for Debian unstable, has those tests marked as XFAIL, but now I get privately the python segfaults (but not in the official Debian build daemons). I guess the tests are not ready to be executed with only 2 CPUs, but I'd like some confirmation for this before adding a conditional skip in the Debian package.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions