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
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:
MUST BE VALID
Solve the problem:
23 - 2 = ?
Subscribe to this entry?

 
 [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 19:01:28 2024 UTC