classification
Title: Segfault while Django template rendering
Type: crash Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vhelke, xtreak
Priority: normal Keywords:

Created on 2018-07-26 19:35 by vhelke, last changed 2018-07-27 06:33 by vhelke. This issue is now closed.

Messages (4)
msg322445 - (view) Author: vhelke (vhelke) Date: 2018-07-26 19:35
I have found a segfault in Django 2.0 while rendering a template.

Detailed info here, and instructions of how to reproduce the fault: ​https://github.com/vhelke/django-cas-crash

***

Here are the traces I was able to collect.

$ gdb python

<RENDERING THE TEMPLATE>


Program received signal SIGSEGV, Segmentation fault.
0x00007ffff711f547 in kill () at ../sysdeps/unix/syscall-template.S:81
81    T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)




(gdb) py-bt
Traceback (most recent call first):
  <built-in method kill of module object at remote 0x7ffff7f413b8>
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/utils/autoreload.py", line 303, in python_reloader
    os.kill(os.getpid(), -exit_code)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/utils/autoreload.py", line 317, in main
    python_reloader(wrapped_main_func, args, kwargs)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 105, in run
    autoreload.main(self.inner_run, None, options)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 98, in handle
    self.run(**options)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 61, in execute
    super().execute(*args, **options)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)






(gdb) bt
#0  0x00007ffff711f547 in kill () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000000054c420 in os_kill_impl (module=<module at remote 0x7ffff7f413b8>, signal=<optimized out>, pid=<optimized out>) at ./Modules/posixmodule.c:6534
#2  os_kill (module=module@entry=<module at remote 0x7ffff7f413b8>, args=args@entry=0x7fffea24d5b0, nargs=<optimized out>) at ./Modules/clinic/posixmodule.c.h:2624
#3  0x0000000000439dcd in _PyMethodDef_RawFastCallKeywords (kwnames=0x0, nargs=0, args=0x7fffea24d5b0, self=<module at remote 0x7ffff7f413b8>, method=0x8c8aa0 <posix_methods+1888>) at Objects/call.c:651
#4  _PyCFunction_FastCallKeywords (func=<built-in method kill of module object at remote 0x7ffff7f413b8>, args=args@entry=0x7fffea24d5b0, nargs=nargs@entry=2, kwnames=kwnames@entry=0x0) at Objects/call.c:730
#5  0x0000000000428f1c in call_function (kwnames=0x0, oparg=2, pp_stack=<synthetic pointer>) at Python/ceval.c:4547
#6  _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3086
#7  0x000000000041fc18 in function_code_fastcall (co=<optimized out>, args=<optimized out>, nargs=3, globals=<optimized out>) at Objects/call.c:283
#8  0x00000000004392f6 in _PyFunction_FastCallKeywords (func=<optimized out>, stack=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:415
#9  0x00000000004284bc in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at Python/ceval.c:4586
#10 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3117
#11 0x00000000004ec058 in PyEval_EvalFrameEx (throwflag=0,
    f=Frame 0x7fffea3ecaf8, for file /home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/utils/autoreload.py, line 317, in main (main_func=<method at remote 0x7ffff7ea26c8>, args=(), kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, wrapped_main_func=<function at remote 0x7fffea22c268>)) at Python/ceval.c:547
#12 _PyEval_EvalCodeWithName (_co=<code at remote 0x7fffefc8ab70>, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=3, kwnames=0x0, kwargs=kwargs@entry=0x7fffeabfa1f0,
    kwcount=0, kwstep=kwstep@entry=1, defs=defs@entry=0x7fffefc93160, defcount=defcount@entry=2, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name='main', qualname='main') at Python/ceval.c:3923
