Package: libapache2-mod-php4
Version: 4:4.3.10-8
Severity: important

Sudenly, and unfortunately quite frequently these days, our web server
(http://www.cidades.gov.br/) simply stops responding to requests. It 
accepts the connection and then does not respond.

We've tracked the problem down to session file locking. This is the
research we've made:

# strace -p 8527
Process 8527 attached - interrupt to quit
flock(20, LOCK_EX <unfinished ...>
Process 8527 detached

I ran an strace on an apache2 process while everything was working
to understand what it was trying to flock(), before the research 
which involved the process above start and found out it was the php4 
session file:

# grep -B 1 flock /var/log/strace-do-apache.log
open("/var/lib/php4/sess_9afb343331c4e160529bb01a007ed702",
O_RDWR|O_CREAT, 0600) = 20
flock(20, LOCK_EX)
[several repeats of that with different session ids]

Then I tried to find out who had the file opened, in order to maybe
figure out who was holding the lock without releasing it:

# lsof | grep var/lib/php4
apache2    7231    www-data   20uW     REG        8,9        67
114761 /var/lib/php4/sess_79a7c4312a40cb016b663c2107388394
apache2    7481    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    7560    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    7592    www-data   20u      REG        8,9        67
114761 /var/lib/php4/sess_79a7c4312a40cb016b663c2107388394
apache2    7593    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    7594    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
[...]
apache2    8464    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8465    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8468    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8469    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8470    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8471    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8473    www-data   20uW     REG        8,9         0
356396 /var/lib/php4/sess_e815444a415e1b977660141441b58a7b
apache2    8504    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
[...]
apache2    8528    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8560    www-data   20uW     REG        8,9        67
102433 /var/lib/php4/sess_0d152bfbaedf7f0d4843af5746e95bed
apache2    8565    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8598    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8601    www-data   20uW     REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8607    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8610    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
apache2    8611    www-data   20u      REG        8,9       636
160680 /var/lib/php4/sess_c8a8e2ac3bc4d109f5a98f497f20cd3c
# strace -p 7481
Process 7481 attached - interrupt to quit
flock(20, LOCK_EX <unfinished ...>
Process 7481 detached

I just did not figure out who was the one really holding the
lock. Searchs on google didn't seem to produce useful results.

Thanks,

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.1001052005
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libapache2-mod-php4 depends on:
ii  apache2-mpm-prefork [apach 2.0.53-5      traditional model for Apache2
ii  libbz2-1.0                 1.0.2-5       high-quality block-sorting file co
ii  libc6                      2.3.2.ds1-20  GNU C Library: Shared libraries an
ii  libcomerr2                 1.36release-1 common error description library
ii  libdb4.2                   4.2.52-18     Berkeley v4.2 Database Libraries [
ii  libexpat1                  1.95.8-1      XML parsing C library - runtime li
ii  libkrb53                   1.3.6-1       MIT Kerberos runtime libraries
ii  libmagic1                  4.12-1        File type determination library us
ii  libpcre3                   5.0-1         Perl 5 Compatible Regular Expressi
ii  libssl0.9.7                0.9.7e-3      SSL shared libraries
ii  libzzip-0-12               0.12.83-4     library providing read access on Z
ii  mime-support               3.31-1        MIME files 'mime.types' & 'mailcap
ii  php4-common                4:4.3.10-8    Common files for packages built fr
ii  zlib1g                     1:1.2.2-4     compression library - runtime

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to