Performing verification for Bionic.
I installed php7.2 and php7.2-mysql from -updates, version
7.4.3-4ubuntu2.5.
I also installed mysql and set up the database table and inserted data
into it.
$ sudo apt-cache policy php7.2 | grep Installed
Installed: 7.2.24-0ubuntu0.18.04.8
$ cat testcase.php
<?php
$dbConn= new mysqli("127.0.0.1", "ubuntu", "ubuntu", "ubuntu_releases",
"3306");
$SQL="SELECT * from ubuntu_releases";
$stmt=$dbConn->prepare($SQL);
$stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE,
MYSQLI_CURSOR_TYPE_READ_ONLY);
$stmt->execute();
if ($stmt) {
$res = $stmt->get_result();
while($row = $res->fetch_assoc()) {
echo json_encode($row) . "\n";
}
}
$dbConn->close()
?>
$ php testcase.php
Segmentation fault (core dumped)
$ tail /var/log/kern.log
Sep 1 03:33:13 ubuntu kernel: [ 843.642697] do_general_protection: 5
callbacks suppressed
Sep 1 03:33:13 ubuntu kernel: [ 843.642705] traps: php[10167] general
protection ip:7f9256b72f90 sp:7ffc6b263670 error:0 in
mysqlnd.so[7f9256b4a000+38000]
We segfault trying to use the mysqli cursor.
I then enabled -proposed, and installed php7.2 version
7.2.24-0ubuntu0.18.04.9.
$ sudo apt-cache policy php7.2 | grep Installed
Installed: 7.2.24-0ubuntu0.18.04.9
$ php testcase.php
{"year":21,"month":4,"name":"hirsute"}
{"year":20,"month":10,"name":"groovy"}
{"year":20,"month":4,"name":"focal"}
We no longer segfault, and we can read rows from the mysqli cursor
correctly.
The fixed package in -proposed solves the issue. Happy to mark Bionic as
verified.
** Tags removed: verification-needed verification-needed-bionic
** Tags added: verification-done-bionic
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1939853
Title:
mysqli: Using a cursor with get_result() and prepared statements
causes a segmentation fault
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/php7.2/+bug/1939853/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs