# Nginx stuck processes

**URL:** <https://www.ruby-forum.com/t/nginx-stuck-processes/212932>\
**Category:** NGINX\
**Created:** [October 18, 2011, 12:31pm UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932 "2011-10-18T12:31:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 18, 2011, 12:31pm UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/1 "2011-10-18T12:31:49Z")

</div>

Hi,

We are using nginx version: 1.0.0 for pop-proxy. We have seen off-late  
certain processes remaining in state whereby nginx becomes  
non-responsive.

Below is the dump of ps showing the stuck process of nginx ==\> R --\>  
4150:24.

i have shared the gdb dump and the backtrace of the stuck process.

38487 ? S 0:00 nginx: master process  
/usr/local/nginx/sbin/nginx -c /etc/nginx/conf/nginx.conf  
7044 ? R 4150:24 \_ nginx: worker process  
22408 ? S 0:03 /usr/local/apache3/sbin/httpd  
22461 ? S 4:25 \_ /usr/local/apache3/sbin/httpd  
27699 ? D 0:00 | \_  
/home/httpd/dal/cgi-bin/dal/rmailajax.cgi  
15853 ? S 0:06 \_ /usr/local/apache3/sbin/httpd  
17290 ? S 0:05 \_ /usr/local/apache3/sbin/httpd  
22796 ? S 0:04 /usr/sbin/httpd -DSSL  
22801 ? S 0:29 \_ /usr/sbin/httpd -DSSL  
20605 ? S 4:05 \_ /usr/sbin/httpd -DSSL  
19391 ? S 2:33 \_ /usr/sbin/httpd -DSSL  
60469 ? S 0:59 \_ /usr/sbin/httpd -DSSL  
3437 ? S 0:35 \_ /usr/sbin/httpd -DSSL  
11200 ? S 0:30 \_ /usr/sbin/httpd -DSSL  
16597 ? S 0:19 \_ /usr/sbin/httpd -DSSL  
19556 ? S 0:09 \_ /usr/sbin/httpd -DSSL  
27218 ? S 0:00 \_ /usr/sbin/httpd -DSSL

[root@xxx logs]# strace  
[root@xxx logs]# gdb  
GNU gdb Red Hat Linux (6.3.0.0-0.30.1rh)  
Copyright 2004 Free Software Foundation, Inc.  
GDB is free software, covered by the GNU General Public License, and you  
are  
welcome to change it and/or distribute copies of it under certain  
conditions.  
Type “show copying” to see the conditions.  
There is absolutely no warranty for GDB. Type “show warranty” for  
details.  
This GDB was configured as “i386-redhat-linux-gnu”.  
(gdb) attach 7044  
Attaching to process 7044  
Reading symbols from /usr/local/nginx/sbin/nginx…done.  
Using host libthread\_db library “/lib/tls/libthread\_db.so.1”.  
Reading symbols from /lib/libcrypto.so.4…done.  
Loaded symbols for /lib/libcrypto.so.4  
Reading symbols from /lib/tls/libc.so.6…done.  
Loaded symbols for /lib/tls/libc.so.6  
Reading symbols from /usr/kerberos/lib/libgssapi\_krb5.so.2…done.  
Loaded symbols for /usr/kerberos/lib/libgssapi\_krb5.so.2  
Reading symbols from /usr/kerberos/lib/libkrb5.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libkrb5.so.3  
Reading symbols from /usr/kerberos/lib/libcom\_err.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libcom\_err.so.3  
Reading symbols from /usr/kerberos/lib/libk5crypto.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libk5crypto.so.3  
Reading symbols from /lib/libresolv.so.2…done.  
Loaded symbols for /lib/libresolv.so.2  
Reading symbols from /lib/libdl.so.2…done.  
Loaded symbols for /lib/libdl.so.2  
Reading symbols from /usr/lib/libz.so.1…done.  
Loaded symbols for /usr/lib/libz.so.1  
Reading symbols from /lib/ld-linux.so.2…done.  
Loaded symbols for /lib/ld-linux.so.2  
Reading symbols from /lib/libnss\_files.so.2…done.  
Loaded symbols for /lib/libnss\_files.so.2  
0x001dbb74 in \_int\_malloc () from /lib/tls/libc.so.6  
(gdb) backtrace  
#0 0x001dbb74 in \_int\_malloc () from /lib/tls/libc.so.6  
#1 0x001dc89c in \_int\_memalign () from /lib/tls/libc.so.6  
#2 0x001db2c7 in memalign () from /lib/tls/libc.so.6  
#3 0x001dd367 in posix\_memalign () from /lib/tls/libc.so.6  
#4 0x0805d614 in ngx\_memalign (alignment=16, size=2746520, log=0x108)  
at src/os/unix/ngx\_alloc.c:56  
#5 0x0804b603 in ngx\_create\_pool (size=256, log=0x93bd1a0) at  
src/core/ngx\_palloc.c:20  
#6 0x0805be26 in ngx\_event\_accept (ev=0x93df338) at  
src/event/ngx\_event\_accept.c:124  
#7 0x0805b7f9 in ngx\_event\_process\_posted (cycle=0x93bce28,  
posted=0x8070e3c) at src/event/ngx\_event\_posted.c:39  
#8 0x0805a8e1 in ngx\_process\_events\_and\_timers (cycle=0x93bce28) at  
src/event/ngx\_event.c:253  
#9 0x0806051a in ngx\_worker\_process\_cycle (cycle=0x93bce28, data=0x0)  
at src/os/unix/ngx\_process\_cycle.c:800  
#10 0x0805eb3c in ngx\_spawn\_process (cycle=0x93bce28, proc=0x8060465  
\<ngx\_worker\_process\_cycle\>, data=0x0, name=0x806b971 “worker process”,  
respawn=17)  
at src/os/unix/ngx\_process.c:196  
#11 0x0806023e in ngx\_reap\_children (cycle=0x93bce28) at  
src/os/unix/ngx\_process\_cycle.c:617  
#12 0x0805f8e1 in ngx\_master\_process\_cycle (cycle=0x93bce28) at  
src/os/unix/ngx\_process\_cycle.c:180  
#13 0x08049fea in main (argc=3, argv=0x93bd5a4) at src/core/nginx.c:405

