Skip to content

Instantly share code, notes, and snippets.

Today 8:59
!!! uWSGI process 21913 got Segmentation Fault !!!
*** backtrace of 21913 ***
/usr/local/bin/uwsgi(uwsgi_backtrace+0x29) [0x45d649]
/usr/local/bin/uwsgi(uwsgi_segfault+0x21) [0x45d7c1]
/lib64/libc.so.6 [0x3a5a4302d0]
/usr/local/bin/uwsgi(uwsgi_cache_set2+0x146) [0x452006]
*** end of backtrace ***
[deadlock-detector] pid 21913 was holding lock cache_volume (0x2b5f37e89000)
[uwsgi]
wsgi-file = srv.py
master
processes = 8
#threads = 2 Using thread will breaks the server for now.
pidfile = /tmp/uwsgi.pid
cache2 = name=test,items=2,blocksize=10,keysize=5
cache2 = name=users,items=40000,blocksize=16384,keysize=64,bitmap=1
cache2 = name=general,items=65536,blocksize=16384,keysize=1024,bitmap=1
/usr/local/bin/uwsgi(uwsgi_cache_set2+0x146) [0x452006]
/usr/local/bin/uwsgi(uwsgi_cache_magic_set+0xec) [0x45261c]
/usr/local/bin/uwsgi(py_uwsgi_cache_update+0xa3) [0x4713a3]
/usr/local/bin/uwsgi(PyEval_EvalFrameEx+0x5ec4) [0x50d024]
/usr/local/bin/uwsgi(PyEval_EvalCodeEx+0x89b) [0x50ee6b]
/usr/local/bin/uwsgi [0x4a49ff]
/usr/local/bin/uwsgi(PyObject_Call+0x5d) [0x48671d]
/usr/local/bin/uwsgi [0x48de3f]
/usr/local/bin/uwsgi(PyObject_Call+0x5d) [0x48671d]
/usr/local/bin/uwsgi(PyEval_CallObjectWithKeywords+0x56) [0x506056]
{{EPOLLIN, {u32=7, u64=7}}}, 1, 4294967295) = 1
[pid 8948] <... epoll_wait resumed> {{EPOLLIN, {u32=7, u64=7}}}, 1, 4294967295) = 1
[pid 8950] accept4(7, <unfinished ...>
[pid 8948] accept4(7, <unfinished ...>
[pid 8950] <... accept4 resumed> {sa_family=AF_INET, sin_port=htons(56577), sin_addr=inet_addr("127.0.0.1")}, [16], SOCK_NONBLOCK) = 9
[pid 8948] <... accept4 resumed> 0x7f4fefdb409a, [110], SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable)
[pid 8950] read(9, "\0\221\2\0\16\0REQUEST_METHOD\3\0GET\v\0REQUE"..., 4100) = 661
[pid 8948] epoll_wait(8, <unfinished ...>
[pid 8950] socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, IPPROTO_IP) = 10
[pid 8950] connect(10, {sa_family=AF_INET, sin_port=htons(3032), sin_addr=inet_addr("192.168.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
from uwsgi import *
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
cache_update('hello', 'world', 0, 'users')
v = cache_get('hello', 'users@192.168.0.1:3032')
#v = cache_get('hello', 'users')
print v
@co-dh
co-dh / gist:6672534
Created September 23, 2013 15:47
uwsgi remote cache bug
uwsgi --http :9090 --wsgi-file srv1.py --cache2 "name=users,items=5000,blocksize=4096,keysize=64,bitmap=1" --socket :3032
srv1.py
from uwsgi import *
cache_update('hello', 'world', 0, 'users')
# this line is not working,
[uwsgi]
wsgi-file = srv.py
master
processes = 8
pidfile = /tmp/uwsgi.pid
cache2 = name=users,items=5000,blocksize=4096,keysize=64,bitmap=1
cache2 = name=general,items=65536,blocksize=16384,keysize=1024,bitmap=1
cache2 = name=volume,items=65536,blocksize=16384,keysize=1024,bitmap=1
cache2 = name=agents,items=60000,blocksize=80960,keysize=128,bitmap=1
cache2 = name=test,items=2,blocksize=10,keysize=5
@co-dh
co-dh / angular_chosen
Created July 18, 2012 15:23
angular.js and jquery chosen plugin
<!doctype html>
<html ng-app>
<head>
<script src="/lib/angular-1.0.1.js"></script>
<script type="text/javascript" src="/lib/jquery.js"></script>
<script type="text/javascript" src="/lib/chosen/chosen.jquery.js"></script>
<link rel="stylesheet" href="/lib/chosen/chosen.css">
</head>
<body>
<div>