<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi, all</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> 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):</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>Program received signal EXC_ARITHMETIC, Arithmetic exception.</div><div>0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970, key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22</div>
<div>22<span style="white-space:pre-wrap"> </span> elt = hash->buckets[key % hash->size];</div><div><br></div><div>(gdb) bt</div><div>#0 0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970, key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22</div>
<div>#1 0x0000000109513da4 in ngx_http_upstream_process_headers (r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1924</div><div>#2 0x000000010951322f in ngx_http_upstream_process_header (r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1639</div>
<div>#3 0x0000000109511618 in ngx_http_upstream_handler (ev=0x7febb283c0a0) at ngx_http_upstream.c:935</div><div>#4 0x00000001094d8617 in ngx_kqueue_process_events (cycle=0x7febb280b850, timer=60000, flags=1) at ngx_kqueue_module.c:684</div>
<div>#5 0x00000001094c706a in ngx_process_events_and_timers (cycle=0x7febb280b850) at ngx_event.c:247</div><div>#6 0x00000001094d5844 in ngx_worker_process_cycle (cycle=0x7febb280b850, data=0x0) at ngx_process_cycle.c:808</div>
<div>#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</div><div>
#8 0x00000001094d4669 in ngx_start_worker_processes (cycle=0x7febb280b850, n=1, type=-3) at ngx_process_cycle.c:365</div><div>#9 0x00000001094d3b21 in ngx_master_process_cycle (cycle=0x7febb280b850) at ngx_process_cycle.c:137</div>
<div>#10 0x000000010949b511 in main (argc=1, argv=0x7fff56765cd0) at nginx.c:410</div><div><br></div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div>
(gdb) f 1</div><div>#1 0x0000000109513da4 in ngx_http_upstream_process_headers (r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1924</div><div>1924<span style="white-space:pre-wrap"> </span> if (ngx_hash_find(&u->conf->hide_headers_hash, h[i].hash,</div>
<div><br></div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div>(gdb) f 0</div><div>#0 0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970, key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22</div>
<div>22<span style="white-space:pre-wrap"> </span> elt = hash->buckets[key % hash->size];</div><div><br></div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>(gdb) p *hash</div><div>$6 = {</div><div> buckets = 0x0, </div><div> size = 0</div><div>}</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br>
</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">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?</div>