openresty / echo-nginx-module

An Nginx module for bringing the power of "echo", "sleep", "time" and more to Nginx's config file
http://wiki.nginx.org/NginxHttpEchoModule
BSD 2-Clause "Simplified" License
1.17k stars 255 forks source link

SIGSEGV at src/ngx_http_echo_request_info.c:200 #51

Closed dilyanpalauzov closed 8 years ago

dilyanpalauzov commented 8 years ago

I compiled the most recent echo-nginx-module (v0.14-356-g02c40f1) with Nginx 1.10.1 using

nginx version: nginx/1.10.1
built by gcc 6.1.1 20160603 (GCC)
built with OpenSSL 1.0.2h  3 May 2016
TLS SNI support enabled
configure arguments: --pid-path=/var/run/nginx.pid --conf-path=/etc/nginx/core.conf --error-log-path=/var/log/nginx/nginx.log --user=www-data --group=www-data --with-ipv6 --without-poll_module --without-select_module --with-file-aio --with-http_ssl_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_degradation_module --with-http_stub_status_module --http-log-path=/var/log/nginx --with-pcre --with-pcre-jit --with-cc-opt='-O0 -g -pipe' --with-ld-opt=-Wl,-z,relro,-O1 --without-http_ssi_module --without-http_uwsgi_module --without-http_scgi_module --without-http_upstream_ip_hash_module --without-http_split_clients_module --without-http_empty_gif_module --with-http_v2_module --add-module=../ngx_http_substitutions_filter_module --add-module=/git/echo-nginx-module --with-debug

and now Nginx crashes with the backtrace I uploaded at http://mail.aegee.org/echo-nginx-crash/gdb.txt. In the configuration file I have

http {
  log_format postdata '$remote_addr - $remote_user [$time_local] '
  '"$request" $status $body_bytes_sent'
  '"$echo_client_request_headers"'
  '"$http_referer" "$http_user_agent" $request_body';
}

with echo_read_request_body; in the corresponding locations.

I would like to add that, when loading (with Chromium) several times https://www.anciens.org/wp-admin/load-styles.php?c=1&dir=ltr&load%5B%5D=dashicons,buttons,forms,l10n,login&ver=4.5.2 it is always delivered, but when I go to https://www.anciens.org/wp-login.php (which leads to convincing the browser to download the load-style.php), load-style.php is sometimes delivered and some times nginx crashes.

Any idea what went wrong?

Let me know if you need more information.

agentzh commented 8 years ago

@dilyanpalauzov It's known that $echo_client_request_headers does not support HTTP/2 connections at all. I can make it evaluate to empty values in HTTP/2 connections instead of crashing.

agentzh commented 8 years ago

@dilyanpalauzov Fixed the crash in git master.

membphis commented 8 years ago

@dilyanpalauzov i'm yuansheng, one member of the OpenResty community. we want to send you a little gift for your great job.

can you reply me your email address? then we can talk more detail.

waiting for your response.