Discussion:
how to automatically generate a backtrace from within sbuild
(too old to reply)
PICCA Frederic-Emmanuel
2025-03-12 10:40:01 UTC
Permalink
Hello during the build of vitables, the reunit test fail with a segfault.

platform linux -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>
configfile: pyproject.toml
plugins: typeguard-4.4.2, xvfb-3.0.0
collected 72 items

tests/test_calculator.py . [ 1%]
tests/test_filenode.py ...... [ 9%]
tests/test_logger.py ..... [ 16%]
tests/test_samples.py . [ 18%]
tests/test_start.py ....F........... [ 40%]
tests/test_utils.py ............Fatal Python error: Segmentation fault

Current thread 0x00007f16c01c2780 (most recent call first):
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 142 in runtestprotocol
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 113 in pytest_runtest_protocol
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 362 in pytest_runtestloop
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 337 in _main
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 283 in wrap_session
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 330 in pytest_cmdline_main
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513 in __call__
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 175 in main
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 201 in console_main
File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 9 in <module>
File "<frozen runpy>", line 88 in _run_code
File "<frozen runpy>", line 198 in _run_module_as_main

Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, tables._comp_lzo, tables._comp_bzip2, tables.utilsextension, numexpr.interpreter, tables.hdf5extension, tables.linkextension, tables.lrucacheextension, tables.tableextension, tables.indexesextension, PyQt6.QtCore, PyQt6.QtGui, PyQt6.QtWidgets, PyQt6.QtOpenGL, PyQt6.QtOpenGLWidgets, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, charset_normalizer.md (total: 26)
Segmentation fault
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=139: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m pytest tests

do we have a tool which could automatically generate a backtrace in sbuild if this kind of failure occur ?


Cheers

Fred
Jochen Sprickerhof
2025-03-12 11:00:01 UTC
Permalink
Hi Fred,
Post by PICCA Frederic-Emmanuel
Hello during the build of vitables, the reunit test fail with a segfault.
[..]
Post by PICCA Frederic-Emmanuel
Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, tables._comp_lzo, tables._comp_bzip2, tables.utilsextension, numexpr.interpreter, tables.hdf5extension, tables.linkextension, tables.lrucacheextension, tables.tableextension, tables.indexesextension, PyQt6.QtCore, PyQt6.QtGui, PyQt6.QtWidgets, PyQt6.QtOpenGL, PyQt6.QtOpenGLWidgets, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, charset_normalizer.md (total: 26)
Segmentation fault
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=139: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m pytest tests
do we have a tool which could automatically generate a backtrace in sbuild if this kind of failure occur ?
I am not aware of any automatism for that but you can do it manually:

$ gbp clone vcsgit:vitables
$ cd vitables
$ gbp buildpackage --git-builder=sbuild --chroot-mode=unshare --no-clean-source --anything-failed-commands %s
# inside the chroot
# apt install gdb
# cd /build/reproducible-path/vitables-3.1.0/.pybuild/cpython3_3.13/build
# export DEBUGINFOD_URLS=https://debuginfod.debian.net
# gdb --args python3.13 -m pytest tests
(gdb) bt

Cheers Jochen
PICCA Frederic-Emmanuel
2025-03-12 11:50:01 UTC
Permalink
Post by Jochen Sprickerhof
$ gbp clone vcsgit:vitables
$ cd vitables
$ gbp buildpackage --git-builder=sbuild --chroot-mode=unshare --no-clean-source
--anything-failed-commands %s
# inside the chroot
# apt install gdb
# cd /build/reproducible-path/vitables-3.1.0/.pybuild/cpython3_3.13/build
# export DEBUGINFOD_URLS=https://debuginfod.debian.net
# gdb --args python3.13 -m pytest tests
(gdb) bt
Cheers Jochen
I am using the schroot mode where there is not network, so gdb can not download the debug info.
Is it possible to activate the network from the chroot or should the network be activated before starting the build ?
Jochen Sprickerhof
2025-03-12 12:20:01 UTC
Permalink
Post by PICCA Frederic-Emmanuel
Post by Jochen Sprickerhof
$ gbp clone vcsgit:vitables
$ cd vitables
$ gbp buildpackage --git-builder=sbuild --chroot-mode=unshare --no-clean-source
--anything-failed-commands %s
# inside the chroot
# apt install gdb
# cd /build/reproducible-path/vitables-3.1.0/.pybuild/cpython3_3.13/build
# export DEBUGINFOD_URLS=https://debuginfod.debian.net
# gdb --args python3.13 -m pytest tests
(gdb) bt
Cheers Jochen
I am using the schroot mode where there is not network, so gdb can not download the debug info.
Is it possible to activate the network from the chroot or should the network be activated before starting the build ?
I am not aware of official documentation how to use schroot without
network so I don't know how you did that. Instead I would recommend to
switch to the unshare backend as that one runs dpkg-buildpackage without
network but you get network in the debug shell.
And as a reminder, the buildds use sbuild+unshare for testing and
unstable.

Cheers Jochen

Loading...