segfault after update

76 views
Skip to first unread message

Black_Noir

unread,
Mar 23, 2012, 3:59:50 AM3/23/12
to Fast Asynchronous Python Web Server
Hello,
~ 1-2 week ago after update to (william-os4y-fapws3-d468475) server
starts to crash with:

python: *** glibc detected *** /usr/bin/python: double free or
corruption (!prev): 0x08c51b20 ***
python: *** glibc detected *** /usr/bin/python: realloc(): invalid
next size: 0x08cd5e98 ***
kernel: python[1925]: segfault at d ip b7477749 sp bffef460 error 4 in
libc-2.11.3.so[b7407000+140000]

have this issue when 10-15 request per second to django (nginx + 3 x
fapws3) with simple page (20 random row from 30k row postgresql db).

william opensource4you

unread,
Mar 23, 2012, 4:17:11 PM3/23/12
to fa...@googlegroups.com
Hummm... interesting :-).

unfortunately, I cannot reproduce the problem with the ApacheBenchenmark.

Can you provide more details about the way to reproduce this problem?
Do you have a core dump to sent ?


Thanks

Black_Noir

unread,
Mar 27, 2012, 2:10:56 AM3/27/12
to Fast Asynchronous Python Web Server
Today try to do something with core files:

(gdb) bt
#0 0xf57fe416 in __kernel_vsyscall ()
#1 0xb73ed781 in raise () from /lib/i686/cmov/libc.so.6
#2 0xb73f0bb2 in abort () from /lib/i686/cmov/libc.so.6
#3 0xb7424285 in ?? () from /lib/i686/cmov/libc.so.6
#4 0xb742e381 in ?? () from /lib/i686/cmov/libc.so.6
#5 0xb742fbd8 in ?? () from /lib/i686/cmov/libc.so.6
#6 0xb7433901 in ?? () from /lib/i686/cmov/libc.so.6
#7 0xb7433d8d in realloc () from /lib/i686/cmov/libc.so.6
#8 0xb718112d in str_append (data=0x96c1f58 "HTTP/1.0 501 Not
Implemented\r\nContent-Type: text/html\r\nServer: fapws3/0.10b",
text=0xb71858c0 "\r\n\r\n<html><head><title>Not Implemented</
head><body><p>Not Implemented!!!</p></body></html>") at fapws/extra.c:
89
#9 0xb7183edd in write_cb (loop=0xb717d2e0, w=0x993913c, revents=2)
at fapws/mainloop.c:520
#10 0xb7174934 in ev_invoke_pending () from /usr/lib/libev.so.3
#11 0xb7179f34 in ev_loop () from /usr/lib/libev.so.3
#12 0xb718498c in py_run_loop (self=0x0, args=0xb738102c) at fapws/
_evwsgi.c:210
#13 0x080e0721 in PyEval_EvalFrameEx ()
#14 0x080e2507 in PyEval_EvalCodeEx ()
#15 0x080e2607 in PyEval_EvalCode ()
#16 0x080ffcbd in PyRun_FileExFlags ()
#17 0x080fff22 in PyRun_SimpleFileExFlags ()
#18 0x0805dd81 in Py_Main ()
#19 0x0805cf6b in main ()

May be it helps.

On 24 мар, 02:17, william opensource4you <william.o...@gmail.com>
wrote:

william opensource4you

unread,
Mar 29, 2012, 3:13:44 PM3/29/12
to fa...@googlegroups.com
I've been able to reproduce the problem :-).
By simply running the test.py in tests/unitests (master branch)

But I've not yet found a solution to it. :-(.
Sounds to be linked to the str_append, but not sure.

What is strange is that the problem is quite difficult to reproduce.
For example not been able to have it under GDB, not possible to have
it with the code in python3 branch