#13 0x0000000000439228 in _PyFunction_FastCallKeywords (func=<optimized out>, stack=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:433
#14 0x0000000000428beb in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at Python/ceval.c:4586
#15 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3086
#16 0x00000000004ec058 in PyEval_EvalFrameEx (throwflag=0,
    f=Frame 0x7fffeabfa048, for file /home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py, line 105, in run (self=<Command(stdout=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b708>, _style_func=<function at remote 0x7fffef81a378>, ending='\n') at remote 0x7fffeb311438>, stderr=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b7e0>, _style_func=<function at remote 0x7fffea2278c8>, ending='\n') at remote 0x7fffead2cf60>, style=<Style(ERROR=<function at remote 0x7fffea2278c8>, SUCCESS=<function at remote 0x7fffea227950>, WARNING=<function at remote 0x7fffea2279d8>, NOTICE=<function at remote 0x7fffea227a60>, SQL_FIELD=<function at remote 0x7fffea227ae8>, SQL_COLTYPE=<function at remote 0x7fffea227b70>, SQL_KEYWORD=<function at remote 0x7fffea227bf8>, SQL_TABLE=<function at remote 0x7fffea227c80>, HTTP_INFO=<function at remote 0x7fffea227d08>, HTTP_SUCCESS=<function at remote 0x7fffea227d90>, HTTP_REDIRECT=<function at remote 0x7fffea227e18...(truncated))
    at Python/ceval.c:547
#17 _PyEval_EvalCodeWithName (_co=_co@entry=<code at remote 0x7fffebed0c00>,
    globals=globals@entry={'__name__': 'django.core.management.commands.runserver', '__doc__': None, '__package__': 'django.core.management.commands', '__loader__': <SourceFileLoader(name='django.core.management.commands.runserver', path='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py') at remote 0x7fffebecf470>, '__spec__': <ModuleSpec(name='django.core.management.commands.runserver', loader=<...>, origin='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py', loader_state=None, submodule_search_locations=None, _set_fileattr=True, _cached='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/__pycache__/runserver.cpython-37.pyc', _initializing=False) at remote 0x7fffebecf780>, '__file__': '/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py', '__cached__': '/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages...(truncated), locals=locals@entry=0x0, args=args@entry=0x7fffffffc560, argcount=argcount@entry=1, kwnames=kwnames@entry=0x7fffea234e60, kwargs=kwargs@entry=0x7fffea234e68, kwcount=22, kwcount@entry=11,
    kwstep=kwstep@entry=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name='run', qualname='Command.run') at Python/ceval.c:3923
#18 0x0000000000439017 in _PyFunction_FastCallDict (func=func@entry=<function at remote 0x7fffea227730>, args=args@entry=0x7fffffffc560, nargs=nargs@entry=1,
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:376
#19 0x000000000043c739 in _PyObject_FastCallDict (
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, nargs=1, args=0x7fffffffc560, callable=<function at remote 0x7fffea227730>) at Objects/call.c:98
#20 _PyObject_Call_Prepend (callable=<function at remote 0x7fffea227730>, obj=<optimized out>, args=(),
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:904
#21 0x000000000043a628 in PyObject_Call (callable=callable@entry=<method at remote 0x7fffec163788>, args=args@entry=(),
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:245
#22 0x0000000000423747 in do_call_core (
    kwdict={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, callargs=(), func=<method at remote 0x7fffec163788>) at Python/ceval.c:4615
#23 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3184
---Type <return> to continue, or q <return> to quit---
#24 0x00000000004ec058 in PyEval_EvalFrameEx (throwflag=0,
    f=Frame 0xc87188, for file /home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py, line 98, in handle (self=<Command(stdout=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b708>, _style_func=<function at remote 0x7fffef81a378>, ending='\n') at remote 0x7fffeb311438>, stderr=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b7e0>, _style_func=<function at remote 0x7fffea2278c8>, ending='\n') at remote 0x7fffead2cf60>, style=<Style(ERROR=<function at remote 0x7fffea2278c8>, SUCCESS=<function at remote 0x7fffea227950>, WARNING=<function at remote 0x7fffea2279d8>, NOTICE=<function at remote 0x7fffea227a60>, SQL_FIELD=<function at remote 0x7fffea227ae8>, SQL_COLTYPE=<function at remote 0x7fffea227b70>, SQL_KEYWORD=<function at remote 0x7fffea227bf8>, SQL_TABLE=<function at remote 0x7fffea227c80>, HTTP_INFO=<function at remote 0x7fffea227d08>, HTTP_SUCCESS=<function at remote 0x7fffea227d90>, HTTP_REDIRECT=<function at remote 0x7fffea227e18>, H...(truncated))
    at Python/ceval.c:547