---

<div class="post-metadata">

**Author:** ![sandesh\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@sandesh\_k](https://www.ruby-forum.com/u/sandesh_k)\
**Post date:** [October 18, 2011, 12:49pm UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/2 "2011-10-18T12:49:46Z")

</div>

On Tue, Oct 18, 2011 at 12:31:49PM +0200, Sandesh K. wrote:

> 22801 ? S 0:29 \_ /usr/sbin/httpd -DSSL  
> [root@xxx logs]# gdb  
> (gdb) attach 7044  
> Loaded symbols for /usr/kerberos/lib/libkrb5.so.3  
> Reading symbols from /lib/ld-linux.so.2…done.  
> at src/os/unix/ngx\_alloc.c:56  
> #10 0x0805eb3c in ngx\_spawn\_process (cycle=0x93bce28, proc=0x8060465  
> \<ngx\_worker\_process\_cycle\>, data=0x0, name=0x806b971 “worker process”,  
> respawn=17)  
> at src/os/unix/ngx\_process.c:196  
> #11 0x0806023e in ngx\_reap\_children (cycle=0x93bce28) at  
> src/os/unix/ngx\_process\_cycle.c:617  
> #12 0x0805f8e1 in ngx\_master\_process\_cycle (cycle=0x93bce28) at  
> src/os/unix/ngx\_process\_cycle.c:180  
> #13 0x08049fea in main (argc=3, argv=0x93bd5a4) at src/core/nginx.c:405

It seems that malloc() loops inside. This may be bug in nginx or glibc.  
Could you show:

nginx -V  
uname -osrvmpi

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![sandesh\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@sandesh\_k](https://www.ruby-forum.com/u/sandesh_k)\
**Post date:** [October 18, 2011, 1:23pm UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/3 "2011-10-18T13:23:19Z")

</div>

[root@xxx root]# uname -osrvmpi  
Linux 2.4.21-32.ELsmp #1 SMP Wed May 18 17:49:28 EDT 2005 i686 i686 i386  
GNU/Linux  
[root@xxx root]# /usr/local/nginx/sbin/nginx -V  
nginx: nginx version: nginx/1.0.0  
nginx: built by gcc 3.2.3 20030502 (Red Hat Linux 3.2.3-52)  
nginx: configure arguments: --prefix=/usr/local/nginx  
–sbin-path=/usr/local/nginx/sbin/nginx  
–conf-path=/etc/nginx/conf/nginx.conf  
–error-log-path=/var/log/nginx/logs/error.log  
–pid-path=/var/run/nginx.pid --lock-path=/var/log/nginx/logs/nginx.lock  
–with-mail --without-http --without-mail\_imap\_module  
–without-mail\_smtp\_module

- sandesh

---

<div class="post-metadata">

**Author:** ![sandesh\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@sandesh\_k](https://www.ruby-forum.com/u/sandesh_k)\
**Post date:** [October 19, 2011, 7:54am UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/4 "2011-10-19T07:54:18Z")

</div>

Hello Igor,

Do you have any update on this?

---

<div class="post-metadata">

**Author:** ![sandesh\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@sandesh\_k](https://www.ruby-forum.com/u/sandesh_k)\
**Post date:** [November 22, 2011, 6:51am UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/5 "2011-11-22T06:51:56Z")

</div>

Sandesh K. wrote in post #1027339:

> Hello Igor,
> 
> Do you have any update on this?

Igor,

We upgraded the OS as well as Nginx to 1.1.10 latest stable. But the  
problem still persists.

\*2.6.18-164.el5PAE  
\*CentOS release 5.4 (Final)  
\*nginx: nginx version: nginx/1.0.10  
\*nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-46)  
nginx: configure arguments: --prefix=/usr/local/nginx  
–sbin-path=/usr/local/nginx/sbin/nginx  
–conf-path=/etc/nginx/conf/nginx.conf  
–error-log-path=/var/log/nginx/logs/error.log  
–pid-path=/var/run/nginx.pid --lock-path=/var/log/nginx/logs/nginx.lock  
–with-mail --without-http --without-mail\_imap\_module  
–without-mail\_smtp\_module

GNU gdb Red Hat Linux (6.3.0.0-0.30.1rh)  
Copyright 2004 Free Software Foundation, Inc.  
GDB is free software, covered by the GNU General Public License, and you  
are  
welcome to change it and/or distribute copies of it under certain  
conditions.  
Type “show copying” to see the conditions.  
There is absolutely no warranty for GDB. Type “show warranty” for  
details.  
This GDB was configured as “i386-redhat-linux-gnu”.  
(gdb) attach 65233  
Attaching to process 65233  
Reading symbols from /usr/local/nginx/sbin/nginx…done.  
Using host libthread\_db library “/lib/tls/libthread\_db.so.1”.  
Reading symbols from /lib/tls/libpthread.so.0…done.  
[Thread debugging using libthread\_db enabled]  
[New Thread -1218550432 (LWP 65233)]  
Loaded symbols for /lib/tls/libpthread.so.0  
Reading symbols from /lib/libcrypto.so.4…done.  
Loaded symbols for /lib/libcrypto.so.4  
Reading symbols from /lib/tls/libc.so.6…done.  
Loaded symbols for /lib/tls/libc.so.6  
Reading symbols from /lib/ld-linux.so.2…done.  
Loaded symbols for /lib/ld-linux.so.2  
Reading symbols from /usr/kerberos/lib/libgssapi\_krb5.so.2…done.  
Loaded symbols for /usr/kerberos/lib/libgssapi\_krb5.so.2  
Reading symbols from /usr/kerberos/lib/libkrb5.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libkrb5.so.3  
Reading symbols from /usr/kerberos/lib/libcom\_err.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libcom\_err.so.3  
Reading symbols from /usr/kerberos/lib/libk5crypto.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libk5crypto.so.3  
Reading symbols from /lib/libresolv.so.2…done.  
Loaded symbols for /lib/libresolv.so.2  
Reading symbols from /lib/libdl.so.2…done.  
Loaded symbols for /lib/libdl.so.2  
Reading symbols from /usr/lib/libz.so.1…done.  
Loaded symbols for /usr/lib/libz.so.1  
Reading symbols from /lib/libnss\_files.so.2…done.  
Loaded symbols for /lib/libnss\_files.so.2  
0x0031ebba in \_int\_malloc () from /lib/tls/libc.so.6  
(gdb) backtrace  
#0 0x0031ebba in \_int\_malloc () from /lib/tls/libc.so.6  
#1 0x0031f89c in \_int\_memalign () from /lib/tls/libc.so.6  
#2 0x0031e2c7 in memalign () from /lib/tls/libc.so.6  
#3 0x00320367 in posix\_memalign () from /lib/tls/libc.so.6  
#4 0x0805da38 in ngx\_memalign (alignment=16, size=4069528, log=0x108) at  
src/os/unix/ngx\_alloc.c:56  
#5 0x0804b917 in ngx\_palloc\_block (pool=0x8d0b9b0, size=52) at  
src/core/ngx\_palloc.c:184  
#6 0x0804b892 in ngx\_palloc (pool=0x8d0b9b0, size=52) at  
src/core/ngx\_palloc.c:138  
#7 0x0804babf in ngx\_pcalloc (pool=0x8d0b9b0, size=52) at  
src/core/ngx\_palloc.c:304  
#8 0x0804d0b7 in ngx\_create\_temp\_buf (pool=0x8d0b9b0, size=4096) at  
src/core/ngx\_buf.c:16  
#9 0x08067508 in ngx\_mail\_proxy\_init (s=0x8d0da20, peer=0x8d0c294) at  
src/mail/ngx\_mail\_proxy\_module.c:167  
#10 0x080666e2 in ngx\_mail\_auth\_http\_process\_headers (s=0x8d0da20,  
ctx=0x8d12498) at src/mail/ngx\_mail\_auth\_http\_module.c:832  
#11 0x0806606c in ngx\_mail\_auth\_http\_ignore\_status\_line (s=0x8d0da20,  
ctx=0x8d12498) at src/mail/ngx\_mail\_auth\_http\_module.c:448  
#12 0x08065f4b in ngx\_mail\_auth\_http\_read\_handler (rev=0x3e2180) at  
src/mail/ngx\_mail\_auth\_http\_module.c:331  
#13 0x0806194e in ngx\_rtsig\_process\_events (cycle=0x8cdb248,  
timer=147634972, flags=1) at src/event/modules/ngx\_rtsig\_module.c:400  
#14 0x0805ad0c in ngx\_process\_events\_and\_timers (cycle=0x8ccb228) at  
src/event/ngx\_event.c:245  
#15 0x08060952 in ngx\_worker\_process\_cycle (cycle=0x8ccb228, data=0x0)  
at src/os/unix/ngx\_process\_cycle.c:801  
#16 0x0805ef60 in ngx\_spawn\_process (cycle=0x8ccb228, proc=0x806089d  
\<ngx\_worker\_process\_cycle\>, data=0x0, name=0x806be29 “worker process”,  
respawn=-3) at src/os/unix/ngx\_process.c:196  
#17 0x080601f6 in ngx\_start\_worker\_processes (cycle=0x8ccb228, n=30,  
type=-3) at src/os/unix/ngx\_process\_cycle.c:360  
#18 0x0805fbe7 in ngx\_master\_process\_cycle (cycle=0x8ccb228) at  
src/os/unix/ngx\_process\_cycle.c:136  
#19 0x0804a116 in main (argc=3, argv=0x8ccb9a4) at src/core/nginx.c:405  
(gdb) quit

