Comments (9)
IMO the ::types::array::Iter
implementation should not fiddle with the hashtable internal buckets directly.
That's likely to break often and introduce safety/soundness issues.
Instead, the implementation should be refactored to use the iteration functions in Zend/zend_hash.c
(i.e zend_hash_iterator_add
, zend_hash_iterator_pos
, zend_hash_get_current_pos
, etc...).
from ext-php-rs.
Sounds good! Do you want to take this with a PR?
If I remember correctly, I already have a POC somewhere locally.
Just have to find the time to come back at it... 😓
In the meantime, if anyone wants to have a stab at it, one just need to look at how it's done in the C implementation for SPL's ArrayIterator
.
from ext-php-rs.
I'm also having this issue with PHP 8.2 (fpm) but not 8.1.
from ext-php-rs.
Can confirm, PHP 8.1.14 works fine.
from ext-php-rs.
Hello and thanks for the report. I think this related to packed array optimization that landed in PHP 8.2.0 and I've implemented very (too?) quickly in #212
from ext-php-rs.
IMO the
::types::array::Iter
implementation should not fiddle with the hashtable internal buckets directly.That's likely to break often and introduce safety/soundness issues.
Instead, the implementation should be refactored to use the iteration functions in
Zend/zend_hash.c
(i.ezend_hash_iterator_add
,zend_hash_iterator_pos
,zend_hash_get_current_pos
, etc...).
Sounds good! Do you want to take this with a PR?
from ext-php-rs.
I'm running into this too, though under PHP 8.0, not 8.2. Specifically the issue I'm seeing is given the PHP array [ 1 ]
, I get a segfault in some cases.
Specifically the bug is laying in https://github.com/davidcole1340/ext-php-rs/blob/master/src/types/array.rs#L538. In some cases (I don't know why), though the Array has 1 item (nNumOfElements == 1
), nNumUsed
is set to two. The end
is then miscalculated to be an offset beyond (I guess) the end of the array. That in turn means the bucket.key
reference is set to 0xffffffffffffffff
, which cases a segfault when calling trying to call ext_php_rs_is_known_valid_utf8
on that invalid pointer reference.
from ext-php-rs.
Hi,
Any update on this ? I'm also having issues with PHP 8.2.4, but everything is fine with PHP 8.1
from ext-php-rs.
Hi,
Any update on this ? I'm also having issues with PHP 8.2.4, but everything is fine with PHP 8.1
I don't have any room to work on it for the moment but I'm available to do reviews if someone is up.
from ext-php-rs.
Related Issues (20)
- Database driver usecase HOT 2
- Unable to install cargo-php HOT 4
- Static property and method HOT 2
- Err: Attempted to access uninitialized class object
- Error: Failed to copy extension from target directory to extension directory
- Feature: Add ability to build PHP as a fallback when the system library is not found
- Build error on OpenSUSE ` invalid conversion between vector type '__m128i' HOT 1
- Build failure with 0.10.3 on aarch64 HOT 3
- How to exchange datetime HOT 4
- Memory corruption when running module tests
- Performance: There seems to be a runtime related overhead with using ext-php-rs extensions in PHP HOT 11
- Stub generation of optional arguments doesn't set default value to NULL
- Module and PHP versions need to match HOT 1
- Iterator from Rust
- Can't not install cargo php under winrdows HOT 1
- Slower Than C HOT 4
- Undefined symbols while building HOT 2
- How to expose PHP's memory manager in Rust? HOT 1
- Unable to install on clean Ubuntu 22.04 docker HOT 4
- DoubleEndedIterator implementation wrong
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 ext-php-rs.