Welcome! Log In Create A New Profile

Advanced

Re: [ANNOUNCE] auth request module

agentzh
March 11, 2010 05:10AM
On Mon, Mar 1, 2010 at 4:45 PM, Valery Kholodkov >> It's mostly an
issue in the ngx_eval, not your excellent
>> ngx_auth_request ;)
>
> What kind of issue is it?
>

ngx_eval cannot be used in subrequests. Consider the following example:

location /foo {
add_before_body /bah;
#echo_location_async /bah;
echo done;
}
location /bah {
eval $foo {
proxy_pass $scheme://127.0.0.1:$server_port/baz;
}
echo [$foo];
}
location /baz {
echo baz;
}

Accessing /bah gives the correct output (using the git HEAD of your repos):

[baz]

But accessing /foo results in a segfault. Here's the gdb output:

Program received signal SIGSEGV, Segmentation fault.
memcpy () at ../sysdeps/i386/i686/memcpy.S:100
100 ../sysdeps/i386/i686/memcpy.S: No such file or directory.
in ../sysdeps/i386/i686/memcpy.S
Current language: auto
The current source language is "auto; currently asm".
(gdb) bt
#0 memcpy () at ../sysdeps/i386/i686/memcpy.S:100
#1 0x0804fb6e in ngx_vslprintf (buf=0x3ffffafa <Address 0x3ffffafa
out of bounds>,
last=0xbffff3ac "\005", fmt=0x80aaa1c "V?%V\"", args=0xbffff3e4 "")
at /usr/include/bits/string3.h:52
#2 0x0804be81 in ngx_log_error_core (level=805306387, log=0x80c6258,
err=527676,
fmt=0x64000000 <Address 0x64000000 out of bounds>) at src/core/ngx_log.c:119
#3 0x88000075 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

By using ngx_echo module's echo_location_async to issue the subrequest
gives identical segfault :)

I haven't tracked deep into the source but at least the lines starting
from ngx_http_eval_module.c:141 don't like subrequests' contexts.

Sorry for the delay. I was in Hangzhou for other business in the last
few weeks :P

Cheers,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

[ANNOUNCE] auth request module

Maxim Dounin February 27, 2010 02:06PM

Re: [ANNOUNCE] auth request module

agentzh February 28, 2010 01:14AM

Re: [ANNOUNCE] auth request module

Valery Kholodkov March 01, 2010 04:40AM

Re: [ANNOUNCE] auth request module

agentzh March 11, 2010 05:10AM

Re: [ANNOUNCE] auth request module

amvtek March 11, 2010 12:04PM

Re: [ANNOUNCE] auth request module

Maxim Dounin March 11, 2010 12:40PM

Re: [ANNOUNCE] auth request module

amvtek March 12, 2010 02:53AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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