william-os4y / fapws3

Fast Asynchronous Python Web Server (based on libev)
GNU General Public License v2.0
341 stars 38 forks source link

yield example segfaults on Ubuntu / amd64 #13

Closed defnull closed 14 years ago

defnull commented 14 years ago

Python version:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2

After downloading http://github.com/william-os4y/fapws3/raw/master/sample/iter/test.py

marc@nava:/tmp$ sudo pip install -U fapws3
Downloading/unpacking fapws3
  Downloading fapws3-0.5.dev.tar.gz
  Running setup.py egg_info for package fapws3
Installing collected packages: fapws3
  Running setup.py install for fapws3
    building 'fapws._evwsgi' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/local/include -I/opt/local/include -I/usr/include/python2.6 -c fapws/_evwsgi.c -o build/temp.linux-x86_64-2.6/fapws/_evwsgi.o
    In file included from /usr/include/python2.6/Python.h:8,
                     from fapws/_evwsgi.c:38:
    /usr/include/python2.6/pyconfig.h:1031:1: warning: "_POSIX_C_SOURCE" redefined
    In file included from /usr/include/fcntl.h:27,
                     from fapws/_evwsgi.c:19:
    /usr/include/features.h:210:1: warning: this is the location of the previous definition
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/fapws/_evwsgi.o -L/usr/local/lib -L/opt/local/lib -lev -o build/lib.linux-x86_64-2.6/fapws/_evwsgi.so
Successfully installed fapws3
marc@nava:/tmp$ python test.py
listen on 0.0.0.0:8000
Using epoll as event backend
host:127.0.0.1,port:57760 accept_cb: cli:0x238d7a0, input_header:0x2462830
host=127.0.0.1,port=57760 connection_cb:cli:0x238d7a0, input_header:0x2451730, input_pos:427, r:427
host=127.0.0.1,port=57760:python_handler:HEADER:
GET / HTTP/1.1
Host: localhost:8000
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.7) Gecko/20100716 Ubuntu/10.04 (lucid) Firefox/3.6.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cache-Control: max-age=0

**
Segmentation fault
william-os4y commented 14 years ago

can you detail ? I cannot reproduce it ;-(.

I've run it on fedora 64: " [wi@fedora-64 ~]$ rpm -q python

python-2.6.4-27.fc13.x86_64 [wi@fedora-64 ~]$ rpm -q libev

libev-3.90-1.fc13.x86_64 [wi@fedora-64 ~]$ uname -a

Linux fedora-64 2.6.33.3-85.fc13.x86_64 #1 SMP Thu May 6 18:09:49 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux [wi@fedora-64 ~]$ "

Could you provide the backtrace of gdb, this will point the line where the crash has happend. (gdb python; run test.py; bt)

defnull commented 14 years ago
Program received signal SIGSEGV, Segmentation fault.
python_handler (cli=0x8b37a0) at fapws/_evwsgi.c:620
warning: Source file is more recent than executable.
620             if (ret < 0) {
(gdb) bt
0  python_handler (cli=0x8b37a0) at fapws/_evwsgi.c:620
1  0x00007ffff67b8108 in write_cb (loop=0x7ffff67b2200, w=0x8b37a8, revents=2)
    at fapws/_evwsgi.c:749
2  0x00007ffff65a8ea1 in ev_invoke_pending () from /usr/lib/libev.so.3
3  0x00007ffff65ad8dd in ev_loop () from /usr/lib/libev.so.3
4  0x00007ffff67b5eb0 in py_run_loop (self=<value optimized out>, 
   args=<value optimized out>) at fapws/_evwsgi.c:1135
5  0x00000000004a7c5e in PyEval_EvalFrameEx ()
6  0x00000000004a9671 in PyEval_EvalCodeEx ()
7  0x00000000004a9742 in PyEval_EvalCode ()
8  0x00000000004c9a0e in PyRun_FileExFlags ()
9  0x00000000004c9c24 in PyRun_SimpleFileExFlags ()
10 0x000000000041a7ff in Py_Main ()
11 0x00007ffff69d9c4d in __libc_start_main () from /lib/libc.so.6
12 0x00000000004199f9 in _start ()

edit: There seems to be an older fapws3 in the import path. One moment please. edit2: segfault was with fapws3-0.4.dev-py2.6-linux-x86_64.egg. 0.5 works.

william-os4y commented 14 years ago

Thanks for the edit. I close it now