Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when running manage.py django commands with zope.interface 7.0.1 #315

Closed
flapedriza opened this issue Aug 7, 2024 · 1 comment

Comments

@flapedriza
Copy link

BUG/PROBLEM REPORT / FEATURE REQUEST

What I did:

Run Django manage.py commands with zope.interface==7.0.1 installed.
After downgrading to zope.interface 6.3, this error stopped occurring

What I expect to happen:

manage.py commands to run successfully.

What actually happened:

When I run any manage.py command I get segmentation fault:

# ./manage.py showmigrations
Segmentation fault (core dumped)

I identified that the problem was this package because if I run python -v manage.py showmigrations I get the following:

...
import 'gevent.libev' # <_frozen_importlib_external.SourceFileLoader object at 0x7f257f77d820>
# extension module 'gevent.libev.corecext' loaded from '/usr/local/lib/python3.8/site-packages/gevent/libev/corecext.cpython-38-x86_64-linux-gnu.so'
# possible namespace for /usr/local/lib/python3.8/site-packages/zope
# /usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/__init__.cpython-38.pyc matches /usr/local/lib/python3.8/site-packages/zope/interface/__init__.py
# code object from '/usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/__init__.cpython-38.pyc'
# /usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/interface.cpython-38.pyc matches /usr/local/lib/python3.8/site-packages/zope/interface/interface.py
# code object from '/usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/interface.cpython-38.pyc'
# /usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/ro.cpython-38.pyc matches /usr/local/lib/python3.8/site-packages/zope/interface/ro.py
# code object from '/usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/ro.cpython-38.pyc'
import 'zope.interface.ro' # <_frozen_importlib_external.SourceFileLoader object at 0x7f257f4c4b20>
# /usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/_compat.cpython-38.pyc matches /usr/local/lib/python3.8/site-packages/zope/interface/_compat.py
# code object from '/usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/_compat.cpython-38.pyc'
import 'zope.interface._compat' # <_frozen_importlib_external.SourceFileLoader object at 0x7f257f4c4d30>
# /usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/exceptions.cpython-38.pyc matches /usr/local/lib/python3.8/site-packages/zope/interface/exceptions.py
# code object from '/usr/local/lib/python3.8/site-packages/zope/interface/__pycache__/exceptions.cpython-38.pyc'
import 'zope.interface.exceptions' # <_frozen_importlib_external.SourceFileLoader object at 0x7f257f4ccfa0>
Segmentation fault (core dumped)

Weird thing is that if I run python -vv manage.py showmigrations (more verbose), I get the migrations and no segfault.

Furthermore, if I clean the pyc files with the following command: find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf the manage.py run inmediately after that works, but the following ones cause a segfault too.

What version of Python and Zope/Addons I am using:

  • Python 3.8.17
  • Django 2.2.28
  • zope.interface 7.0.1
  • Running inside a docker container based on python:3.8-slim-buster
    zope.interface is a dependency installed by gevent:
gevent==20.9.0
├── greenlet [required: >=0.4.17, installed: 1.1.3]
├── setuptools [required: Any, installed: 57.5.0]
├── zope.event [required: Any, installed: 5.0]
│   └── setuptools [required: Any, installed: 57.5.0]
└── zope.interface [required: Any, installed: 7.0.1]
    └── setuptools [required: Any, installed: 57.5.0]
dataflake added a commit to zopefoundation/Zope that referenced this issue Aug 8, 2024
dataflake added a commit to zopefoundation/Zope that referenced this issue Aug 8, 2024
* - update all compatible dependencies without Sphinx theme change

* - more non-Sphinx-related dependency updates

* - switch to "furo" Sphinx theme as suggested by Steve Piercy

* - Sphinx <8 requires docutils <0.21

* - downgrade zope.interface due to zopefoundation/zope.interface#315

* - ignore additional build artifacts created by the furo Sphinx theme

* - Sphinx 8 requires Python 3.10, adding pins for Python 3.9

* - correct zope.interface version pin spelling
@davisagli
Copy link
Member

I am having trouble reproducing this.

I started a python:3.8-slim-buster container, ran pip install Django==2.2.28 gevent==20.9.0. This failed with a different error while building gevent.

Then I ran pip install Django==2.2.28 gevent to install a newer version of gevent. After this I was able to create a Django project and run manage.py commands without error.

I'll close the issue, unless you can provide more specific instructions for how to reproduce the error, or use gdb to get a C-level stack trace of where the segmentation fault occurred.

@davisagli davisagli closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants