Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

segmentation fault #78

Open
lincepro opened this issue Jul 28, 2022 · 6 comments
Open

segmentation fault #78

lincepro opened this issue Jul 28, 2022 · 6 comments

Comments

@lincepro
Copy link

lincepro commented Jul 28, 2022

image

<?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";  
});  
@Yurunsoft
Copy link
Member

你是用的那个版本的 swoole_postresql

@lincepro
Copy link
Author

你是用的那个版本的 swoole_postresql

昨天下载的最新版 master分支

@Yurunsoft
Copy link
Member

我这边没有复现,你装一下 valgrind 吧
然后用这个命令测试,把日志文件附件发上来
USE_ZEND_ALLOC=0 valgrind --leak-check=full --log-file=leak.log php test.php

@lincepro
Copy link
Author

lincepro commented Jul 28, 2022

image
用valgrind 之后段错误消失了
leak.log.tar.gz

我这边没有复现,你装一下 valgrind 吧 然后用这个命令测试,把日志文件附件发上来 USE_ZEND_ALLOC=0 valgrind --leak-check=full --log-file=leak.log php test.php

@Yurunsoft
Copy link
Member

更新一下PHP版本吧

@lincepro
Copy link
Author

USE_ZEND_ALLOC=0 valgrind --leak-check=full --log-file=leak.log php test.php

image
升级到最新的8.1.8了

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants