<div dir="ltr">Hi, guys<div><br></div><div>I found a coredump file generated on production. </div><div><br></div><div><br></div><div>(gdb) print ngx_http_abc_module</div><div>$7 = {ctx_index = 18446744073709551615, index = 18446744073709551615, name = 0x0, spare0 = 0, spare1 = 0, version = 1010001, signature = 0x3520 <Address 0x3520 out of bounds>,</div><div>  ctx = 0x204800, commands = 0x204840, type = 1347703880, init_master = 0, init_module = 0, init_process = 0, init_thread = 0, exit_thread = 0, exit_process = 0,</div><div>  exit_master = 0, spare_hook0 = 0, spare_hook1 = 0, spare_hook2 = 0, spare_hook3 = 0, spare_hook4 = 0, spare_hook5 = 0, spare_hook6 = 0, spare_hook7 = 0} </div><div><br></div><div><br></div><div><div>The ngx_http_'abc'_module is a simple module written by ourself.</div><div>It runed well in the past time, and I just changed the following structure defined in the module.</div></div><div><br></div><div><p class="gmail-p1"><span class="gmail-s1">typedef struct {</span></p><p class="gmail-p1"><span class="gmail-s1">    ngx_flag_t         valid;</span></p><p class="gmail-p1"><span class="gmail-s1">    ...</span></p><p class="gmail-p1"><span class="gmail-s1">    ngx_uint_t  <span class="gmail-Apple-tab-span">       </span>   member1;  # added</span></p><p class="gmail-p1"><span class="gmail-s1">    ngx_uint_t         member2;  # added</span></p><p class="gmail-p1"><span class="gmail-s1">    ...</span></p><p class="gmail-p1"><span class="gmail-s1">} ngx_http_abc_ctx_t;</span></p><p class="gmail-p1"><span class="gmail-s1"><br></span></p></div><div>nginx.conf</div><div><br></div><div>load_module  modules/....;</div><div>load_module  modules/ngx_http_abc_module_3.so;  # This module is in the last postion, the other modules seems right.</div><div><br></div><div><p class="gmail-p1">And there is tiny detail. I generate so file named 'ngx_http_abc_module.so', then I copy as ngx_http_abc_module_3.so</p></div><div><br></div><div>And here are short codes about this module.</div><div>







<p class="gmail-p1"><span class="gmail-s1">static ngx_int_t</span></p>
<p class="gmail-p1"><span class="gmail-s1">ngx_http_abc_handler(ngx_http_request_t *r)</span></p>
<p class="gmail-p1"><span class="gmail-s1">{</span></p>
<p class="gmail-p1"><span class="gmail-s1">    ...</span></p>
<p class="gmail-p1"><span class="gmail-s1">    ngx_http_abc_ctx_t             *ctx;</span></p>
<p class="gmail-p1"><span class="gmail-s1">    ngx_http_abc_loc_conf_t     *vlcf;</span></p>
<p class="gmail-p1"><span class="gmail-s1">    vlcf = ngx_http_get_module_loc_conf(r, ngx_http_abc_module);</span></p>
<p class="gmail-p1"><span class="gmail-s1">    if (vlcf->enable == 0) {</span></p>
<p class="gmail-p1"><span class="gmail-s1">        return NGX_DECLINED;</span></p>
<p class="gmail-p1"><span class="gmail-s1">    }</span></p>
<p class="gmail-p1"><span class="gmail-s1">    ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_abc_ctx_t));</span></p>
<p class="gmail-p1"><span class="gmail-s1">    if (ctx == NULL) {</span></p>
<p class="gmail-p1"><span class="gmail-s1">        return NGX_ERROR;</span></p>
<p class="gmail-p1"><span class="gmail-s1">    }</span></p>
<p class="gmail-p1"><span class="gmail-s1">    ngx_http_set_ctx(r, ctx, ngx_http_abc_module);</span></p>
<p class="gmail-p1"><span class="gmail-s1">    …</span></p>
<p class="gmail-p1"><span class="gmail-s1">}</span></p><p class="gmail-p1"><span class="gmail-s1"><br></span></p><p class="gmail-p1"><span class="gmail-s1">config</span></p><p class="gmail-p1">ngx_addon_name="ngx_http_abc_module"</p><p class="gmail-p1">ngx_module_type=HTTP</p><p class="gmail-p1">ngx_module_name=ngx_http_abc_module</p><p class="gmail-p1">ngx_module_incs="$ngx_addon_dir"</p><p class="gmail-p1">ngx_module_srcs="$ngx_addon_dir/ngx_http_abc_module.c"</p><p class="gmail-p1">. auto/module<br></p><p class="gmail-p1"><br></p><p class="gmail-p1">It's sad that I can't regenerate coredump file now.</p><p class="gmail-p1">By the way, It's so convinient that use dso instead of upgrading static module.</p><p class="gmail-p1">Thanks so much.</p><p class="gmail-p1"><br></p><p class="gmail-p1">B.R.</p></div></div>