Welcome! Log In Create A New Profile

Advanced

Re: nginx crash

July 26, 2022 10:24PM
Forgot to add, this is with nginx version: 1.20.1

On Tue, Jul 26, 2022 at 7:21 PM Dk Jack <dnj0496@gmail.com> wrote:

> Hi,
> 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 `
> ngx_http_realip_get_module_ctx`. What I noticed is `r->pool == 0`. Why
> would the r->pool be ever zero'ed?
>
> 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.
>
> Regards,
> Dk.
>
> static ngx_http_realip_ctx_t *
> ngx_http_realip_get_module_ctx(ngx_http_request_t *r)
> {
> ngx_pool_cleanup_t *cln;
> ngx_http_realip_ctx_t *ctx;
>
> ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module);
> if (ctx == NULL && (r->internal || r->filter_finalize)) {
> /*
> * if module context was reset, the original address
> * can still be found in the cleanup handler
> */
> for (cln = r->pool->cleanup; cln; cln = cln->next) {
> if (cln->handler == ngx_http_realip_cleanup) {
> ctx = cln->data;
> break;
> }
> }
> }
>
> return ctx;
> }
>
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

nginx crash

dnj0496 572 July 26, 2022 10:22PM

Re: nginx crash

dnj0496 204 July 26, 2022 10:24PM

Re: nginx crash

Maxim Dounin 155 July 27, 2022 09:36AM

Re: nginx crash

dnj0496 196 July 27, 2022 11:42AM

Re: nginx crash

Maxim Dounin 150 July 27, 2022 11:06PM

Re: nginx crash

dnj0496 232 July 27, 2022 11:18PM



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

Online Users

Guests: 311
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