Иногда падает nginx…

Kirill A. Korinskiy catap at catap.ru
Fri May 16 22:20:16 MSD 2008


Добрый вечер, Игорь.

Иногда у меня падает nginx таким вот образом:

Core was generated by `nginx: worker'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000423177 in ngx_event_process_posted (cycle=0x598da0, posted=0x58b1f0) at src/event/ngx_event_posted.c:37
37              ngx_delete_posted_event(ev);
(gdb) bt
#0  0x0000000000423177 in ngx_event_process_posted (cycle=0x598da0, posted=0x58b1f0) at src/event/ngx_event_posted.c:37
#1  0x000000000042104c in ngx_process_events_and_timers (cycle=0x598da0) at src/event/ngx_event.c:278
#2  0x000000000042cdeb in ngx_worker_process_cycle (cycle=0x598da0, data=0x0) at src/os/unix/ngx_process_cycle.c:767
#3  0x0000000000429e50 in ngx_spawn_process (cycle=0x598da0, proc=0x42cc6d <ngx_worker_process_cycle>, data=0x0, name=0x470950 "worker process", 
    respawn=-2) at src/os/unix/ngx_process.c:187
#4  0x000000000042bcd5 in ngx_start_worker_processes (cycle=0x598da0, n=4, type=-2) at src/os/unix/ngx_process_cycle.c:332
#5  0x000000000042b3f9 in ngx_master_process_cycle (cycle=0x598da0) at src/os/unix/ngx_process_cycle.c:124
#6  0x0000000000402e55 in main (argc=1, argv=0x7fffa9ee7bd8) at src/core/nginx.c:355
(gdb)

При этом ev->next и ev->prev есть NULL.

Если посмотреть на ngx_delete_posted_event то можно видеть:

#define ngx_delete_posted_event(ev)                                           \
                                                                              \
    *(ev->prev) = ev->next;                                                   \
                                                                              \
    if (ev->next) {                                                           \
        ev->next->prev = ev->prev;                                            \
    }                                                                         \
                                                                              \
    ev->prev = NULL;                                                          \
    ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0,                            \
                   "delete posted event %p", ev);

И вот мне не совсем понятно, почему тут нет проверки на для ev->prev на NULL?

-- 
| |*| |  Kirill A. Korinskiy <catap at catap.ru>
| | |*|  proud (maniac)? (developer|hacker)
|*|*|*|  http://catap.ru/ - +7 (916) 3-604-704 - xmpp:catap at catap.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20080516/0214c61e/attachment.pgp>


More information about the nginx-ru mailing list