ext-postgresql
ext-postgresql copied to clipboard
segmentation fault

<?php
echo "php version:" . PHP_VERSION . "\n";
echo "swoole version:" . swoole_version(). "\n";
\Co\run(function (){
$obj = new \Co\PostgreSQL();
$obj->connect("host=127.0.0.1 port=5432 dbname=postgres user=postgres password=");
$obj->query("drop table if exists foo");
$obj->query("create table foo(id int, uid int)");
$obj->metaData('foo');
try{
// 不存在的类
new foo;
} catch(\Throwable $e) {
echo "error:" . $e->getMessage() . "\n";
}
echo "无法执行的代码\n";
echo "去掉metaData函数就能正常执行\n";
});
你是用的那个版本的 swoole_postresql?
你是用的那个版本的
swoole_postresql?
昨天下载的最新版 master分支
我这边没有复现,你装一下 valgrind 吧
然后用这个命令测试,把日志文件附件发上来
USE_ZEND_ALLOC=0 valgrind --leak-check=full --log-file=leak.log php test.php
用valgrind 之后段错误消失了
leak.log.tar.gz
我这边没有复现,你装一下 valgrind 吧 然后用这个命令测试,把日志文件附件发上来
USE_ZEND_ALLOC=0 valgrind --leak-check=full --log-file=leak.log php test.php
更新一下PHP版本吧
USE_ZEND_ALLOC=0 valgrind --leak-check=full --log-file=leak.log php test.php
升级到最新的8.1.8了