#25 _PyEval_EvalCodeWithName (_co=_co@entry=<code at remote 0x7fffebed0300>,
    globals=globals@entry={'__name__': 'django.core.management.commands.runserver', '__doc__': None, '__package__': 'django.core.management.commands', '__loader__': <SourceFileLoader(name='django.core.management.commands.runserver', path='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py') at remote 0x7fffebecf470>, '__spec__': <ModuleSpec(name='django.core.management.commands.runserver', loader=<...>, origin='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py', loader_state=None, submodule_search_locations=None, _set_fileattr=True, _cached='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/__pycache__/runserver.cpython-37.pyc', _initializing=False) at remote 0x7fffebecf780>, '__file__': '/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py', '__cached__': '/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages...(truncated), locals=locals@entry=0x0, args=args@entry=0x7fffffffc8d0, argcount=argcount@entry=1, kwnames=kwnames@entry=0x7fffea234ae0, kwargs=kwargs@entry=0x7fffea234ae8, kwcount=22, kwcount@entry=11,
    kwstep=kwstep@entry=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name='handle', qualname='Command.handle') at Python/ceval.c:3923
#26 0x0000000000439017 in _PyFunction_FastCallDict (func=func@entry=<function at remote 0x7fffea2276a8>, args=args@entry=0x7fffffffc8d0, nargs=nargs@entry=1,
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:376
#27 0x000000000043c739 in _PyObject_FastCallDict (
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, nargs=1, args=0x7fffffffc8d0, callable=<function at remote 0x7fffea2276a8>) at Objects/call.c:98
#28 _PyObject_Call_Prepend (callable=<function at remote 0x7fffea2276a8>, obj=<optimized out>, args=(),
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:904
#29 0x000000000043a628 in PyObject_Call (callable=callable@entry=<method at remote 0x7fffeb7aa608>, args=args@entry=(),
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:245
#30 0x0000000000423747 in do_call_core (
    kwdict={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, callargs=(), func=<method at remote 0x7fffeb7aa608>) at Python/ceval.c:4615
#31 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3184
#32 0x00000000004ec058 in PyEval_EvalFrameEx (throwflag=0,
    f=Frame 0xed1ec8, for file /home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py, line 335, in execute (self=<Command(stdout=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b708>, _style_func=<function at remote 0x7fffef81a378>, ending='\n') at remote 0x7fffeb311438>, stderr=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b7e0>, _style_func=<function at remote 0x7fffea2278c8>, ending='\n') at remote 0x7fffead2cf60>, style=<Style(ERROR=<function at remote 0x7fffea2278c8>, SUCCESS=<function at remote 0x7fffea227950>, WARNING=<function at remote 0x7fffea2279d8>, NOTICE=<function at remote 0x7fffea227a60>, SQL_FIELD=<function at remote 0x7fffea227ae8>, SQL_COLTYPE=<function at remote 0x7fffea227b70>, SQL_KEYWORD=<function at remote 0x7fffea227bf8>, SQL_TABLE=<function at remote 0x7fffea227c80>, HTTP_INFO=<function at remote 0x7fffea227d08>, HTTP_SUCCESS=<function at remote 0x7fffea227d90>, HTTP_REDIRECT=<function at remote 0x7fffea227e18>, HTTP_NOT_MODI...(truncated))
    at Python/ceval.c:547
