title: uWSGI: I got problem with threaded mode
body: <p>If I use uWSGI without threaded mode, it works fine. But my original server run with Apache ServerLimit 1, threaded-mode.
  It can handle concurrent connection, but my uWSGI can't (because worker only 1, I think).
  So I try to open threaded mode, but I will get 502 Bad Gateway error message from nginx.</p>
  
  <p>My log showed me:
  uwsgi: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs != 0' failed.</p>
  
  <p>I have no idea about what's wrong, How can I make it work?
  Thanks.</p>
  
  <p>Here is my configuration:</p>
  
  <pre><code>[uwsgi]
  
  show-config=True
  socket=:8002
  pidfile=/var/run/unicorn_uwsgi.pid
  daemonize=/root/logs/unicorn_uwsgi.log
  vacuum=True
  enable-threads=True
  threads=40
  processes=1
  env=QTDIR=/root/lib/qt
  env=LD_LIBRARY_PATH=/root/lib/qt/lib
  env=DISPLAY=:99
  env=XAUTHORITY=/root/webapps/xvfb/Xauthority.xvfb
  module=WSGI
  home=/root/webapps/unicorn
  pythonpath=/root/Source/Server/Unicorn
  chdir=/root/Source/Server/Unicorn
  </code></pre>
  
  <p>I use nginx as HTTP server, here is configuration:</p>
  
  <pre><code>server {
      listen       80;
      server_name  _;
  
      location / {
          include uwsgi_params;
          uwsgi_pass 127.0.0.1:8002;
      }
  }
  </code></pre>
  
  <p>OS: CentOS 6.0, CPU:  AMD Athlon(tm) XP 2500+, RAM: 2G</p>
  
  <p>Python 2.6.5 (default), uWSGI: 0.9.8.2, nginx: 0.8.54</p>