Bug #79880 [Com]: Fatal error: Uncaught Error: Invalid serialization data for DateTime object
| From: | igor dot ozerskii at currencysolutions dot com | Date: | Thu, 06 Aug 2020 10:08:59 +0000 |
| Subject: | Bug #79880 [Com]: Fatal error: Uncaught Error: Invalid serialization data for DateTime object | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228425@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79880&edit=1
ID: 79880
Comment by: igor dot ozerskii at currencysolutions dot com
Reported by: isharafa at unb dot ca
Summary: Fatal error: Uncaught Error: Invalid serialization
data for DateTime object
Status: Open
Type: Bug
Package: Date/time related
Operating System: Ubuntu
PHP Version: 7.4.8
Block user comment: N
Private report: N
New Comment:
I have a similar problem when upgrading to 7.4.8 from 7.3.20, an error appeared.
[Error]
Invalid serialization data for DateTime object (0)
/home/bitrix/ext_www/htdocs/bitrix/modules/main/lib/data/cacheengineredis.php:366
# 0: DateTime -> __ wakeup ()
# 1: Redis-> get (string)
/home/bitrix/ext_www/htdocs/bitrix/modules/main/lib/data/cacheengineredis.php:366
# 2: Bitrix \ Main \ Data \ CacheEngineRedis-> read (array, string, string, string, integer)
environment Docker
PHP - php:7.4-fpm-alpine and FROM php:7.3-fpm-alpine
Redis Extension - develop branch and try branch master (github.com/ phpredis/ phpredis/ )
Redis server - 5.0.9
php:7.3 - work fine
Previous Comments:
------------------------------------------------------------------------
[2020-07-22 14:42:16] nikic@php.net
I still don't understand what the supposed bug here is. Unserialization throwing exceptions is
completely normal. You get a fatal error because you did not catch the exception.
------------------------------------------------------------------------
[2020-07-22 14:16:45] isharafa at unb dot ca
When I modify the datetime object, it just return false, but with this specific test case I get the
Fatal Error. That's why I reported this bug.
------------------------------------------------------------------------
[2020-07-22 12:26:49] cmb@php.net
So this is obviously not a bug.
------------------------------------------------------------------------
[2020-07-22 10:59:42] isharafa at unb dot ca
Yes.
------------------------------------------------------------------------
[2020-07-21 23:39:21] requinix@php.net
What's the bug? You're crafting a custom serialized string (which is already a bad thing)
containing an invalid date string that DateTime would have rejected (so the object shouldn't
even exist in the first place) and when you try to unserialize it you get an exception (as opposed
to a crash).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79880
--
Edit this bug report at https://bugs.php.net/bug.php?id=79880&edit=1