Bug #72062 [NEW]: msg_send may produce a memory leak

From: Date: Wed, 20 Apr 2016 08:41:51 +0000
Subject: Bug #72062 [NEW]: msg_send may produce a memory leak
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200657@lists.php.net to get a copy of this message
From:             77676182 at qq dot com
Operating system: Ubuntu 14.04
PHP version:      7.0.6RC1
Package:          Semaphore related
Bug Type:         Bug
Bug description:msg_send may produce a memory leak

Description:
------------
# sapi/cli/php -v
PHP 7.0.6RC1 (cli) (built: Apr 20 2016 16:16:50) ( ZTS DEBUG )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

php was configured with:
./configure --disable-all --enable-debug --enable-maintainer-zts
--enable-sysvmsg


Test script:
---------------
<?php
error_reporting(0);
$mq  = msg_queue_get(0x1234);
$err = "hello";
$ret = msg_send($mq, 1, str_repeat("a", 1024000), false, true, $err);
if (!$ret) {
    printf("msg_send failed(%d)!\n", $err);
}

Expected result:
----------------
msg_send failed(22)!

Actual result:
--------------
msg_send failed(22)!
[Wed Apr 20 16:38:41 2016]  Script:  '/root/github/php-src/test.php'
/root/github/php-src/Zend/zend_string.h(121) :  Freeing 0x7F3430602E00
(32 bytes), script=/root/github/php-src/test.php
=== Total 1 memory leaks detected ===

-- 
Edit bug report at https://bugs.php.net/bug.php?id=72062&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=72062&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=72062&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=72062&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=72062&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=72062&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=72062&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=72062&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=72062&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=72062&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=72062&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=72062&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=72062&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=72062&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72062&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=72062&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=72062&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=72062&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72062&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=72062&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=72062&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#200657) next »