Infinite recursion when iterating
danog opened this issue · comments
Daniil Gentili commented
This code causes infinite recursion:
<?php declare(strict_types=1);
require 'vendor/autoload.php';
$config = Amp\Mysql\MysqlConfig::fromString(
"host=127.0.0.1 user=daniil db=test"
);
$pool = new Amp\Mysql\MysqlConnectionPool($config);
foreach ($pool->execute("SELECT * FROM 6565201688_MTProto_chats") as $result) {
var_dump($result);
}
Daniil Gentili commented
Using the table at https://paste.daniil.it/dump.sql
Daniil Gentili commented
With mariadb from 11.2.2-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1
Daniil Gentili commented
The culprit seems to be amphp/sql-common@de27f1c
Aaron Piotrowski commented
The issue seems to be yield from
here. Swapping that to foreach ($result as $row) yield $row
fixes the segfault. Seems we found a PHP bug, though I'm not sure how to repo it in isolation.
Bilge commented
OK, but we really need to reproduce it 😞