Re: Part of debug log in reply instead of reply if nginx runs under debugger.

2016-06-27 Thread Andrey Kulikov
Hi Maxim,

Thanks for a fast reply!

Indeed, I didn't mean to reload configuration. After instructing gdb not to
forward SIGHUP to the process being debugged, everything start to work like
a charm.
Thanks for help!

--
WBR,
Andrey

On 27 June 2016 at 16:34, Maxim Dounin  wrote:

> Hello!
>
> On Mon, Jun 27, 2016 at 12:30:19PM +0300, Andrey Kulikov wrote:
>
> > I stuck in rather strange situation: if I run nginx under debugger, and
> > request zero-length file it gives me correct reply on first connection.
> But
> > on second connection it reply it output part of debug log (what supposed
> to
> > be written to debug log, but wasn't).
> > At the same time if nginx runs normally (without debugger attached) -
> > everything works as it should.
> >
> > Is is normal situation when nginx runs under debugger?
>
> No, it's not.  Though it looks like you are using 'master_process
> off' and reloading the configuration:
>
> [...]
>
> > master_process off;
>
> [...]
>
> > 2016/06/27 12:24:30 [notice] 32736#0: signal 1 (SIGHUP) received,
> reconfiguring
>
> This can cause various unexpected effects.  If you didn't mean to
> do a reload - check your debugger documentation if it's
> responsible for this.
>
> --
> Maxim Dounin
> http://nginx.org/
>
> ___
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Part of debug log in reply instead of reply if nginx runs under debugger.

2016-06-27 Thread Andrey Kulikov
Hello,

I stuck in rather strange situation: if I run nginx under debugger, and
request zero-length file it gives me correct reply on first connection. But
on second connection it reply it output part of debug log (what supposed to
be written to debug log, but wasn't).
At the same time if nginx runs normally (without debugger attached) -
everything works as it should.

Is is normal situation when nginx runs under debugger?

I run everything on Debian 8.5

# uname -a
Linux ng18 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64
GNU/Linux

# nginx -V
nginx version: nginx/1.10.1
built by gcc 4.9.2 (Debian 4.9.2-10)
configure arguments: --with-debug


My nginx.conf file:
===
worker_processes  1;
daemon on;
master_process off;
error_log
/root/devel/ngx_module/url-rewrite-nginx-module/t/servroot/logs/error.log
debug;
pid
/root/devel/ngx_module/url-rewrite-nginx-module/t/servroot/logs/nginx.pid;

http {
access_log
/root/devel/ngx_module/url-rewrite-nginx-module/t/servroot/logs/access.log;

default_type text/plain;
keepalive_timeout  68;

server {
listen  1984;
server_name 'localhost';

client_max_body_size 30M;
default_type text/html;
client_body_buffer_size 1;
client_header_buffer_size 1;
proxy_buffer_size 1;
chunked_transfer_encoding off;
location /t {
root
/root/devel/ngx_module/url-rewrite-nginx-module/t/servroot/html;
}

location / {
root
/root/devel/ngx_module/url-rewrite-nginx-module/t/servroot/html;
index index.html index.htm;
}
}
}

events {
accept_mutex off;

worker_connections  64;
}

===

Debug log:
===
2016/06/27 12:24:28 [debug] 32736#0: bind() 0.0.0.0:1984 #6
2016/06/27 12:24:28 [notice] 32736#0: using the "epoll" event method
2016/06/27 12:24:28 [notice] 32736#0: nginx/1.10.1
2016/06/27 12:24:28 [notice] 32736#0: built by gcc 4.9.2 (Debian 4.9.2-10)
2016/06/27 12:24:28 [notice] 32736#0: OS: Linux 3.16.0-4-amd64
2016/06/27 12:24:28 [notice] 32736#0: getrlimit(RLIMIT_NOFILE): 65536:65536
2016/06/27 12:24:30 [notice] 32736#0: signal 1 (SIGHUP) received,
reconfiguring
2016/06/27 12:24:30 [debug] 32743#0: write: 7, 7FFFE060, 6, 0
2016/06/27 12:24:30 [debug] 32743#0: notify eventfd: 7
2016/06/27 12:24:30 [debug] 32743#0: malloc: 006E3340:6144
2016/06/27 12:24:30 [debug] 32743#0: malloc: 006DA310:13824
2016/06/27 12:24:30 [debug] 32743#0: malloc: 006E4B50:6144
2016/06/27 12:24:30 [debug] 32743#0: malloc: 006F5600:6144
2016/06/27 12:24:30 [debug] 32743#0: epoll add event: fd:6 op:1 ev:2001
2016/06/27 12:24:30 [debug] 32743#0: worker cycle
2016/06/27 12:24:30 [debug] 32743#0: epoll timer: -1
2016/06/27 12:24:45 [debug] 32743#0: epoll: fd:6 ev:0001 d:006DA310
2016/06/27 12:24:45 [debug] 32743#0: accept on 0.0.0.0:1984, ready: 0
2016/06/27 12:24:45 [debug] 32743#0: posix_memalign: 006E6360:512
@16
2016/06/27 12:24:45 [debug] 32743#0: *1 accept: 127.0.0.1:34417 fd:8
2016/06/27 12:24:45 [debug] 32743#0: *1 event timer add: 8:
6:1467019545151
2016/06/27 12:24:45 [debug] 32743#0: *1 reusable connection: 1
2016/06/27 12:24:45 [debug] 32743#0: *1 epoll add event: fd:8 op:1
ev:80002001
2016/06/27 12:24:45 [debug] 32743#0: timer delta: 16289
2016/06/27 12:24:45 [notice] 32743#0: reconfiguring
2016/06/27 12:24:45 [debug] 32743#0: posix_memalign: 006F6E10:16384
@16
2016/06/27 12:24:45 [debug] 32743#0: posix_memalign: 006FAE20:16384
@16
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006FEE30:4096
2016/06/27 12:24:45 [debug] 32743#0: read: 9, 006FEE30, 985, 0
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006FFE40:4280
2016/06/27 12:24:45 [debug] 32743#0: malloc: 00700F00:4280
2016/06/27 12:24:45 [debug] 32743#0: malloc: 00701FC0:4280
2016/06/27 12:24:45 [debug] 32743#0: malloc: 00703080:4280
2016/06/27 12:24:45 [debug] 32743#0: malloc: 00704140:4280
2016/06/27 12:24:45 [debug] 32743#0: malloc: 00705200:4280
2016/06/27 12:24:45 [debug] 32743#0: posix_memalign: 007062C0:16384
@16
2016/06/27 12:24:45 [debug] 32743#0: malloc: 0070A2D0:4096
2016/06/27 12:24:45 [debug] 32743#0: posix_memalign: 0070B2E0:16384
@16
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006DD920:2048
2016/06/27 12:24:45 [debug] 32743#0: add cleanup: 0070E000
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006D5730:408
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006D58D0:96
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006DD920:1024
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006DD920:1024
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006DD920:1024
2016/06/27 12:24:45 [debug] 32743#0: malloc: 006DD920:1024
2016/06/27 12:24:45 [debug] 32743#0: posix_memalign: 0070F2F0:16384
@16