#33 _PyEval_EvalCodeWithName (_co=_co@entry=<code at remote 0x7fffefd125d0>,
    globals=globals@entry={'__name__': 'django.core.management.base', '__doc__': '\nBase classes for writing management commands (named commands which can\nbe executed through ``django-admin`` or ``manage.py``).\n', '__package__': 'django.core.management', '__loader__': <SourceFileLoader(name='django.core.management.base', path='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py') at remote 0x7fffefd0ac18>, '__spec__': <ModuleSpec(name='django.core.management.base', loader=<...>, origin='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py', loader_state=None, submodule_search_locations=None, _set_fileattr=True, _cached='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/__pycache__/base.cpython-37.pyc', _initializing=False) at remote 0x7fffefd0ac50>, '__file__': '/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py', '__cached__': '/home/vhelke/Envs/django-cas-crash/lib/p...(truncated), locals=locals@entry=0x0, args=args@entry=0x7fffffffcc40, argcount=argcount@entry=1, kwnames=kwnames@entry=0x7fffea234a00, kwargs=kwargs@entry=0x7fffea234a08, kwcount=22, kwcount@entry=11,
    kwstep=kwstep@entry=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name='execute', qualname='BaseCommand.execute') at Python/ceval.c:3923
#34 0x0000000000439017 in _PyFunction_FastCallDict (func=func@entry=<function at remote 0x7fffefc8f620>, args=args@entry=0x7fffffffcc40, nargs=nargs@entry=1,
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:376
#35 0x000000000043c739 in _PyObject_FastCallDict (
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': Tr---Type <return> to continue, or q <return> to quit---
ue, 'insecure_serving': False}, nargs=1, args=0x7fffffffcc40, callable=<function at remote 0x7fffefc8f620>) at Objects/call.c:98
#36 _PyObject_Call_Prepend (callable=<function at remote 0x7fffefc8f620>, obj=<optimized out>, args=(),
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:904
#37 0x000000000043a628 in PyObject_Call (callable=callable@entry=<method at remote 0x7fffeb7aaa48>, args=args@entry=(),
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:245
#38 0x0000000000423747 in do_call_core (
    kwdict={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, callargs=(), func=<method at remote 0x7fffeb7aaa48>) at Python/ceval.c:4615
#39 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3184
#40 0x00000000004ec058 in PyEval_EvalFrameEx (throwflag=0,
    f=Frame 0xea1fe8, for file /home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py, line 61, in execute (self=<Command(stdout=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b708>, _style_func=<function at remote 0x7fffef81a378>, ending='\n') at remote 0x7fffeb311438>, stderr=<OutputWrapper(_out=<_io.TextIOWrapper at remote 0x7ffff7f7b7e0>, _style_func=<function at remote 0x7fffea2278c8>, ending='\n') at remote 0x7fffead2cf60>, style=<Style(ERROR=<function at remote 0x7fffea2278c8>, SUCCESS=<function at remote 0x7fffea227950>, WARNING=<function at remote 0x7fffea2279d8>, NOTICE=<function at remote 0x7fffea227a60>, SQL_FIELD=<function at remote 0x7fffea227ae8>, SQL_COLTYPE=<function at remote 0x7fffea227b70>, SQL_KEYWORD=<function at remote 0x7fffea227bf8>, SQL_TABLE=<function at remote 0x7fffea227c80>, HTTP_INFO=<function at remote 0x7fffea227d08>, HTTP_SUCCESS=<function at remote 0x7fffea227d90>, HTTP_REDIRECT=<function at remote 0x7fffea227e18>, ...(truncated))
    at Python/ceval.c:547
#41 _PyEval_EvalCodeWithName (_co=_co@entry=<code at remote 0x7fffebed05d0>,
    globals=globals@entry={'__name__': 'django.core.management.commands.runserver', '__doc__': None, '__package__': 'django.core.management.commands', '__loader__': <SourceFileLoader(name='django.core.management.commands.runserver', path='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py') at remote 0x7fffebecf470>, '__spec__': <ModuleSpec(name='django.core.management.commands.runserver', loader=<...>, origin='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py', loader_state=None, submodule_search_locations=None, _set_fileattr=True, _cached='/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/__pycache__/runserver.cpython-37.pyc', _initializing=False) at remote 0x7fffebecf780>, '__file__': '/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py', '__cached__': '/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages...(truncated), locals=locals@entry=0x0, args=args@entry=0x7fffffffcfb0, argcount=argcount@entry=1, kwnames=kwnames@entry=0x7fffea3c4d80, kwargs=kwargs@entry=0x7fffea3c4d88, kwcount=22, kwcount@entry=11,
    kwstep=kwstep@entry=2, defs=0x0, defcount=0, kwdefs=0x0, closure=(<cell at remote 0x7fffebea2af8>,), name='execute', qualname='Command.execute') at Python/ceval.c:3923
#42 0x0000000000439017 in _PyFunction_FastCallDict (func=func@entry=<function at remote 0x7fffea227598>, args=args@entry=0x7fffffffcfb0, nargs=nargs@entry=1,
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:376
#43 0x000000000043c739 in _PyObject_FastCallDict (
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, nargs=1, args=0x7fffffffcfb0, callable=<function at remote 0x7fffea227598>) at Objects/call.c:98
#44 _PyObject_Call_Prepend (callable=<function at remote 0x7fffea227598>, obj=<optimized out>, args=(),
    kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:904
