If you are use the current version, line 509 of mainloop.c correspond to a pylist and pytuple check.
Which version of python are you using?
Can you verify your python code?
1st guess you return an empty object.
Thanks
I propose you 2 actions:
1)
Can you run the unit tests ?
in tests/unittest, you run server.py then execute test.py and see if
it pass the tests.
2)
If you can send me your application william.os4y at gmail.com
I can try to reproduce it
W.
On my side, I have several Fapws instances running since +100 days
without interruption.
Fapws.org is a good example :-)
http://www.fapws.org/uptime
Since several days/weeks, this is my main task: find bugs in Fapws.
(cfr python3 branch)
I'm curious ... maybe you have found a new bug :-)
W.
Can you reproduce the bug with the long GET?
Can't reproduce the issue :-(
Did you got more details to allow me to reproduce the problem ?
Which was the exact URL before the crash ?
What is the normal content that your script return to Fapws ?
Do you use some special headers ? which one ?
W.
On Fri, Feb 10, 2012 at 10:46 PM, william opensource4you
I'm not able to reproduce it. :-(
Maybe you could you send me the whole dump file ?
I'm running Archlinux 64 with python-2.7.2, libev-4.04 all tests done with epoll
To debug it, I need to be able to reproduce it ...
Thus, I've build the following script:
import fapws._evwsgi as evwsgi
from fapws import base
def start():
evwsgi.start("0.0.0.0", "8080")
evwsgi.set_base_module(base)
def hello(environ, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return ["hello world!!"]
def test1(environ, start_response):
start_response('200 OK', [('Content-type', 'image/gif'),
('P3P: CP','IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR
IND CNT
')])
return ['<h1>Not Found</h1>']
def test2(environ, start_response):
start_response('200 OK', [('Content-type', 'image/gif'),
('Expires','Mon, 26 Jul 1997 05:00:00 GMT'), ('Pragma', 'no-cache'),
('Cache
-Control', 'no-cache, must-revalidate'),('P3P: CP', 'IDC DSP COR ADM
DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT')])
return ['Ok']
def test3(environ, start_response):
start_response('200 OK', [('Content-type', 'image/gif'),
('Expires','Mon, 26 Jul 1997 05:00:00 GMT'), ('Pragma', 'no-cache'),
('Cache
-Control', 'no-cache, must-revalidate'),('P3P: CP', 'IDC DSP COR ADM
DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT')])
return ["%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c"
% (71, 73, 70, 56, 57, 97, 1, 0, 1,
0, 128, 255, 0, 192, 192, 192, 0, 0, 0, 33, 249, 4, 1, 0, 0, 0, 0, 44,
0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59) ]
evwsgi.wsgi_cb(("/hello", hello))
evwsgi.wsgi_cb(("/test1", test1))
evwsgi.wsgi_cb(("/test2", test2))
evwsgi.wsgi_cb(("/test3", test3))
evwsgi.set_debug(0)
evwsgi.run()
if __name__=="__main__":
start()
I've tested it with curl.
test1
-------
curl -D stdout1 http://127.0.0.1:8080/test1 > res1
wi@myarchhost:~/tmp/fapws_vassel$ more res1
<h1>Not Found</h1>
wi@myarchhost:~/tmp/fapws_vassel$ more stdout1
HTTP/1.0 200 OK
Date: Mon, 13 Feb 2012 07:47:14 GMT
P3P: CP: IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
Content-type: image/gif
Server: fapws3/0.10
test2
-------
curl -D stdout2 http://127.0.0.1:8080/test2 > res2
wi@myarchhost:~/tmp/fapws_vassel$ more res2
Ok
wi@myarchhost:~/tmp/fapws_vassel$ more stdout2
HTTP/1.0 200 OK
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Server: fapws3/0.10
Pragma: no-cache
Cache-Control: no-cache, must-revalidate
Date: Mon, 13 Feb 2012 07:47:45 GMT
P3P: CP: IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
Content-type: image/gif
test3
-------
curl -D stdout3 http://127.0.0.1:8080/test3 > res3
wi@myarchhost:~/tmp/fapws_vassel$ more res3
GIF89a
wi@myarchhost:~/tmp/fapws_vassel$ more stdout3
HTTP/1.0 200 OK
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Server: fapws3/0.10
Pragma: no-cache
Cache-Control: no-cache, must-revalidate
Date: Mon, 13 Feb 2012 07:47:54 GMT
P3P: CP: IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
Content-type: image/gif
I've done HEAD tests (sometimes proxies are doing it):
wi@myarchhost:~/tmp/fapws_vassel$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
HEAD /test1 HTTP/1.1
HTTP/1.0 200 OK
Date: Mon, 13 Feb 2012 07:58:45 GMT
P3P: CP: IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
Content-type: image/gif
Server: fapws3/0.10
Connection closed by foreign host.
wi@myarchhost:~/tmp/fapws_vassel$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
HEAD /test2 HTTP/1.1
HTTP/1.0 200 OK
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Server: fapws3/0.10
Pragma: no-cache
Cache-Control: no-cache, must-revalidate
Date: Mon, 13 Feb 2012 07:59:07 GMT
P3P: CP: IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
Content-type: image/gif
Connection closed by foreign host.
wi@myarchhost:~/tmp/fapws_vassel$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
HEAD /test3 HTTP/1.1
HTTP/1.0 200 OK
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Server: fapws3/0.10
Pragma: no-cache
Cache-Control: no-cache, must-revalidate
Date: Mon, 13 Feb 2012 07:59:19 GMT
P3P: CP: IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT
Content-type: image/gif
Connection closed by foreign host.
wi@myarchhost:~/tmp/fapws_vassel$
But I understand that there is a problem with Base.py (line 117) which
generate a crash of Fapws.
I you take the last release v0.10) this should no more generate a
crash because I have added the following line in mainloop.c:
if (PyErr_Occurred())
{
PyErr_Print();
return -500;
}
In other words, you will get an error message in your output file
(really hope you have one).
And the user will receive an error message
All in all Fapws will stays up an running.
Could I suggest you to migrate to the last version (v0.10) ?
I know it was released yesterday, but it contains some additional bugfixes.
Hope we are on the good track :-)
Thanks tell me how this will evolve
W.