GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — PHP 8.0 debug nts builds fail when unserializing circular array reference such as GLOBALS · Issue #308 · igbinary/igbinary

PHP 8.0 debug nts builds fail when unserializing circular array reference such as GLOBALS #308

New issue
Copy link
New issue
Copy link
Closed
#351
Closed
PHP 8.0 debug nts builds fail when unserializing circular array reference such as GLOBALS#308
#351
Copy link
Labels
bug

Description

@TysonAndre
TysonAndre
opened on Dec 24, 2020
Issue body actions

This is a result of the unserialization, not specifically of GLOBALS. The issue is that there are multiple references to the same hash table when unserializing an array when there are multiple references to that array

The standard serialize doesn't allow multiple pointers to an array

static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_string *key, zval *pData, uint32_t flag)
{
	zend_ulong h;
	uint32_t nIndex;
	uint32_t idx;
	Bucket *p, *arData;

	IS_CONSISTENT(ht);
	HT_ASSERT_RC1(ht); // this fails in debug builds
--TEST--
Test serialize globals
--SKIPIF--
<?php if (!extension_loaded("igbinary")) print "skip"; ?>
--FILE--
<?php
call_user_func(function () {
    foreach ($GLOBALS as $key => $_) {
        if ($key !== 'GLOBALS') {
            unset($GLOBALS[$key]);
        }
    }
    $ser = igbinary_serialize($GLOBALS);
    echo urlencode($ser) . "\n";
    var_dump(igbinary_unserialize($ser));
    $GLOBALS['globalVar'] = new stdClass();
    $ser = igbinary_serialize($GLOBALS);
    echo urlencode($ser) . "\n";
    var_dump(igbinary_unserialize($ser));
});
--EXPECTF--
0000000214011107474c4f42414c5314010e000101
array(1) {
  ["GLOBALS"]=>
  array(1) {
    ["GLOBALS"]=>
    *RECURSION*
  }
}
TODO fix

Activity

  1. TysonAndre
    added
    bug
    on Dec 24, 2020
  2. TysonAndre
    changed the title [-]PHP 8.0 debug nts builds fail when unserializing circular array reference[/-] [+]PHP 8.0 debug nts builds fail when unserializing circular array reference such as GLOBALS[/+] on Dec 24, 2020
  3. TysonAndre
    added a commit that references this issue on Dec 4, 2021

    Fix debug warning for unserializing circular array reference

    This issue will close once commit 307e80e is merged into the 'master' branch.
    307e80e
  4. TysonAndre
    closed this as completedin #351on Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.