ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nginx-0.5.32 crashed



Похоже, что где-то записывается больше, чем выделено памяти.

Увеличил развер буфера в несколько раз и включил NGX_DEBUG_MALLOC,
в результате coredump зачастили до 1 шт. в час, причем вывод gdb у все одинаковый:

#0 0x0805ad6e in ngx_event_pipe_write_to_downstream (p=0x8a0c724) at src/event/ngx_event_pipe.c:483
483                 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
(gdb) bt
#0 0x0805ad6e in ngx_event_pipe_write_to_downstream (p=0x8a0c724) at src/event/ngx_event_pipe.c:483 #1 0x0805a14f in ngx_event_pipe (p=0x8a0c724, do_write=-791621424) at src/event/ngx_event_pipe.c:33 #2 0x080741e3 in ngx_http_upstream_process_body (ev=0x80e7960) at src/http/ngx_http_upstream.c:1921 #3 0x08060a84 in ngx_kqueue_process_events (cycle=0x80b3020, timer=94, flags=1) at src/event/modules/ngx_kqueue_module.c:664 #4 0x08057a64 in ngx_process_events_and_timers (cycle=0x80b3020) at src/event/ngx_event.c:245 #5 0x0805ea39 in ngx_worker_process_cycle (cycle=0x80b3020, data=0x0) at src/os/unix/ngx_process_cycle.c:760 #6 0x0805cf8e in ngx_spawn_process (cycle=0x80b3020, proc=0x805e970 <ngx_worker_process_cycle>, data=0x0, name=0x809725f "worker process", respawn=3)
   at src/os/unix/ngx_process.c:187
#7 0x0805e6c7 in ngx_reap_childs (cycle=0x80b3020) at src/os/unix/ngx_process_cycle.c:561 #8 0x0805dd53 in ngx_master_process_cycle (cycle=0x80b3020) at src/os/unix/ngx_process_cycle.c:162 #9 0x0804afd6 in main (argc=134898976, argv=0xbfbfec50) at src/core/nginx.c:353
(gdb)

Отпишу как закончу тесты с valgrind под FreeBSD.

----- Original Message ----- From: "Igor Sysoev" <is@xxxxxxxxxxxxx>
To: <nginx-ru@xxxxxxxxx>
Sent: Thursday, October 11, 2007 2:40 PM
Subject: Re: nginx-0.5.32 crashed


On Thu, Oct 11, 2007 at 01:47:44PM +0400, Denis Erygin wrote:

Собран с самописным простым модулем фильтром (draft),
который использует ngx_pcalloc для строк и буферов,
но память явно не чистит, оставляет это пулу nginx.

Корки очень редкие, ссылок на код модуля в них нет,
пока без понятия куда копать...

Похоже, что где-то записывается больше, чем выделено памяти.

----- Original Message ----- From: "Igor Sysoev" <is@xxxxxxxxxxxxx>
To: <nginx-ru@xxxxxxxxx>
Sent: Thursday, October 11, 2007 12:59 PM
Subject: Re: nginx-0.5.32 crashed


On Thu, Oct 11, 2007 at 12:54:14PM +0400, Denis Erygin wrote:

>И вторая версия coredump тамже:

Это стандартный nginx без дополнительных модулей ?

>#0  ngx_event_pipe_read_upstream (p=0x812c698) at
>src/event/ngx_event_pipe.c:375
>375         for (cl = p->free_raw_bufs; cl; cl = cl->next) {
>(gdb) bt
>#0  ngx_event_pipe_read_upstream (p=0x812c698) at
>src/event/ngx_event_pipe.c:375
>#1  0x0805a0de in ngx_event_pipe (p=0x812c698, do_write=135448216) at
>src/event/ngx_event_pipe.c:43
>#2  0x08074147 in ngx_http_upstream_process_body (ev=0x80e42f8) at
>src/http/ngx_http_upstream.c:1921
>#3  0x080609e8 in ngx_kqueue_process_events (cycle=0x80b3020, timer=68,
>flags=1) at src/event/modules/ngx_kqueue_module.c:664
>#4  0x080579d0 in ngx_process_events_and_timers (cycle=0x80b3020) at
>src/event/ngx_event.c:245
>#5  0x0805e9a5 in ngx_worker_process_cycle (cycle=0x80b3020, data=0x0) at
>src/os/unix/ngx_process_cycle.c:760
>#6  0x0805cefa in ngx_spawn_process (cycle=0x80b3020, proc=0x805e8dc
><ngx_worker_process_cycle>, data=0x0,
>    name=0x8096f2b "worker process", respawn=1) at
>src/os/unix/ngx_process.c:187
>#7  0x0805e633 in ngx_reap_childs (cycle=0x80b3020) at
>src/os/unix/ngx_process_cycle.c:561
>#8  0x0805dcbf in ngx_master_process_cycle (cycle=0x80b3020) at
>src/os/unix/ngx_process_cycle.c:162
>#9  0x0804af72 in main (argc=134898208, argv=0xbfbfece4) at
>src/core/nginx.c:353
>(gdb)
> ----- Original Message ----- > From: Denis Erygin
>  To: nginx-ru@xxxxxxxxx
>  Sent: Thursday, October 11, 2007 12:26 PM
>  Subject: nginx-0.5.32 crashed
>
>
>  Добрый день,
>
>  Примерно раз в день получаю такой coredump:
>
>  GNU gdb 6.1.1 [FreeBSD 5.5]
>  This GDB was configured as "i386-marcel-freebsd"...
>  Core was generated by `nginx'.
>  Program terminated with signal 11, Segmentation fault.
>
>  #0  ngx_palloc (pool=0x8a78000, size=8) at src/core/ngx_palloc.c:115
>  115                     m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
>  (gdb) bt
>  #0  ngx_palloc (pool=0x8a78000, size=8) at src/core/ngx_palloc.c:115
>  #1  0x0804d8b9 in ngx_alloc_chain_link (pool=0x0) at
>src/core/ngx_buf.c:58
> #2 0x0805b4b6 in ngx_event_pipe_add_free_buf (p=0x8a78710, > b=0x8a78688)
>at src/event/ngx_event_pipe.c:889
>  #3  0x0805afa4 in ngx_event_pipe_write_to_downstream (p=0x8a78710) at
>src/event/ngx_event_pipe.c:631
>  #4  0x0805a0bb in ngx_event_pipe (p=0x8a78710, do_write=4064) at
>src/event/ngx_event_pipe.c:33
>  #5  0x08074147 in ngx_http_upstream_process_body (ev=0x80e41cc) at
>src/http/ngx_http_upstream.c:1921
>  #6  0x08058c4b in ngx_event_process_posted (cycle=0x80b3020,
>posted=0x80a8700) at src/event/ngx_event_posted.c:39
>  #7  0x08057a96 in ngx_process_events_and_timers (cycle=0x80b3020) at
>src/event/ngx_event.c:272
>  #8  0x0805e9a5 in ngx_worker_process_cycle (cycle=0x80b3020, data=0x0)
>at src/os/unix/ngx_process_cycle.c:760
>  #9  0x0805cefa in ngx_spawn_process (cycle=0x80b3020, proc=0x805e8dc
><ngx_worker_process_cycle>, data=0x0, name=0x8096f2b "worker pro
>  cess", respawn=-2)
>      at src/os/unix/ngx_process.c:187
>  #10 0x0805e18e in ngx_start_worker_processes (cycle=0x80b3020, n=4,
>type=-2) at src/os/unix/ngx_process_cycle.c:332
>  #11 0x0805db47 in ngx_master_process_cycle (cycle=0x80b3020) at
>src/os/unix/ngx_process_cycle.c:124
>  #12 0x0804af72 in main (argc=134898208, argv=0xbfbfece4) at
>src/core/nginx.c:353
>

--
Игорь Сысоев
http://sysoev.ru



--
Игорь Сысоев
http://sysoev.ru




 




Copyright © Lexa Software, 1996-2009.