Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.
/ crash-test Public archive

🐛️ a reproduction for a tricky python:alpine-3.6 bug

Notifications You must be signed in to change notification settings

beaugunderson/crash-test

Repository files navigation

crash-test

Python will segfault when run inside a docker image created from this repo like so:

$ docker-compose build

...

$ docker-compose run --service-ports --rm web

Starting crash-test-data ...
Starting crash-test-data ... done
Starting crash-test-db ... done
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  No migrations to apply.
Performing system checks...

Fatal Python error: Segmentation fault

Current thread 0x00007f986f029b48 (most recent call first):
  File "/usr/local/lib/python3.6/site-packages/django/utils/autoreload.py", line 305 in python_reloader
  File "/usr/local/lib/python3.6/site-packages/django/utils/autoreload.py", line 332 in main
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 110 in run
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 101 in handle
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 330 in execute
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 62 in execute
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 283 in run_from_argv
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 355 in execute
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 363 in execute_from_command_line
  File "./manage.py", line 22 in <module>
./serve.sh: line 4:    12 Segmentation fault      ./manage.py runserver 0.0.0.0:$PORT

The autoreload code seems to be implicated; when run with --noreload a SEGFAULT does not occur. In this specific example boto3 is also implicated, even though it's not used (it's only imported). Without importing boto3 there is no SEGFAULT.

In this reproduction the SEGFAULTs can be fixed by commenting out the import of boto3 in sub_app/views.py.

Open issues

I think these issues are all the same root cause, which seems to implicate threading:

There's a potentially related bug that implicates boto:

About

🐛️ a reproduction for a tricky python:alpine-3.6 bug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published