php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71955 shmop_open: creating infinite amount of segments
Submitted: 2016-04-04 09:10 UTC Modified: 2016-04-04 11:24 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: kakkau at grr dot la Assigned:
Status: Open Package: Unknown/Other Function
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kakkau at grr dot la
New email:
PHP Version: OS:

 

 [2016-04-04 09:10 UTC] kakkau at grr dot la
Description:
------------
1. Run shmop_open with $key=0 and $flags="n" multiple times.
2. Wonder about a missing warning when using the same key for creation.
3. Check the output of ipcs -m. There should show up multiple segments now.

For other integers <> 0 shmop_open works as expected

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

$res = shmop_open(0,"n",0600,1024);
$res = shmop_open(0,"n",0600,1024);

?>

Expected result:
----------------
At least a warning should be thrown w/o creating another segment.

Warning: shmop_open(): unable to attach or create shared memory segment in php shell code on line 1

Call Stack:
   10.9282     120780   1. {main}() php shell code:0
   10.9282     120920   2. shmop_open() php shell code:1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-04 09:17 UTC] requinix@php.net
-Package: PHP Language Specification +Package: Unknown/Other Function
 [2016-04-04 11:24 UTC] kakkau at grr dot la
For segments that were opened via $key=0 it is additionally not possible to attach to them.

This snippet
<?php
shmop_open(0,"n",0600,1024);
shmop_open(0,"a",0600,1024);
?>

additionally fails with
Warning: shmop_open(): unable to attach or create shared memory segment in php shell code on line 1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 25 12:01:31 2024 UTC