[updated the subject to split from --lazy problems]
On Sun, Jan 22, 2012 at 2:18 PM, C Anthony Risinger <[email protected]> wrote:
> On Sun, Jan 22, 2012 at 10:57 AM, Roberto De Ioris <[email protected]> wrote:
>>
>> after having audited the code, it looks like a race condition already
>> fixed in reap_them_all() function months ago, but not in the
>> kill_them_all() (the one used by signal handling).
>>
>> Can you check if it works with the latest tip ?
>>
>> In addition to this, failed app loading in lazy mode, will trigger a
>> different log message.
>
> your change *mostly* works in my case:
>
> # ./uwsgi --plugin=python --pyshell --socket @null --master
> *** Starting uWSGI 1.1-dev-1854 (32bit) on [Sun Jan 22 14:10:03 2012] ***
> [...]
> *** Operational MODE: single process ***
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI master process (pid: 30455)
> spawned uWSGI worker 1 (pid: 30456, cores: 1)
>>>>
> DAMN ! worker 1 (pid: 30456) died :( trying respawn ...
> Respawned uWSGI worker 1 (new pid: 30457)
> ^CSIGINT/SIGQUIT received...killing workers...
> SIGINT/SIGQUIT received...killing workers...
>>>> worker 1 (pid: 30457) is taking too much time to die...NO MERCY !!!
> goodbye to uWSGI.
>
> ... so instead of flooding, it just proceeds normally until timeout,
> then brutally kills the interpreter process.
>
> however, i am now getting a SIGSEGV on normal SIGINT while at the
> --pyshell prompt:
>
> # ./uwsgi --pyshell --socket @null --master
> *** Starting uWSGI 1.1-dev-1854 (64bit) on [Sun Jan 22 14:08:38 2012] ***
> [...]
> *** Operational MODE: single process ***
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI master process (pid: 4283)
> spawned uWSGI worker 1 (pid: 4284, cores: 1)
>>>> SIGINT/SIGQUIT received...killing workers...
> !!! uWSGI process 4284 got Segmentation Fault !!!
> *** backtrace ***
> ./uwsgi(uwsgi_backtrace+0x30) [0x42fef0]
> /lib/libc.so.6(+0x349b0) [0x7f2f5167e9b0]
> /usr/lib/libpython3.2mu.so.1.0(+0xfdaa0) [0x7f2f51aeaaa0]
> /usr/lib/libpython3.2mu.so.1.0(PyEval_GetGlobals+0x9) [0x7f2f51ac7629]
> /usr/lib/libpython3.2mu.so.1.0(PyImport_Import+0x33) [0x7f2f51ae4493]
> /usr/lib/libpython3.2mu.so.1.0(PyImport_ImportModule+0x1c) [0x7f2f51ae471c]
> ./uwsgi(get_uwsgi_pydict+0x9) [0x440909]
> ./uwsgi(uwsgi_python_atexit+0x1e) [0x43ee0e]
> ./uwsgi(uwsgi_plugins_atexit+0x71) [0x42fa21]
> /lib/libc.so.6(+0x37481) [0x7f2f51681481]
> /lib/libc.so.6(+0x37505) [0x7f2f51681505]
> ./uwsgi() [0x42f9ae]
> /lib/libpthread.so.0(+0xf8a0) [0x7f2f537ef8a0]
> /lib/libc.so.6(__select+0x13) [0x7f2f51726963]
> /usr/lib/python3.2/lib-dynload/readline.cpython-32mu.so(+0x34a0)
> [0x7f2f4eb974a0]
> /usr/lib/libpython3.2mu.so.1.0(PyOS_Readline+0x150) [0x7f2f51a3a910]
> /usr/lib/libpython3.2mu.so.1.0(+0x4e713) [0x7f2f51a3b713]
> /usr/lib/libpython3.2mu.so.1.0(PyTokenizer_Get+0x58) [0x7f2f51a3c428]
> /usr/lib/libpython3.2mu.so.1.0(+0x4b1d5) [0x7f2f51a381d5]
> /usr/lib/libpython3.2mu.so.1.0(PyParser_ASTFromFile+0x99) [0x7f2f51aedc99]
> /usr/lib/libpython3.2mu.so.1.0(PyRun_InteractiveOneFlags+0x123)
> [0x7f2f51aeee73]
> /usr/lib/libpython3.2mu.so.1.0(PyRun_InteractiveLoopFlags+0x4e)
> [0x7f2f51aef1be]
> ./uwsgi(uwsgi_python_hijack+0x69) [0x43ed89]
> ./uwsgi(uwsgi_ignition+0x31) [0x431251]
> ./uwsgi(uwsgi_start+0x2892) [0x436bd2]
> ./uwsgi(main+0x1503) [0x413553]
> /lib/libc.so.6(__libc_start_main+0xed) [0x7f2f5166b38d]
> ./uwsgi() [0x4136c5]
> *** end of backtrace ***
> goodbye to uWSGI.
>
> ... this behavior is on x86, x86_64 + python 2.7, 3.2 and ARM (32?)
> python 2.6, 3.1, with or without --master (child processes is the one
> segfaulting though).
i meant to include some backtraces -- first is python 2.7, second is
python3.2, both x86_64. python seems to be triggering the segfault
... competition with uWSGI to destroy itself?
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5f0fb00 in threadstate_getframe () from /usr/lib/libpython2.7.so.1.0
(gdb) bt
#0 0x00007ffff5f0fb00 in threadstate_getframe () from
/usr/lib/libpython2.7.so.1.0
#1 0x00007ffff5eef669 in PyEval_GetGlobals () from /usr/lib/libpython2.7.so.1.0
#2 0x00007ffff5f09513 in PyImport_Import () from /usr/lib/libpython2.7.so.1.0
#3 0x00007ffff5f0976c in PyImport_ImportModule () from
/usr/lib/libpython2.7.so.1.0
#4 0x0000000000440b89 in get_uwsgi_pydict ()
#5 0x000000000043f19e in uwsgi_python_atexit ()
#6 0x000000000042fca1 in uwsgi_plugins_atexit ()
#7 0x00007ffff5aa9481 in __run_exit_handlers () from /lib/libc.so.6
#8 0x00007ffff5aa9505 in exit () from /lib/libc.so.6
#9 0x000000000042fc2e in end_me ()
#10 <signal handler called>
#11 0x00007ffff5b4e963 in __select_nocancel () from /lib/libc.so.6
#12 0x00007ffff32cf190 in ?? () from /usr/lib/python2.7/lib-dynload/readline.so
#13 0x00007ffff5e57ba0 in PyOS_Readline () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff5e58805 in tok_nextc () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff5e59608 in PyTokenizer_Get () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff5e55453 in parsetok () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff5f11a33 in PyParser_ASTFromFile () from
/usr/lib/libpython2.7.so.1.0
#18 0x00007ffff5f12a69 in PyRun_InteractiveOneFlags () from
/usr/lib/libpython2.7.so.1.0
#19 0x00007ffff5f12cce in PyRun_InteractiveLoopFlags () from
/usr/lib/libpython2.7.so.1.0
#20 0x000000000043f119 in uwsgi_python_hijack ()
#21 0x00000000004314f1 in uwsgi_ignition ()
#22 0x0000000000436f4a in uwsgi_start ()
#23 0x0000000000413365 in main ()
Program received signal SIGSEGV, Segmentation fault.
threadstate_getframe (self=0x0) at Python/pystate.c:160
160 Python/pystate.c: No such file or directory.
in Python/pystate.c
(gdb) bt
#0 threadstate_getframe (self=0x0) at Python/pystate.c:160
#1 0x00007ffff5ea6629 in PyEval_GetGlobals () at Python/ceval.c:3735
#2 0x00007ffff5ec3493 in PyImport_Import (module_name=0x7ffff379da40)
at Python/import.c:3042
#3 0x00007ffff5ec371c in PyImport_ImportModule (name=<optimized out>)
at Python/import.c:2333
#4 0x0000000000440909 in get_uwsgi_pydict ()
#5 0x000000000043ee0e in uwsgi_python_atexit ()
#6 0x000000000042fa21 in uwsgi_plugins_atexit ()
#7 0x00007ffff5a60481 in __run_exit_handlers () from /lib/libc.so.6
#8 0x00007ffff5a60505 in exit () from /lib/libc.so.6
#9 0x000000000042f9ae in end_me ()
#10 <signal handler called>
#11 0x00007ffff5b05963 in __select_nocancel () from /lib/libc.so.6
#12 0x00007ffff2f764a0 in ?? () from
/usr/lib/python3.2/lib-dynload/readline.cpython-32mu.so
#13 0x00007ffff5e19910 in PyOS_Readline (sys_stdin=0x7ffff5dc7220,
sys_stdout=0x7ffff5dc7140, prompt=0x7ffff7f39f00 ">>> ")
at Parser/myreadline.c:198
#14 0x00007ffff5e1a713 in tok_nextc (tok=0x87e8f0) at Parser/tokenizer.c:897
#15 0x00007ffff5e1b428 in tok_get (p_end=0x7fffffffdad8,
p_start=0x7fffffffdad0, tok=0x87e8f0) at Parser/tokenizer.c:1306
#16 PyTokenizer_Get (tok=0x87e8f0, p_start=0x7fffffffdad0,
p_end=0x7fffffffdad8) at Parser/tokenizer.c:1687
#17 0x00007ffff5e171d5 in parsetok (tok=0x87e8f0, g=<optimized out>,
start=<optimized out>, err_ret=0x7fffffffdb40, flags=0x7fffffffdb7c)
at Parser/parsetok.c:150
#18 0x00007ffff5eccc99 in PyParser_ASTFromFile (fp=<optimized out>,
filename=0x45ab43 "uwsgi", enc=<optimized out>, start=<optimized out>,
ps1=<optimized out>, ps2=<optimized out>, flags=0x7fffffffdc50,
errcode=0x7fffffffdc0c, arena=0x840e60) at Python/pythonrun.c:1914
#19 0x00007ffff5ecde73 in PyRun_InteractiveOneFlags
(fp=0x7ffff5dc7220, filename=0x45ab43 "uwsgi", flags=0x7fffffffdc50)
at Python/pythonrun.c:1150
#20 0x00007ffff5ece1be in PyRun_InteractiveLoopFlags
(fp=0x7ffff5dc7220, filename=0x45ab43 "uwsgi", flags=0x7fffffffdc50)
at Python/pythonrun.c:1061
#21 0x000000000043ed89 in uwsgi_python_hijack ()
#22 0x0000000000431251 in uwsgi_ignition ()
#23 0x0000000000436bd2 in uwsgi_start ()
#24 0x0000000000413553 in main ()
--
C Anthony
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi