Bug #78438 [NEW]: Data corruption when using __serialize and __unserialize in nested structures

From: Date: Wed, 21 Aug 2019 15:26:49 +0000
Subject: Bug #78438 [NEW]: Data corruption when using __serialize and __unserialize in nested structures
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222350@lists.php.net to get a copy of this message
From: risto at live dot nl Operating system: Linux; Fedora 30 PHP version: 7.4.0beta2 Package: Class/Object related Bug Type: Bug Bug description:Data corruption when using __serialize and __unserialize in nested structures Description: ------------ Data corruption seems to occur when using PHP 7.4s new __serialize and __unserialize functionality in deeply nested data structures. Test script: --------------- Tested on PHP 7.4.0beta4 (cli) (built: Aug 20 2019 14:09:23) ( NTS ) However the bug has been observed in beta 1 and 2 as well. See https://gist.github.com/Devristo/878f4dbd9e30ee3a3c235f0d2ef3431d for a reproducer. And https://github.com/symfony/symfony/issues/33214 for the issue in the wild. Expected result: ---------------- When running the script I expect the unserialization to succeed as it does for deeply nested structures, as it does for the smaller sized examples in the reproducer. Actual result: -------------- It seems that in the deeply nested examples in the reproducer unserialization fails with errors like: - Argument 1 passed to X::__unserialize() must be of the type array, unknown given - Argument 1 passed to X::__unserialize() must be of the type array, int given -- Edit bug report at https://bugs.php.net/bug.php?id=78438&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78438&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78438&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78438&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78438&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78438&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78438&r=support Expected behavior: https://bugs.php.net/fix.php?id=78438&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78438&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78438&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78438&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78438&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78438&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78438&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78438&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78438&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78438&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78438&r=mysqlcfg

« previous php.bugs (#222350) next »