---

<div class="post-metadata">

**Author:** ![sandesh\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@sandesh\_k](https://www.ruby-forum.com/u/sandesh_k)\
**Post date:** [November 22, 2011, 9:59am UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/6 "2011-11-22T09:59:39Z")

</div>

Hello!

On Tue, Nov 22, 2011 at 06:51:56AM +0100, Sandesh K. wrote:

> –without-mail\_smtp\_module  
> […]

> (gdb) backtrace  
> #0 0x0031ebba in \_int\_malloc () from /lib/tls/libc.so.6  
> #1 0x0031f89c in \_int\_memalign () from /lib/tls/libc.so.6  
> #2 0x0031e2c7 in memalign () from /lib/tls/libc.so.6  
> #3 0x00320367 in posix\_memalign () from /lib/tls/libc.so.6  
> #4 0x0805da38 in ngx\_memalign (alignment=16, size=4069528, log=0x108) at  
> src/os/unix/ngx\_alloc.c:56

The “size=4069528” looks really strange…

> #5 0x0804b917 in ngx\_palloc\_block (pool=0x8d0b9b0, size=52) at  
> src/core/ngx\_palloc.c:184

Could you please show

fr 5  
p \*pool

output from gdb?

> #11 0x0806606c in ngx\_mail\_auth\_http\_ignore\_status\_line (s=0x8d0da20,  
> \<ngx\_worker\_process\_cycle\>, data=0x0, name=0x806be29 “worker process”,  
> respawn=-3) at src/os/unix/ngx\_process.c:196  
> #17 0x080601f6 in ngx\_start\_worker\_processes (cycle=0x8ccb228, n=30,  
> type=-3) at src/os/unix/ngx\_process\_cycle.c:360  
> #18 0x0805fbe7 in ngx\_master\_process\_cycle (cycle=0x8ccb228) at  
> src/os/unix/ngx\_process\_cycle.c:136  
> #19 0x0804a116 in main (argc=3, argv=0x8ccb9a4) at src/core/nginx.c:405  
> (gdb) quit

Maxim D.

---

<div class="post-metadata">

**Author:** ![sandesh\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@sandesh\_k](https://www.ruby-forum.com/u/sandesh_k)\
**Post date:** [November 23, 2011, 8:38am UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/7 "2011-11-23T08:38:26Z")

</div>

Maxim D. wrote in post #1033042:

> Hello!
> 
> On Tue, Nov 22, 2011 at 06:51:56AM +0100, Sandesh K. wrote:
> 
> > –without-mail\_smtp\_module  
> > […]
> 
> > (gdb) backtrace  
> > #0 0x0031ebba in \_int\_malloc () from /lib/tls/libc.so.6  
> > #1 0x0031f89c in \_int\_memalign () from /lib/tls/libc.so.6  
> > #2 0x0031e2c7 in memalign () from /lib/tls/libc.so.6  
> > #3 0x00320367 in posix\_memalign () from /lib/tls/libc.so.6  
> > #4 0x0805da38 in ngx\_memalign (alignment=16, size=4069528, log=0x108) at  
> > src/os/unix/ngx\_alloc.c:56
> 
> The “size=4069528” looks really strange…
> 
> > #5 0x0804b917 in ngx\_palloc\_block (pool=0x8d0b9b0, size=52) at  
> > src/core/ngx\_palloc.c:184
> 
> Could you please show
> 
> fr 5  
> p \*pool
> 
> output from gdb?
> 
> > #11 0x0806606c in ngx\_mail\_auth\_http\_ignore\_status\_line (s=0x8d0da20,  
> > \<ngx\_worker\_process\_cycle\>, data=0x0, name=0x806be29 “worker process”,  
> > respawn=-3) at src/os/unix/ngx\_process.c:196  
> > #17 0x080601f6 in ngx\_start\_worker\_processes (cycle=0x8ccb228, n=30,  
> > type=-3) at src/os/unix/ngx\_process\_cycle.c:360  
> > #18 0x0805fbe7 in ngx\_master\_process\_cycle (cycle=0x8ccb228) at  
> > src/os/unix/ngx\_process\_cycle.c:136  
> > #19 0x0804a116 in main (argc=3, argv=0x8ccb9a4) at src/core/nginx.c:405  
> > (gdb) quit
> 
> Maxim D.

Hello Maxim,

Please find the output.

43121 ? S 0:00 nginx: master process  
/usr/local/nginx/sbin/nginx -c /etc/nginx/conf/nginx.conf  
43123 ? S 1:58 \_ nginx: worker process  
43124 ? S 1:46 \_ nginx: worker process  
43127 ? S 2:02 \_ nginx: worker process  
43128 ? S 1:37 \_ nginx: worker process  
43130 ? S 1:50 \_ nginx: worker process  
43131 ? S 2:23 \_ nginx: worker process  
43132 ? S 2:44 \_ nginx: worker process  
43133 ? S 2:09 \_ nginx: worker process  
43134 ? S 1:47 \_ nginx: worker process  
43135 ? S 2:07 \_ nginx: worker process  
43129 ? R 866:11 \_ nginx: worker process  
43137 ? S 1:35 \_ nginx: worker process  
43138 ? S 1:28 \_ nginx: worker process  
43139 ? S 3:04 \_ nginx: worker process  
43140 ? S 1:42 \_ nginx: worker process  
43142 ? S 1:23 \_ nginx: worker process  
43143 ? S 2:24 \_ nginx: worker process  
7328 ? S 0:59 \_ nginx: worker process  
9444 ? S 0:46 \_ nginx: worker process  
57217 ? S 0:00 \_ nginx: worker process

GNU gdb Red Hat Linux (6.3.0.0-1.132.EL3rh)  
Copyright 2004 Free Software Foundation, Inc.  
GDB is free software, covered by the GNU General Public License, and you  
are  
welcome to change it and/or distribute copies of it under certain  
conditions.  
Type “show copying” to see the conditions.  
There is absolutely no warranty for GDB. Type “show warranty” for  
details.  
This GDB was configured as “i386-redhat-linux-gnu”.  
(gdb) attach 43129  
Attaching to process 43129  
Reading symbols from /usr/local/nginx/sbin/nginx…done.  
Using host libthread\_db library “/lib/tls/libthread\_db.so.1”.  
Reading symbols from /lib/tls/libpthread.so.0…done.  
[Thread debugging using libthread\_db enabled]  
[New Thread -1218529952 (LWP 43129)]  
Loaded symbols for /lib/tls/libpthread.so.0  
Reading symbols from /lib/libcrypto.so.4…done.  
Loaded symbols for /lib/libcrypto.so.4  
Reading symbols from /lib/tls/libc.so.6…done.  
Loaded symbols for /lib/tls/libc.so.6  
Reading symbols from /lib/ld-linux.so.2…done.  
Loaded symbols for /lib/ld-linux.so.2  
Reading symbols from /usr/kerberos/lib/libgssapi\_krb5.so.2…done.  
Loaded symbols for /usr/kerberos/lib/libgssapi\_krb5.so.2  
Reading symbols from /usr/kerberos/lib/libkrb5.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libkrb5.so.3  
Reading symbols from /usr/kerberos/lib/libcom\_err.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libcom\_err.so.3  
Reading symbols from /usr/kerberos/lib/libk5crypto.so.3…done.  
Loaded symbols for /usr/kerberos/lib/libk5crypto.so.3  
Reading symbols from /lib/libresolv.so.2…done.  
Loaded symbols for /lib/libresolv.so.2  
Reading symbols from /lib/libdl.so.2…done.  
Loaded symbols for /lib/libdl.so.2  
Reading symbols from /usr/lib/libz.so.1…done.  
Loaded symbols for /usr/lib/libz.so.1  
Reading symbols from /lib/libnss\_files.so.2…done.  
Loaded symbols for /lib/libnss\_files.so.2  
0x00f36130 in \_int\_malloc () from /lib/tls/libc.so.6  
(gdb) fr 5  
#5 0x0804b917 in ngx\_palloc\_block (pool=0x90f58e0, size=128) at  
src/core/ngx\_palloc.c:184  
184 m = ngx\_memalign(NGX\_POOL\_ALIGNMENT, psize, pool-\>log);  
(gdb) p \*pool  
$1 = {d = {last = 0x90f599c  
“[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\r\t\b\001”, end = 0x90f59e0  
“\b\001”, next = 0x910cb20, failed = 0}, max = 216,  
current = 0x90f58e0, chain = 0x0, large = 0x0, cleanup = 0x0, log =  
0x90f5918}  
(gdb) backtrace  
#0 0x00f36130 in \_int\_malloc () from /lib/tls/libc.so.6  
#1 0x00f36b3c in \_int\_memalign () from /lib/tls/libc.so.6  
#2 0x00f354f7 in memalign () from /lib/tls/libc.so.6  
#3 0x00f37607 in posix\_memalign () from /lib/tls/libc.so.6  
#4 0x0805da3c in ngx\_memalign (alignment=16, size=16751288, log=0x108)  
at src/os/unix/ngx\_alloc.c:56  
#5 0x0804b917 in ngx\_palloc\_block (pool=0x90f58e0, size=128) at  
src/core/ngx\_palloc.c:184  
#6 0x0804b892 in ngx\_palloc (pool=0x90f58e0, size=128) at  
src/core/ngx\_palloc.c:138  
#7 0x0804d0cf in ngx\_create\_temp\_buf (pool=0x90f58e0, size=128) at  
src/core/ngx\_buf.c:21  
#8 0x0806566a in ngx\_mail\_pop3\_init\_protocol (rev=0x8ebd4b4) at  
src/mail/ngx\_mail\_pop3\_handler.c:104  
#9 0x0805bc4d in ngx\_event\_process\_posted (cycle=0x8e951d8,  
posted=0x8071ea0) at src/event/ngx\_event\_posted.c:39  
#10 0x0805ad89 in ngx\_process\_events\_and\_timers (cycle=0x8e951d8) at  
src/event/ngx\_event.c:272  
#11 0x08060956 in ngx\_worker\_process\_cycle (cycle=0x8e951d8, data=0x0)  
at src/os/unix/ngx\_process\_cycle.c:801  
#12 0x0805ef64 in ngx\_spawn\_process (cycle=0x8e951d8, proc=0x80608a1  
\<ngx\_worker\_process\_cycle\>, data=0x0, name=0x806be29 “worker process”,  
respawn=-3) at src/os/unix/ngx\_process.c:196  
#13 0x080601fa in ngx\_start\_worker\_processes (cycle=0x8e951d8, n=20,  
type=-3) at src/os/unix/ngx\_process\_cycle.c:360  
#14 0x0805fbeb in ngx\_master\_process\_cycle (cycle=0x8e951d8) at  
src/os/unix/ngx\_process\_cycle.c:136  
#15 0x0804a116 in main (argc=3, argv=0x8e95954) at src/core/nginx.c:405

