|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13490 Semaphores don't release automatically
Submitted: 2001-09-28 19:03 UTC Modified: 2002-01-14 07:42 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: m at savich dot ru Assigned:
Status: Closed Package: Semaphore related
PHP Version: 4.0.6 OS: FreeBSD 4.1.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
36 + 22 = ?
Subscribe to this entry?

 [2001-09-28 19:03 UTC] m at savich dot ru
simplest script:
$id = sem_get(0xff03e3);

'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mysql' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-sockets'

When i run that script for the first time, warning doesnt appear, as it is described in manual. All the other calls hang apache processes without any chance for semaphore to unlock.
However, if i try such variant:

$id = sem_get(0xff03e3);

everything works perfectly for single calls, but when I run my crash-test, which calls the php script 200 times at once, it hangs the semaphore again and many apache processes stay frozen.

I think, the reason is incorrect request finalization.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-13 08:35 UTC]
This is intended behaviour. This is how semaphores work. =)
Use sem_remove() to remove semaphores.
 [2002-01-13 14:52 UTC] m at savich dot ru
"After processing a request, any semaphores acquired by the process but not explicitly released will be released automatically and a warning will be generated."

Therefore, it is NOT intended behaviour, because in my situation semaphores DON'T release automatically. And any failure in php script causes apache to hang up in few seconds, because semaphore is acquired by dead script and all other instances can't work. This really is bug. :-(
 [2002-01-13 20:27 UTC]
My bad. Re-opened.
 [2002-01-14 02:29 UTC]
Is this reproducable on 4.1.1?
 [2002-01-14 07:37 UTC] m at savich dot ru
Checked on FreeBSD 4.4 with PHP 4.1.0 - it works!
 [2002-01-14 07:42 UTC]
-> Closed.
 [2002-05-28 23:28 UTC] catoc at 163 dot net
In redhat 7.2 php-4.2.1 , have this problem too.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 18:01:30 2024 UTC