php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71956 sem_get(0) creating an infinite amount of semaphores
Submitted: 2016-04-04 09:30 UTC Modified: 2020-03-14 15:34 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:-1 (-100.0%)
From: kakkau at grr dot la Assigned: cmb (profile)
Status: Closed Package: Semaphore related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2016-04-04 09:30 UTC] kakkau at grr dot la
Description:
------------
1. run sem_get(0,0) multiple times
2. check ipcs -s
3. see there are multiple semaphores created

For any other integer <> 0 sem_get works as expected.
It returns a resource w/o creating another semaphore.

Test script:
---------------
<?php

sem_get(0,0);
sem_get(0,0);

?>

Expected result:
----------------
No creation of another semaphore.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-01 22:56 UTC] cmb@php.net
-Summary: sem_get: creating an infinite amount of semaphores +Summary: sem_get(0) creating an infinite amount of semaphores -Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2020-03-01 22:56 UTC] cmb@php.net
sem_get() calls semget() with the unmodified key, and IPC_PRIVATE
likely has the value 0, so the behavior is expected, albeit
undocumented.
 [2020-03-14 15:33 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=349425
Log: Fix #71956: sem_get(0) creating an infinite amount of semaphores
 [2020-03-14 15:34 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-03-14 15:34 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-03-14 15:34 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=54a343afdc91671e6dc77b8dceb2e8116223337d
Log: Fix #71956: sem_get(0) creating an infinite amount of semaphores
 [2020-03-14 22:52 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=349438
Log: Fix #71956: sem_get(0) creating an infinite amount of semaphores
 [2020-03-14 22:55 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=cd6912645d81b527fdc5e49229aba6050a0a812b
Log: Fix #71956: sem_get(0) creating an infinite amount of semaphores
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=e0597a2c43d1b311e0214a729e0e80753b10e421
Log: Fix #71956: sem_get(0) creating an infinite amount of semaphores
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC