segfault mod upload progress v0.2

Александр Кутузов alleteam at gmail.com
Wed Apr 30 11:26:13 MSD 2008


юзаю сию прелесть, какоето время гонял его на 0.6.27 без проблем.

сечас собрал сию прелесть на 0.6.30, напоролся на то что nginx
выпадает в сегфолт изза него:
собрано на дебьяне с ядром 2.6.24-1-686
сегфолт получается очень забавным, такое ощущение что nginx пытается
отдать 404 и в это же время аплоад прогресс отдает статус.
bt для это прелести:

#0  0x08095c69 in ngx_http_reportuploads_handler (r=0x80c2688) at
nginx_uploadprogress_module/ngx_http_uploadprogress_module.c:431
	id = <value optimized out>
	b = (ngx_buf_t *) 0x80b9750
	out = {buf = 0x80b9750, next = 0x0}
	orig = (ngx_http_request_t *) 0x80c2a90
	rc = <value optimized out>
	size = <value optimized out>
	i = <value optimized out>
	shpool = (ngx_slab_pool_t *) 0xb7baa000
	upcf = <value optimized out>
	up = <value optimized out>
	expires = <value optimized out>
	cc = <value optimized out>
	ccp = <value optimized out>
#1  0x0806b964 in ngx_http_core_content_phase (r=0x80c2688,
ph=0x80c4a90) at src/http/ngx_http_core_module.c:1014
	root = 134851251
	rc = <value optimized out>
	path = {len = 134952136, data = 0x0}
#2  0x08067835 in ngx_http_handler (r=0x80c2688) at
src/http/ngx_http_core_module.c:668
No locals.
#3  0x0806795e in ngx_http_update_location_config (r=0x80c2688) at
src/http/ngx_http_core_module.c:1070
	clcf = (ngx_http_core_loc_conf_t *) 0x6c707061
#4  0x0806fa51 in ngx_http_process_unique_header_line (r=0x80c6e78,
h=0x6c707061, offset=5) at src/http/ngx_http_request.c:1208
	ph = <value optimized out>
#5  0x080705e4 in ngx_http_process_request_line (rev=0x80dae48) at
src/http/ngx_http_request.c:624
	n = <value optimized out>
	rc = <value optimized out>
	rv = <value optimized out>
	c = (ngx_connection_t *) 0x80c26bc
	r = (ngx_http_request_t *) 0x80c2688
#6  0x08070ab0 in ngx_http_parse_request_line (r=0x80dae48, b=0x38) at
src/http/ngx_http_parse.c:136
	ch = 136 '\210'
	p = (u_char *) 0x809bbef "ontent-Length"
	m = <value optimized out>
	state = 135014076
#7  0x0806d547 in ngx_http_keepalive_handler (rev=0x80dae48) at
src/http/ngx_http_request.c:2198
	size = <value optimized out>
	n = <value optimized out>
	b = <value optimized out>
	c = (ngx_connection_t *) 0x80c2688
#8  0x0805d354 in ngx_event_busy_lock_cancel (bl=0x80b3a38,
ctx=0x80dae48) at src/event/ngx_event_busy_lock.c:191
	c = (ngx_event_busy_lock_ctx_t *) 0x653d4654
	p = (ngx_event_busy_lock_ctx_t *) 0x6c707061
#9  0x0805d179 in ngx_event_expire_timers () at src/event/ngx_event_timer.c:77
	ev = <value optimized out>
	node = <value optimized out>
---Type <return> to continue, or q <return> to quit---
	root = <value optimized out>
	sentinel = <value optimized out>
#10 0x08063942 in ngx_worker_process_cycle (cycle=0x80b3a38, data=0x0)
at src/os/unix/ngx_process_cycle.c:775
	i = 134916896
	c = <value optimized out>
#11 0x080622e1 in ngx_spawn_process (cycle=0x80b3a38, proc=0x80632ce
<ngx_worker_process_cycle+64>, data=0x0, name=0x809a0f3 "borting",
respawn=1) at src/os/unix/ngx_process.c:196
	on = 1
	pid = 0
	s = 1
#12 0x0806431a in ngx_master_process_cycle (cycle=0x80b3a38) at
src/os/unix/ngx_process_cycle.c:574
	title = <value optimized out>
	p = <value optimized out>
	size = 47
	i = 64
	n = 64
	set = {__val = {0 <repeats 32 times>}}
	itv = {it_interval = {tv_sec = -1077034088, tv_usec = 1}, it_value =
{tv_sec = -1077033992, tv_usec = 0}}
	live = 1
	delay = 0
	ccf = (ngx_core_conf_t *) 0x80b41e4
#13 0x0804b222 in main (argc=3, argv=0xbfcdc594) at src/core/nginx.c:388
	i = <value optimized out>
	log = (ngx_log_t *) 0x80a909c
	cycle = <value optimized out>
	init_cycle = {conf_ctx = 0x0, pool = 0x80b3498, log = 0x80a909c,
new_log = 0x0, files = 0x0, free_connections = 0x0, free_connection_n
= 0, listening = {elts = 0x0, nelts = 0, size = 0, nalloc = 0,
    pool = 0x0}, pathes = {elts = 0x0, nelts = 0, size = 0, nalloc =
0, pool = 0x0}, open_files = {last = 0x0, part = {elts = 0x0, nelts =
0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, shared_memory = {
    last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0,
nalloc = 0, pool = 0x0}, connection_n = 0, files_n = 0, connections =
0x0, read_events = 0x0, write_events = 0x0, old_cycle = 0x0,
  conf_file = {len = 15, data = 0x80b30e0 "conf/nginx.conf"}, root =
{len = 0, data = 0x0}, lock_file = {len = 0, data = 0x0}}
	ccf = <value optimized out>

(gdb) f 0
#0  0x08095c69 in ngx_http_reportuploads_handler (r=0x80c2688) at
nginx_uploadprogress_module/ngx_http_uploadprogress_module.c:431
431	                        (orig->headers_in.content_length_n -
(gdb) l
426	                       sizeof("new Object({ 'state' : 'uploading',
'received' : ") -
427	                       1);
428	
429	        b->last =
430	            ngx_sprintf(b->last, "%uO, 'size' : %uO })\r\n",
431	                        (orig->headers_in.content_length_n -
432	                         orig->request_body->rest),
433	                        orig->headers_in.content_length_n);
434	
435	        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
(gdb) p orig->request_body->rest
Cannot access memory at address 0x6c70706d


помимо мастер процесса, 1 дочерний, если неправ при вытаскивании
данных из корки, поправьте. в момент сегфолта, отдается ответ порой
неполный порой пустой, если неполный то там часть выхода аплоад
прогресса и попытки нгинкса выдать ошибку.

если не по адресу, то извиняйте, автора модуля не могу найти.


More information about the nginx-ru mailing list