#45 0x000000000043a628 in PyObject_Call (callable=callable@entry=<method at remote 0x7fffebe7ed08>, args=args@entry=(),
    kwargs=kwargs@entry={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}) at Objects/call.c:245
#46 0x0000000000423747 in do_call_core (
    kwdict={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': False}, callargs=(), func=<method at remote 0x7fffebe7ed08>) at Python/ceval.c:4615
#47 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3184
#48 0x000000000041fc18 in function_code_fastcall (co=<optimized out>, args=<optimized out>, nargs=2, globals=<optimized out>) at Objects/call.c:283
#49 0x00000000004392f6 in _PyFunction_FastCallKeywords (func=<optimized out>, stack=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:415
#50 0x0000000000428482 in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at Python/ceval.c:4586
#51 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3103
#52 0x000000000041fc18 in function_code_fastcall (co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at Objects/call.c:283
#53 0x00000000004392f6 in _PyFunction_FastCallKeywords (func=<optimized out>, stack=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:415
#54 0x0000000000428482 in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at Python/ceval.c:4586
#55 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3103
#56 0x00000000004ec058 in PyEval_EvalFrameEx (throwflag=0,
---Type <return> to continue, or q <return> to quit---
    f=Frame 0x7ffff7f80be8, for file /home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/__init__.py, line 371, in execute_from_command_line (argv=['manage.py', 'runserver'], utility=<ManagementUtility(argv=[...], prog_name='manage.py', settings_exception=None) at remote 0x7ffff7f04438>)) at Python/ceval.c:547
#57 _PyEval_EvalCodeWithName (_co=<code at remote 0x7fffefd8a4b0>, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=1, kwnames=0x0, kwargs=kwargs@entry=0x7ffff7f80b70,
    kwcount=0, kwstep=kwstep@entry=1, defs=defs@entry=0x7fffefd82e28, defcount=defcount@entry=1, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name='execute_from_command_line',
    qualname='execute_from_command_line') at Python/ceval.c:3923
#58 0x0000000000439228 in _PyFunction_FastCallKeywords (func=<optimized out>, stack=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>) at Objects/call.c:433
#59 0x00000000004284bc in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at Python/ceval.c:4586
#60 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3117
#61 0x00000000004ec058 in PyEval_EvalFrameEx (throwflag=0, f=Frame 0x7ffff7f809f8, for file manage.py, line 15, in <module> ()) at Python/ceval.c:547
#62 _PyEval_EvalCodeWithName (_co=_co@entry=<code at remote 0x7ffff7f12030>, globals=globals@entry=<unknown at remote 0x7ffff7e97148>, locals=locals@entry='manage.py', args=args@entry=0x0,
    argcount=argcount@entry=0, kwnames=kwnames@entry=0x0, kwargs=kwargs@entry=0x0, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0,
    closure=closure@entry=0x0, name=name@entry=0x0, qualname=qualname@entry=0x0) at Python/ceval.c:3923
#63 0x00000000004ec180 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, locals=locals@entry='manage.py',
    globals=globals@entry=<unknown at remote 0x7ffff7e97148>, _co=_co@entry=<code at remote 0x7ffff7f12030>) at Python/ceval.c:3952
