php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2149 System V semaphores do not work properly
Submitted: 1999-08-25 12:46 UTC Modified: 1999-08-28 06:08 UTC
From: mcafee at umich dot edu Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: AIX 4.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mcafee at umich dot edu
New email:
PHP Version: OS:

 

 [1999-08-25 12:46 UTC] mcafee at umich dot edu
<? $sem = sem_get(999); ?>

This results in the following error on AIX 4.2:

Warning: semctl(SETVAL) failed for key 0x3e7: Result too large in /home/nsadmin/apache/htdocs/a.php on line 1

This is because of the following system call in functions/sysvsem.c:

semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire)

AIX's semctl expects the SETVAL value to be passed directly as the fourth argument, not indirectly via pointer.

The fix is very simple; just replace the code that reads

#if HAVE_SEMUN
...
#else
...
#endif

with

#if defined(_AIX)
...  /* same as #else case, but remove ampersand before max_acquire */
#elif HAVE_SEMUN
...
#else
...
#endif

The fix is trivial, but I'd be happy to submit a patch if necessary.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-28 06:08 UTC] sas at cvs dot php dot net
fixed in CVS. Thanks for the hint.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC