Performing verification for Focal.

I installed php7.4 and php7.4-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.4 | grep Installed
  Installed: 7.4.3-4ubuntu2.5

$ 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 02:58:22 ubuntu kernel: [ 9394.000341] php[12973]: segfault at 
1700000119 ip 00007f0f2bc575d0 sp 00007ffceb8d0bb0 error 4 in 
mysqlnd.so[7f0f2bc3c000+20000]
Sep  1 02:58:22 ubuntu kernel: [ 9394.000363] Code: 24 08 48 8b 04 24 4c 8b 44 
24 10 48 8b 3e 8b 56 08 48 89 38 89 50 08 c7 46 08 01 00 00 00 eb 82 66 2e 0f 
1f 84 00 00 00 00 00 <49> 8b bc 24 18 01 00 00 48 8b 15 11 5a 01 00 be de 07 00 
00 48 8b

We segfault trying to use the mysqli cursor.

I then enabled -proposed, and installed php7.4 version 7.4.3-4ubuntu2.6.

$ sudo apt-cache policy php7.4 | grep Installed
  Installed: 7.4.3-4ubuntu2.6
  
$ 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 Focal as
verified.

** Tags removed: verification-needed-focal
** Tags added: verification-done-focal

-- 
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
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to