php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43631 php extension dealing with array cause crash
Submitted: 2007-12-19 00:19 UTC Modified: 2007-12-19 08:46 UTC
From: tser at deltacontrols dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.2.5 OS: WinXP
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: tser at deltacontrols dot com
New email:
PHP Version: OS:

 

 [2007-12-19 00:19 UTC] tser at deltacontrols dot com
Description:
------------
Implemented a simple php extension function that return an array of arrays.

A php page that call the function and repeatedly echo the content works fine until the page is executed frequently (simply by holding F5 on the browser) it will cause a crash in inetinfo.





Reproduce code:
---------------
ZEND_FUNCTION(GetProperty) 
{
  zval* objectEntry;
  
  array_init(return_value);
  zend_first_try
  {
    for (int t=0; t<500; t++)
      {
        MAKE_STD_ZVAL(objectEntry);
        array_init(objectEntry);
        add_next_index_string(objectEntry, "TestEntryTestEntryTestEntryTestEntryTestEntryTestEntryTestEntryTestEntry", 1);
        add_next_index_string(objectEntry, "000000000000000000000000000000000000000000000000000000000000000000000000", 1);
        add_next_index_zval(return_value, objectEntry);
      }
  }
  zend_catch
  {
  }
  zend_end_try();
}
---------------------------
<?php 
for ($X=1; $X<25; $X++)
  {
    echo "Memory Usage:" , memory_get_usage(), "/", memory_get_peak_usage(), "<br>";
    $Result = GetProperty(".*");
    foreach ($Result as $ObjectResult)
    {
      echo $ObjectResult[0], "(" , $ObjectResult[1], ")", ",";
    }
    echo "<br>";
  }
?>
----------------------------
In IIS, setup the website to use Low(IIS Process).
Browser the page and hit F5 in the browser to refresh the page.

Expected result:
----------------
The page should be refresh properly.

Actual result:
--------------
inetinfo.exe will crash.
Sometime there will a runtime error message.

Runtime Error!
R6030
- CRT not initialized

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-19 08:46 UTC] derick@php.net
This is not a bug *in* PHP - please discuss this on the pecl-dev mailinglist instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC