# Segfault on fs stat

**URL:** <https://www.ruby-forum.com/t/segfault-on-fs-stat/188526>\
**Category:** NGINX\
**Created:** [May 13, 2010, 11:58am UTC](https://www.ruby-forum.com/t/segfault-on-fs-stat/188526 "2010-05-13T11:58:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danmezzetti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bb73d2/32.png) [@danmezzetti](https://www.ruby-forum.com/u/danmezzetti)\
**Post date:** [May 13, 2010, 11:58am UTC](https://www.ruby-forum.com/t/segfault-on-fs-stat/188526/1 "2010-05-13T11:58:24Z")

</div>

Hi all,

i’ve a strange problem with an nginx conf.

> From the strace i saw:  
> [pid 9749] recvfrom(58, “GET /post/18563571/post-via-perl”…, 1024, 0,  
> NULL, NULL) = 1003  
> [pid 9749]  
> stat("/var/www/htdocs/post/18563571/post-via-perl-direttamente-da-new-york",  
> 0x7fff13379840) = -1 ENOENT (No such file or directory)  
> [pid 9749] — SIGSEGV (Segmentation fault) @ 0 (0) —

The related nginx conf is:  
if ( !-e $request\_filename) {  
rewrite ^(.\*)$ /blog.php?q=$1 last;  
break;  
}

---

<div class="post-metadata">

**Author:** ![danmezzetti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bb73d2/32.png) [@danmezzetti](https://www.ruby-forum.com/u/danmezzetti)\
**Post date:** [May 13, 2010, 12:06pm UTC](https://www.ruby-forum.com/t/segfault-on-fs-stat/188526/2 "2010-05-13T12:06:01Z")

</div>

On Thu, May 13, 2010 at 11:57:25AM +0200, Daniele M. wrote:

> [pid 9749] — SIGSEGV (Segmentation fault) @ 0 (0) —
> 
> The related nginx conf is:  
> if ( !-e $request\_filename) {  
> rewrite ^(.\*)$ /blog.php?q=$1 last;  
> break;  
> }

Try

```
location / {
    try_files $uri /blog.php?q=$uri;
}

```

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**

---

<div class="post-metadata">

**Author:** ![danmezzetti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bb73d2/32.png) [@danmezzetti](https://www.ruby-forum.com/u/danmezzetti)\
**Post date:** [May 13, 2010, 12:31pm UTC](https://www.ruby-forum.com/t/segfault-on-fs-stat/188526/3 "2010-05-13T12:31:12Z")

</div>

Hello!

On Thu, May 13, 2010 at 11:57:25AM +0200, Daniele M. wrote:

> [pid 9749] — SIGSEGV (Segmentation fault) @ 0 (0) —
> 
> The related nginx conf is:  
> if ( !-e $request\_filename) {  
> rewrite ^(.\*)$ /blog.php?q=$1 last;  
> break;  
> }

Igor already provided correct method to do what you want, but it  
would be helpfull to debug SIGSEGV as well. Please obtain  
coredump and show backtrace, i.e. output of

gdb /path/to/nginx /path/to/nginx.core  
bt

Also please show output of nginx -V and full config.

Maxim D.