#64 PyEval_EvalCode (co=co@entry=<code at remote 0x7ffff7f12030>,
    globals=globals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='manage.py') at remote 0x7ffff7f0dd68>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7fc7c28>, '__file__': 'manage.py', '__cached__': None, 'os': <module at remote 0x7ffff7f08ae8>, 'sys': <module at remote 0x7ffff7fc1f98>, 'execute_from_command_line': <function at remote 0x7fffef81a048>},
    locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='manage.py') at remote 0x7ffff7f0dd68>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7fc7c28>, '__file__': 'manage.py', '__cached__': None, 'os': <module at remote 0x7ffff7f08ae8>, 'sys': <module at remote 0x7ffff7fc1f98>, 'execute_from_command_line': <function at remote 0x7fffef81a048>}) at Python/ceval.c:524
#65 0x0000000000526df8 in run_mod (arena=0x7ffff7fcf180, flags=0x7fffffffda20,
    locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='manage.py') at remote 0x7ffff7f0dd68>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7fc7c28>, '__file__': 'manage.py', '__cached__': None, 'os': <module at remote 0x7ffff7f08ae8>, 'sys': <module at remote 0x7ffff7fc1f98>, 'execute_from_command_line': <function at remote 0x7fffef81a048>},
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='manage.py') at remote 0x7ffff7f0dd68>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7fc7c28>, '__file__': 'manage.py', '__cached__': None, 'os': <module at remote 0x7ffff7f08ae8>, 'sys': <module at remote 0x7ffff7fc1f98>, 'execute_from_command_line': <function at remote 0x7fffef81a048>}, filename='manage.py', mod=0x96cae0) at Python/pythonrun.c:1035
#66 PyRun_FileExFlags (fp=0x980770, filename_str=<optimized out>, start=<optimized out>,
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='manage.py') at remote 0x7ffff7f0dd68>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7fc7c28>, '__file__': 'manage.py', '__cached__': None, 'os': <module at remote 0x7ffff7f08ae8>, 'sys': <module at remote 0x7ffff7fc1f98>, 'execute_from_command_line': <function at remote 0x7fffef81a048>},
    locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='manage.py') at remote 0x7ffff7f0dd68>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7ffff7fc7c28>, '__file__': 'manage.py', '__cached__': None, 'os': <module at remote 0x7ffff7f08ae8>, 'sys': <module at remote 0x7ffff7fc1f98>, 'execute_from_command_line': <function at remote 0x7fffef81a048>}, closeit=1, flags=0x7fffffffda20) at Python/pythonrun.c:988
#67 0x0000000000526fdd in PyRun_SimpleFileExFlags (fp=0x980770, filename=<optimized out>, closeit=1, flags=0x7fffffffda20) at Python/pythonrun.c:430
#68 0x000000000042d90c in pymain_run_file (p_cf=0x7fffffffda20, filename=0x929450 L"manage.py", fp=0x980770) at Modules/main.c:425
#69 pymain_run_filename (cf=0x7fffffffda20, pymain=0x7fffffffdb20) at Modules/main.c:1520
#70 pymain_run_python (pymain=0x7fffffffdb20) at Modules/main.c:2520
#71 pymain_main (pymain=pymain@entry=0x7fffffffdb20) at Modules/main.c:2662
#72 0x000000000042e0dc in _Py_UnixMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:2697
#73 0x00007ffff710b445 in __libc_start_main (main=0x41fba0 <main>, argc=3, ubp_av=0x7fffffffdd48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd38)
    at ../csu/libc-start.c:274
#74 0x0000000000429924 in _start ()
(gdb)
msg322463 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-07-27 05:37
Interesting. It works fine with Python 3.6 and latest master but segfaults in python 3.7.0 . I will try the latest python 3.7 branch later.

# Python 3.6 on Mac

(bpo34241-env)    mysite git:(master)   python
Python 3.6.4 (default, Mar 12 2018, 13:42:53)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

# Changes made

diff --git a/mysite/templates/rest_framework/login_base.html b/mysite/templates/rest_framework/login_base.html
index aa91aae..48127ae 100644
--- a/mysite/templates/rest_framework/login_base.html
+++ b/mysite/templates/rest_framework/login_base.html
@@ -68,7 +68,7 @@
       <div class="well" style="width: 320px; margin-left: auto; margin-right: auto">
         <div class="row-fluid">
           <div>
