Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when cache->file.name is not populated #5

Open
jaqq2 opened this issue Oct 30, 2012 · 1 comment
Open

Crash when cache->file.name is not populated #5

jaqq2 opened this issue Oct 30, 2012 · 1 comment

Comments

@jaqq2
Copy link

jaqq2 commented Oct 30, 2012

Sometimes ngx_http_file_cache_open() returns before calling ngx_http_file_cache_name(), which will lead to a crash when later calling ngx_http_file_cache_update().

request should be declined instead of calling ngx_http_slowfs_static_send() if cache->file.name is empty, maybe with something like:

    rc = ngx_http_slowfs_cache_send(r);
-    if (rc == NGX_DECLINED) {
+    if ((rc == NGX_DECLINED) && (r->cache->file.name.len > 0)) {
        rc = ngx_http_slowfs_static_send(r);
    }

    return rc;
}
@runningman84
Copy link

Is this problem responsible for segfaults like this?
nginx[29893]: segfault at 0 ip 0000000000492b44 sp 00007ffffb73fad0 error 6 in nginx[400000+290000]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants