I have been trying to run the websocket chat example provided here on an Apple Mac. https://github.com/unbit/uwsgi/blob/master/tests/websockets_chat_async.py
But running this example results in a segfault in uwsgi.
I have copied pasted this example in websocket.py and am running the server with the following command
uwsgi --http :8080 --http-websockets --wsgi-file websocket.py --venv ../../python2-wow
When I access the URL, I get the proper message for connection establishing. But then the server crashes with this segfault
!!! uWSGI process 29129 got Segmentation Fault !!!
*** backtrace of 29129 ***
0 uwsgi 0x00000001078b5ec0 uwsgi_backtrace + 48
1 uwsgi 0x00000001078b6371 uwsgi_segfault + 49
2 libsystem_platform.dylib 0x00007fff96b2c5aa _sigtramp + 26
3 ??? 0x0000000000000000 0x0 + 0
4 uwsgi 0x0000000107897b4e async_add_fd_read + 206
5 uwsgi 0x00000001078c8979 py_eventfd_read + 89
6 Python 0x00000001079d214d PyEval_EvalFrameEx + 8080
7 Python 0x00000001079d0093 PyEval_EvalCodeEx + 1641
8 Python 0x0000000107977796 PyFunction_SetClosure + 809
9 Python 0x0000000107959f72 PyObject_Call + 101
10 Python 0x00000001079d601f PyEval_CallObjectWithKeywords + 93
11 uwsgi 0x00000001078c6dc7 python_call + 23
12 uwsgi 0x00000001078c8df9 uwsgi_request_wsgi + 889
13 uwsgi 0x000000010787b7e3 wsgi_req_recv + 291
14 uwsgi 0x00000001078b38a5 simple_loop_run + 229
15 uwsgi 0x00000001078ba6e2 uwsgi_ignition + 226
16 uwsgi 0x00000001078ba5ae uwsgi_worker_run + 670
17 uwsgi 0x00000001078b9d26 uwsgi_start + 5078
18 uwsgi 0x00000001078b81a3 main + 7331
19 libdyld.dylib 0x00007fff8c6ce5fd start + 1
*** end of backtrace ***
Apparantly the crash is on this line
uwsgi.wait_fd_read(websocket_fd, 3)
Stumped here. Need help.
I made it to work with --async=100
and --ugreen
options.
Note that there are newer API's that you can use: native WebSocket support and generic gevent-based async support.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With