Comments (7)
The segfault happens on trying to store a NULL
value and it has been fixed in redis-2.2.7 which was released in 2015-03-03
The problem here is that most distros are shipping an older version.
I see the following possibilities:
- Mark as
wontfix
- increase minimum required redis extension version to 2.2.7
- check redis extension version and define the capability supported data types accordingly
- manually cast to
NULL
to string as this is what the current capability supported data types defines
@weierophinney @Maks3w @Ocramius @kynx Thoughts ?
from zend-cache.
- Does this affect to production code or only to tests?
- What redis extension version is distributed by those distributions?
- Is that version branch still supported by the vendor?
About to transform null in a different type, definitely no as it breaks forward compatibility and breaks the developer expectations.
If we conclude we can't raise the minimum version then we should throw Exception if null data type and bugged extension are used at the sametime. The exception should indicate how to fix the problem: update the extension, avoid to write null values or replace null values with any other value like string, integer, etc
from zend-cache.
Of the distros I've got running:
- RHEL 5 (via EPEL): doesn't ship extension
- RHEL 6 & 7 (via EPEL): 2.2.7
- Ubuntu 14.04.4: 2.2.4
- Brew: 2.2.7
Would bumping the minimum version mean tests won't run in travis? That would be a pain.
from zend-cache.
IIRC there is a setting for use a most recent version of Ubuntu.
As far as I see only current Ubuntu LTS ship an older version. But Ubuntu has a large userbase and the jump to versions greater than 14.1 is not easy.
An alternative is ask to Ubuntu if they want to upgrade the version or backport the fix.
from zend-cache.
- debian jessie = 2.2.5
- debian sid (unstable) = 2.2.7
from zend-cache.
Because (currently) this adapter only supports string defined by our own capabilities I think the simplest fix would be to cast every input into a string before calling writing functions to redis.
As far as I can see in the redis source code it already supports serializing data into strings but for zend-cache this is a new future we can add this functionality in a future release that than needs to proper handle different versions of the installed redis extension.
from zend-cache.
mh forget about my last comment this is more complicated:
Currently the capabilities describes that the redis adapter casts everything into strings.
This is not true!
In fact the adapter itself doesn't cast anything and gives the values as-is to the extension.
The extension does support serializing values but it needs to be configured to use a serializer.
By default no serializer is configured and yes in this case every value shoiuld be cast to a string by the extension but with the edge case that on storing NULL
a segmentation fault happens in version 2.2.5.
I have a working PR #89 which fixes both because I'm sure if we blindly cast everything into a string only because the supported datatypes capability tells that it's still a BC break as it was working before.
from zend-cache.
Related Issues (20)
- Why make Zend\Cache\Storage\Adapter\Filesystem only support string data types? HOT 2
- Add PHP 7.2 support, drop HHVM HOT 1
- ZF2 Memcached PHP7 backward incompatible change HOT 2
- Invalid prototype (PHP 7.2) HOT 10
- StorageFactory Not Reading "cache_dir" Setting HOT 2
- memcached doesn't work with plugin phpSerialize HOT 2
- When 2.8 will be released? HOT 10
- PSR-16 support: serialization using plugin HOT 2
- PSR-16 support: clear by namespace when appropriate HOT 1
- PSR-16 support: prevent concurrent regression when calling delete HOT 3
- ZendCache 2.8 sets $success on getItem if there is a null response HOT 1
- PSR-16 and blackhole not possible HOT 6
- Missing docs about APCU storage HOT 1
- SimpleCacheDecorator and providesPerItemTtl leads undocumented behaviors HOT 4
- StorageInterface::hasItem issue with ext-redis 4.0.1+ HOT 1
- [ZF3] Remove StorageFactory and PatternFactory HOT 2
- Make it possible to decorate cache adapters with PSR6/PSR16 decorators through configuration HOT 1
- Typo in variable for ExtMongoDbResourceManager adapter makes passing db a no-op HOT 3
- SimpleCacheDecorator Cache gets deleted after creation
- Redis::delete is deprecated HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zend-cache.