longxinH / xhprof

PHP7/PHP8 support
http://pecl.php.net/package/xhprof
Apache License 2.0
1.04k stars 165 forks source link

Segmentation fault with PHP 8.2.0RC4 and current xhprof master branch content #71

Closed llaville closed 1 year ago

llaville commented 1 year ago

Bug Report

  1. Script to test
<?php
class SqlitePlatform
{
    public static function udfSqrt($value)
    {
        return sqrt($value);
    }
}

$userDefinedFunctions = [
    'sqrt' => ['callback' => [SqlitePlatform::class, 'udfSqrt'], 'numArgs' => 1],
];

$dsn = "sqlite:user-db.sqlite";
try {
    $pdo = new PDO($dsn);
    foreach ($userDefinedFunctions as $fn => $data) {
        $pdo->sqliteCreateFunction($fn, $data['callback'], $data['numArgs']);
    }
    \var_dump($pdo);

} catch (PDOException $e) {
    \var_dump($e);
}
  1. What did you expect to see
object(PDO)#1 (0) {
}
  1. What did you see instead
Segmentation fault
  1. What is your Xhprof version

2.3.7 and current master branch too (commit a7befadae5b57bb63dff0cfaf05aa642e564aa03)

I've though first that it was a PHP regression (see report https://github.com/php/php-src/issues/9749) until I found that it was this extension that run me in trouble.

BTW, run version 2.3.7 run fine with PHP 8.2.0RC3 (no segmentation fault)

cmb69 commented 1 year ago

FWIW, this issue has been introduced by https://github.com/php/php-src/commit/9be00e3935b69930b5c2603e78f5e51026102377.

longxinH commented 1 year ago

@llaville Has the problem been resolved?

llaville commented 1 year ago

@longxinH No. This is the reason why I've opened this issue.

llaville commented 1 year ago

FYI: Issue still exits with PHP 8.2.0RC5 and xhprof 2.3.8

longxinH commented 1 year ago

This bug should be fixed in RC6 rc6

llaville commented 1 year ago

Will check it ASAP, when RC6 will be released !

llaville commented 1 year ago

@longxinH I confirmed it's fixed with 8.2.0RC6 and latest release 2.3.8