SIGSEGV when Python tests use the `ctypes` module
See original GitHub issueDescription:
When using the Python installed with this action I run into SIGSEGV on Linux if my tests use ctypes
. This is is the offending workflow
name: Tests
on: push
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
env:
AUSTIN_TESTS_PYTHON_VERSIONS: ${{ matrix.python-version }}
name: Tests on Linux with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get -y install libunwind-dev binutils-dev libiberty-dev
- name: Install test dependencies
run: |
sudo apt-get -y install \
valgrind \
gdb
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Compile Austin
run: |
autoreconf --install
./configure --enable-debug-symbols true
make
- name: Run tests
run: |
ulimit -c unlimited
python3.10 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r test/requirements.txt
sudo -E .venv/bin/pytest --pastebin=failed --no-flaky-report -sr a -n auto
.venv/bin/pytest --pastebin=failed --no-flaky-report -sr a -n auto
deactivate
If Python is installed from, e.g., deadsnakes/ppa
, then the tests pass without SIGSEGV. I can also get the tests to pass locally.
This is an example of a happy workflow that pulls Python from the PPA: https://github.com/P403n1x87/austin/runs/7046194671?check_suite_focus=true
This is a run with the action: https://github.com/P403n1x87/austin/runs/7045119660?check_suite_focus=true
This was discovered with this PR: https://github.com/P403n1x87/austin/pull/120/files
Action version:
v4
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
Repro steps:
See description above
Expected behavior:
No SIGSEGV, like with the Pythons from the PPA.
Actual behavior:
SIGSEGV if ctypes
is used
Issue Analytics
- State:
- Created a year ago
- Comments:28 (15 by maintainers)
Top GitHub Comments
@P403n1x87 Status update.
The problem has been reproduced on simplified code:
@P403n1x87 thanks a lot for the backtrace, now i see a SEGFAULT is caused by an instruction of from
/lib/x86_64-linux-gnu/libffi.so.7
It is known problem: toolcache python is built against libffi.so.6 which does not exist in ubuntu-20.04
While we are providing the solution, please try to add the step installing libffi.so.6 before running tests as workaround