Welcome! Log In Create A New Profile

Advanced

Re: Segfault in 1.0.5.

July 23, 2011 05:22AM
On Sat, Jul 23, 2011 at 03:37:11PM +1000, Nigel Cunningham wrote:
> Hi everyone.
>
> I'm seeing a segfault in 1.0.5 in worker processes, most reliably caused
> when a visitor attempts to access what is actually an invalid URL
> (index.php/index.php?...). I can however also reproduce it on another
> vhost with valid URLs that fail occasionally and work when you retry.
>
> The segfault is always in the call to uscf->peer.init(r, uscf) (line 622
> in src/http/ngx_http_upstream.c) and occurs because uscf is not a valid
> pointer. Most of the time it is NULL, but I have also seen it be in the
> low positive integer range. The function itself is working fine, but
> r->upstream->conf->upstream is not getting set right, presumably at
> initialisation time.
>
> I've done some analysis using GDB, but have spent far too much time on
> this already today, so I'd thought I'd ask here as to whether people
> might have hints as to what I should look at, or a simple patch to test
> that I haven't yet found in Googling.
>
> The configuration for the vhost that's repeatably segfaulting looks like
> this:
>
> server { listen 74.207.252.120:81; server_name mtevelyn.crca.org.au;
> rewrite ^(.*) http://www.mtevelyn.crca.org.au:81$1 permanent; }
>
> server {
> listen 74.207.252.120:81;
> server_name www.mtevelyn.crca.org.au;
>
> access_log /var/log/nginx/mtevelyn.crca.org.au.access.log;
> error_log /var/log/nginx/mtevelyn.crca.org.au.error.log debug;
> # error_log /var/log/nginx/mtevelyn.crca.org.au.error.log;
>
> large_client_header_buffers 4 8k; # prevent some 400 errors
>
> root /home/mtevelyn-website/public_html;
> index index.html default.htm index.htm index.php;
>
> location / {
> expires 30d;
> error_page 404 = @joomla;
> log_not_found off;
> }
>
> # location /index.php/index.php {
> # rewrite ^/index.php?q=$1 last;
> # }
>
> # location /index.php {
> # rewrite ^/index.php/(.*)$ /$1;
> # }
>
> location @joomla {
> rewrite ^(.*)$ /index.php?q=$1 last;
> }
>
> # serve static files directly
> location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico)$ {
> access_log off;
> expires 30d;
> }
>
> location ~ .php$ {
> include /etc/nginx/fastcgi_params;
>
> if ($uri !~ "^/images|cache|media/") {
> fastcgi_pass 127.0.0.1:9000;
> }
>
> if ($uri ~ "^(.+\.php)(/.+)") {
> set $script $1;
> set $path_info $2;
> }
>
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
> fastcgi_param PATH_INFO $path_info;
> fastcgi_param QUERY_STRING $query_string;
> fastcgi_param REQUEST_METHOD $request_method;
> fastcgi_param CONTENT_TYPE $content_type;
> fastcgi_param CONTENT_LENGTH $content_length;
> }
> }

root /home/mtevelyn-website/public_html;
index index.html default.htm index.htm index.php;

location / {
expires 30d;
error_page 404 = @joomla;
log_not_found off;
}

location @joomla {
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php
fastcgi_param QUERY_STRING $uri;
}

# serve static files directly
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires 30d;
}

location ~ ^/(images|cache|media)/ {
# static
}

location ~ (.+\.php)(?<PATH_INFO>/.+)") {
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_param QUERY_STRING $query_string;
}


--
Igor Sysoev

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

Segfault in 1.0.5.

Nigel Cunningham 1981 July 23, 2011 01:38AM

Re: Segfault in 1.0.5.

Maxim Dounin 806 July 23, 2011 03:02AM

Re: Segfault in 1.0.5.

Nigel Cunningham 844 July 23, 2011 04:52AM

Re: Segfault in 1.0.5.

Igor Sysoev 886 July 23, 2011 05:22AM

Re: Segfault in 1.0.5.

Igor Sysoev 958 July 23, 2011 05:30AM

Re: Segfault in 1.0.5.

Nigel Cunningham 774 July 23, 2011 05:40AM

Re: Segfault in 1.0.5.

Gena Makhomed 852 July 23, 2011 09:50AM

Re: Segfault in 1.0.5.

Gena Makhomed 890 July 23, 2011 09:52AM

Re: Segfault in 1.0.5.

Gena Makhomed 790 July 23, 2011 10:10AM

Re: Segfault in 1.0.5.

António P. P. Almeida 788 July 23, 2011 10:46AM

use

Gena Makhomed 726 July 23, 2011 12:18PM

Re: use

António P. P. Almeida 769 July 23, 2011 02:16PM

Re: use

Gena Makhomed 720 July 23, 2011 02:48PM

Re: use

António P. P. Almeida 765 July 23, 2011 03:46PM

Re: use

Gena Makhomed 740 July 23, 2011 04:50PM

Re: use

António P. P. Almeida 757 July 23, 2011 10:26PM

Re: use

Gena Makhomed 697 July 24, 2011 09:38AM

Re: use

Alexandr Gomoliako 775 July 23, 2011 05:30PM

Re: use

Akins, Brian 997 July 25, 2011 02:42PM



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

Online Users

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