-            <p><a href="{% url 'cas_ng_login' %}?next=/">{% trans "Kirjaudu sis‰‰n k‰ytt‰en Opintopolun tunnuks." %}</a></p>
+            <p><a href="{% url 'cas_ng_login' %}?next=/">{% trans "Kirjaudu sis‰‰n k‰ytt‰en Opintopolun tunnuksi." %}</a></p>
           </div>
         </div><!-- /row fluid -->
       </div><!--/.well-->

# Rendered content

      <div class="well" style="width: 320px; margin-left: auto; margin-right: auto">
        <div class="row-fluid">
          <div>
            <p><a href="/accounts/login?next=/">Kirjaudu sis‰‰n k‰ytt‰en Opintopolun tunnuksi.</a></p>
          </div>
        </div><!-- /row fluid -->
      </div><!--/.well-->

# python 3.8

Python 3.8.0a0 (heads/master:defcffd, Jul 27 2018, 04:59:27)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

# diff

diff --git a/mysite/templates/rest_framework/login_base.html b/mysite/templates/rest_framework/login_base.html
index aa91aae..48127ae 100644
--- a/mysite/templates/rest_framework/login_base.html
+++ b/mysite/templates/rest_framework/login_base.html
@@ -68,7 +68,7 @@
       <div class="well" style="width: 320px; margin-left: auto; margin-right: auto">
         <div class="row-fluid">
           <div>
-            <p><a href="{% url 'cas_ng_login' %}?next=/">{% trans "Kirjaudu sis‰‰n k‰ytt‰en Opintopolun tunnuks." %}</a></p>
+            <p><a href="{% url 'cas_ng_login' %}?next=/">{% trans "Kirjaudu sis‰‰n k‰ytt‰en Opintopolun tunnuksi." %}</a></p>
           </div>
         </div><!-- /row fluid -->
       </div><!--/.well-->

      </div><!--/.well-->

# Content rendered

      <div class="well" style="width: 320px; margin-left: auto; margin-right: auto">
        <div class="row-fluid">
          <div>
            <p><a href="/accounts/login?next=/">Kirjaudu sis‰‰n k‰ytt‰en Opintopolun tunnuksi.</a></p>
          </div>
        </div><!-- /row fluid -->
      </div><!--/.well-->

    </div><!-- /.row-fluid -->
  </div><!-- /.container-fluid -->

# Python 3.7

Python 3.7.0 (default, Jun 28 2018, 02:32:19)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

# segfaults

(bpo34241-37-venv) karthi@ubuntu-s-1vcpu-1gb-blr1-01:~/django-cas-crash/mysite$ python manage.py runserver 0.0.0.0:8000
Performing system checks...

System check identified no issues (0 silenced).
July 27, 2018 - 05:34:36
Django version 2.0.7, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Segmentation fault (core dumped)



Thanks
msg322465 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-07-27 05:59
Not reproducible in latest 3.7 branch. Search for "django segmentation fault" returns me https://bugs.python.org/issue34087 which is also unicode related and contains a django test project . I hope the related ticket is the one. From https://github.com/python/cpython/pull/8280 it's a regression in 3.7 and it doesn't affect 3.6. Feel free to close this if they are related.

Thanks
msg322466 - (view) Author: vhelke (vhelke) Date: 2018-07-27 06:33
It certainly seems like https://bugs.python.org/issue34087 is related.
I can also verify that Python 3.7.0+ (latest of now) does not have the problem anymore.

I am closing this ticket now. Thank you for looking over this issue. Cheers!
History
Date User Action Args
2018-07-27 06:33:51vhelkesetstatus: open -> closed
resolution: fixed
messages: + msg322466

stage: resolved
2018-07-27 05:59:16xtreaksetmessages: + msg322465
2018-07-27 05:37:38xtreaksetmessages: + msg322463
2018-07-27 04:49:01xtreaksetnosy: + xtreak
2018-07-26 19:35:33vhelkecreate