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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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: Thu Dec 26 10:01:29 2024 UTC