<div dir="ltr">Forgot to add, this is with nginx version: 1.20.1</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 26, 2022 at 7:21 PM Dk Jack <<a href="mailto:dnj0496@gmail.com">dnj0496@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div>I am noticing a crash in my nginx module. The crash is happening after an internal redirect. It's not always happening but for certain requests. Besides the trace log I do not have much info about the request. In my module, I am restoring the my module context in a similar fashion as the `<span style="font-family:monospace">ngx_http_realip_get_module_ctx`</span>. What I noticed is `r->pool == 0`. Why would the r->pool be ever zero'ed?</div><div><br></div><div>The crash is happening in my get_module_ctx function which was called immediately after returning from the ngx_http_internal_redirect call. Any ideas on how to go about resolving this is greatly appreciated. Thanks.</div><div><br></div><div>Regards,</div><div>Dk. </div><div><br></div><div><font face="monospace">static ngx_http_realip_ctx_t *<br>ngx_http_realip_get_module_ctx(ngx_http_request_t *r)<br>{<br> ngx_pool_cleanup_t *cln;<br> ngx_http_realip_ctx_t *ctx;<br><br> ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module);<br> if (ctx == NULL && (r->internal || r->filter_finalize)) {<br> /*<br> * if module context was reset, the original address<br> * can still be found in the cleanup handler<br> */<br> for (cln = r->pool->cleanup; cln; cln = cln->next) {<br> if (cln->handler == ngx_http_realip_cleanup) {<br> ctx = cln->data;<br> break;<br> }<br> }<br> }<br><br> return ctx;<br>}</font><br></div></div>
</blockquote></div>