[php-src] Issue #10801: `hash` as CTE leads to segfault
| From: | mvorisek | Date: | Tue, 07 Mar 2023 09:31:21 +0000 |
| Subject: | [php-src] Issue #10801: `hash` as CTE leads to segfault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243868@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10801
Author: mvorisek
### Description
The following code:
```php
<?php
$h0 = hash("murmur3a", "Two hashes meet in a bar.", options: ["seed"
=> 2345]);
```
and
hash function marked as CTE (like in https://github.com/php/php-src/blob/f16c3e1265/ext/hash/hash.stub.php#L12)
Resulted in this output:
```
========DIFF========
95855f9be0db784a5c37e878c4a4dcee
002+ Segmentation fault (core dumped)
003+
004+ Termsig=11
002- 95855f9be0db784a5c37e878c4a4dcee
003- f64c9eb40287fa686575163893e283b2
004- f64c9eb40287fa686575163893e283b2
005- 7f7ec59b
006- 7f7ec59b
========DONE========
FAIL Hash: MurmurHash3 seed [ext/hash/tests/murmurhash3_seed.phpt]
```
But I expected this output instead:
```
```
discovered in #10771, based on https://github.com/php/php-src/pull/10771#discussion_r1127102071
hash will be not supported as CTE, but I belive the segfault should be investigated, as it can be
used from an extension on compile time for example
### PHP Version
master
### Operating System
any