Welcome! Log In Create A New Profile

Advanced

Can hide_headers_hash in ngx_http_upstream_conf_t be empty?

Thomas
August 13, 2012 02:26AM
Hi, all

I'm writing a proxy module which sends http requests to local cache
server through upstream. It seems that the worker will crush if the
upstream->conf->hide_headers_hash is empty, following is my gdb stack(nginx
1.2.2, Apple Mountain Lion):

Program received signal EXC_ARITHMETIC, Arithmetic exception.
0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970, key=3389140803,
name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22
22 elt = hash->buckets[key % hash->size];

(gdb) bt
#0 0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970,
key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22
#1 0x0000000109513da4 in ngx_http_upstream_process_headers
(r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1924
#2 0x000000010951322f in ngx_http_upstream_process_header
(r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1639
#3 0x0000000109511618 in ngx_http_upstream_handler (ev=0x7febb283c0a0) at
ngx_http_upstream.c:935
#4 0x00000001094d8617 in ngx_kqueue_process_events (cycle=0x7febb280b850,
timer=60000, flags=1) at ngx_kqueue_module.c:684
#5 0x00000001094c706a in ngx_process_events_and_timers
(cycle=0x7febb280b850) at ngx_event.c:247
#6 0x00000001094d5844 in ngx_worker_process_cycle (cycle=0x7febb280b850,
data=0x0) at ngx_process_cycle.c:808
#7 0x00000001094d1a36 in ngx_spawn_process (cycle=0x7febb280b850,
proc=0x1094d5670 <ngx_worker_process_cycle>, data=0x0, name=0x10958b920
"worker process", respawn=-3) at ngx_process.c:198
#8 0x00000001094d4669 in ngx_start_worker_processes (cycle=0x7febb280b850,
n=1, type=-3) at ngx_process_cycle.c:365
#9 0x00000001094d3b21 in ngx_master_process_cycle (cycle=0x7febb280b850)
at ngx_process_cycle.c:137
#10 0x000000010949b511 in main (argc=1, argv=0x7fff56765cd0) at nginx.c:410

(gdb) f 1
#1 0x0000000109513da4 in ngx_http_upstream_process_headers
(r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1924
1924 if (ngx_hash_find(&u->conf->hide_headers_hash, h[i].hash,

(gdb) f 0
#0 0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970,
key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22
22 elt = hash->buckets[key % hash->size];

(gdb) p *hash
$6 = {
buckets = 0x0,
size = 0
}

I checked ngx_http_proxy_module and it fills the hash with some default
values, but what should I do if i'm not hiding any response header?
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Can hide_headers_hash in ngx_http_upstream_conf_t be empty?

Thomas 1239 August 13, 2012 02:26AM

Re: Can hide_headers_hash in ngx_http_upstream_conf_t be empty?

Maxim Dounin 642 August 13, 2012 11:06AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready