squeaky-pl / japronto

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
MIT License
8.62k stars 580 forks source link

Worker crashed on signal SIGSEGV! #179

Closed imuxin closed 1 year ago

imuxin commented 3 years ago

I just test how much size the response header can load.

Env Info:

reproduced issue code:

from japronto import Application
from japronto.response import JsonResponse
def hello(request):
    headers = { "Auth-Token": "token"*200 }
    return JsonResponse(json={'hello': 'world'}, headers=headers)
app = Application()
app.router.add_route('/', hello)
app.run(debug=True)

run the above code and curl http://localhost:8080. And then Worker crashed on signal SIGSEGV! log like this:

Accepting connections on http://0.0.0.0:8080
127.0.0.1 GET /
Fatal Python error: Segmentation fault

Current thread 0x0000000117f9ce00 (most recent call first):
  File "/Users/ql/WorkSpace/repo/github.com/imuxin/japronto/venv/lib/python3.7/site-packages/japronto/app/__init__.py", line 191 in serve
  File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99 in run
  File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297 in _bootstrap
  File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/popen_fork.py", line 74 in _launch
  File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/popen_fork.py", line 20 in __init__
  File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/context.py", line 277 in _Popen
  File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/context.py", line 223 in _Popen
  File "/usr/local/Cellar/python@3.7/3.7.9_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 112 in start
  File "/Users/ql/WorkSpace/repo/github.com/imuxin/japronto/venv/lib/python3.7/site-packages/japronto/app/__init__.py", line 237 in _run
  File "/Users/ql/WorkSpace/repo/github.com/imuxin/japronto/venv/lib/python3.7/site-packages/japronto/app/__init__.py", line 273 in run
  File "app.py", line 23 in <module>
Worker crashed on signal SIGSEGV!

I have no ideal how to debug this.