---

<div class="post-metadata">

**Author:** ![sandesh\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@sandesh\_k](https://www.ruby-forum.com/u/sandesh_k)\
**Post date:** [November 23, 2011, 2:12pm UTC](https://www.ruby-forum.com/t/nginx-stuck-processes/212932/8 "2011-11-23T14:12:39Z")

</div>

Hello!

On Wed, Nov 23, 2011 at 08:38:26AM +0100, Sandesh K. wrote:

> > > #0 0x0031ebba in \_int\_malloc () from /lib/tls/libc.so.6
> > 
> > Could you please show
> > 
> > fr 5  
> > p \*pool
> > 
> > output from gdb?

[…]

> (gdb) fr 5  
> #5 0x0804b917 in ngx\_palloc\_block (pool=0x90f58e0, size=128) at  
> src/core/ngx\_palloc.c:184  
> 184 m = ngx\_memalign(NGX\_POOL\_ALIGNMENT, psize, pool-\>log);  
> (gdb) p \*pool  
> $1 = {d = {last = 0x90f599c  
> “[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\r\t\b\001”, end = 0x90f59e0  
> “\b\001”, next = 0x910cb20, failed = 0}, max = 216,  
> current = 0x90f58e0, chain = 0x0, large = 0x0, cleanup = 0x0, log =  
> 0x90f5918}

Ok, it looks like pool is ok (pool-\>d.end - pool == 0x100).  
Probably the cause of strange arguments is either corrupted stack  
or some compiler optimizations.

> (gdb) backtrace  
> #0 0x00f36130 in \_int\_malloc () from /lib/tls/libc.so.6  
> #1 0x00f36b3c in \_int\_memalign () from /lib/tls/libc.so.6  
> #2 0x00f354f7 in memalign () from /lib/tls/libc.so.6  
> #3 0x00f37607 in posix\_memalign () from /lib/tls/libc.so.6  
> #4 0x0805da3c in ngx\_memalign (alignment=16, size=16751288, log=0x108)  
> at src/os/unix/ngx\_alloc.c:56  
> #5 0x0804b917 in ngx\_palloc\_block (pool=0x90f58e0, size=128) at  
> src/core/ngx\_palloc.c:184

For now I tend to think the problem is somewhere in (g)libc. You may  
want to update it, and if it doesn’t help - recompile with debug  
and dig into it further.

Maxim D.