Those days, my spare time is quite limited ... cannot promise a quick
solution :-(.

W.

2012/3/27 Black_Noir <gblac...@gmail.com>:

Black_Noir

unread,
Apr 3, 2012, 6:41:31 AM4/3/12
to Fast Asynchronous Python Web Server
after update to python3 branch have similar core:

Program terminated with signal 11, Segmentation fault.
#0 0xb7545749 in ?? () from /lib/i686/cmov/libc.so.6
(gdb) bt
#0 0xb7545749 in ?? () from /lib/i686/cmov/libc.so.6
#1 0xb7545d8d in realloc () from /lib/i686/cmov/libc.so.6
#2 0xb729312d in str_append (data=0x9f27ca8 "HTTP/1.0 501 Not
Implemented\r\nContent-Type: text/html\r\nServer: fapws3/0.10b",
text=0xb72978c0 "\r\n\r\n<html><head><title>Not Implemented</
head><body><p>Not Implemented!!!</p></body></html>") at fapws/extra.c:
89
#3 0xb7295edd in write_cb (loop=0xb728f2e0, w=0x9f0422c, revents=2)
at fapws/mainloop.c:520
#4 0xb7286934 in ev_invoke_pending () from /usr/lib/libev.so.3
#5 0xb728bf34 in ev_loop () from /usr/lib/libev.so.3
#6 0xb729698c in py_run_loop (self=0x0, args=0xb749302c) at fapws/
_evwsgi.c:210
#7 0x080e0721 in PyEval_EvalFrameEx ()
#8 0x080e2507 in PyEval_EvalCodeEx ()
#9 0x080e2607 in PyEval_EvalCode ()
#10 0x080ffcbd in PyRun_FileExFlags ()
#11 0x080fff22 in PyRun_SimpleFileExFlags ()
#12 0x0805dd81 in Py_Main ()
#13 0x0805cf6b in main ()

in syslog:
python[17437]: segfault at 707dec0c ip b7432749 sp bfe6b290 error 4 in
libc-2.11.3.so[b73c2000+140000]

On 30 мар, 01:13, william opensource4you <william.o...@gmail.com>
wrote:
> I've been able to reproduce the problem :-).
> By simply running the test.py in tests/unitests (master branch)
>
> But I've not yet found a solution to it. :-(.
> Sounds to be linked to the str_append, but not sure.
>
> What is strange is that the problem is quite difficult to reproduce.
> For example not been able to have it under GDB, not possible to have
> it with the code in python3 branch
>
> Those days, my spare time is quite limited ... cannot promise a quick
> solution :-(.
>
> W.
>
> 2012/3/27 Black_Noir <gblackn...@gmail.com>:
>
>
>
>
>
>
>
> > Today try to do something with core files:
>
> > (gdb) bt
> > #0 š0xf57fe416 in __kernel_vsyscall ()
> > #1 š0xb73ed781 in raise () from /lib/i686/cmov/libc.so.6
> > #2 š0xb73f0bb2 in abort () from /lib/i686/cmov/libc.so.6
> > #3 š0xb7424285 in ?? () from /lib/i686/cmov/libc.so.6
> > #4 š0xb742e381 in ?? () from /lib/i686/cmov/libc.so.6
> > #5 š0xb742fbd8 in ?? () from /lib/i686/cmov/libc.so.6
> > #6 š0xb7433901 in ?? () from /lib/i686/cmov/libc.so.6
> > #7 š0xb7433d8d in realloc () from /lib/i686/cmov/libc.so.6
> > #8 š0xb718112d in str_append (data=0x96c1f58 "HTTP/1.0 501 Not
> > Implemented\r\nContent-Type: text/html\r\nServer: fapws3/0.10b",
> > š štext=0xb71858c0 "\r\n\r\n<html><head><title>Not Implemented</
> > head><body><p>Not Implemented!!!</p></body></html>") at fapws/extra.c:
> > 89
> > #9 š0xb7183edd in write_cb (loop=0xb717d2e0, w=0x993913c, revents=2)
> > at fapws/mainloop.c:520
> > #10 0xb7174934 in ev_invoke_pending () from /usr/lib/libev.so.3
> > #11 0xb7179f34 in ev_loop () from /usr/lib/libev.so.3
> > #12 0xb718498c in py_run_loop (self=0x0, args=0xb738102c) at fapws/
> > _evwsgi.c:210
> > #13 0x080e0721 in PyEval_EvalFrameEx ()
> > #14 0x080e2507 in PyEval_EvalCodeEx ()
> > #15 0x080e2607 in PyEval_EvalCode ()
> > #16 0x080ffcbd in PyRun_FileExFlags ()
> > #17 0x080fff22 in PyRun_SimpleFileExFlags ()
> > #18 0x0805dd81 in Py_Main ()
> > #19 0x0805cf6b in main ()
>
> > May be it helps.
>
> > On 24 ÍÁÒ, 02:17, william opensource4you <william.o...@gmail.com>

Black_Noir

unread,
Apr 9, 2012, 4:23:06 AM4/9/12
to Fast Asynchronous Python Web Server
2-3 days ago set :

proxy_ignore_client_abort on;

in nginx there is no crashes any more.
The problem may be related with situation when client closes a
connection without waiting for a response.

william opensource4you

unread,
Apr 9, 2012, 6:42:32 AM4/9/12
to fa...@googlegroups.com
Hi,


I've just pushed a Fix that remove those realloc functions.
On my system the problem does no more occurs.

But I don't have nginx :-(.
Your feedback is very welcome.


Thanks

Black_Noir

unread,
Apr 11, 2012, 1:27:45 AM4/11/12
to Fast Asynchronous Python Web Server
Hello,
After update problem disappeared.
Thank you.

On 9 апр, 16:42, william opensource4you <william.o...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages