workerman在stop时偶发exit with status 11和139

chaz6chez

workerman以调试模式启动后,执行了一次请求,该请求后续的业务逻辑中包含了至少一次数据库的操作,在完成该次请求5-10分钟后,ctrl+c 停止进程后会报exit wtih status 11,有时是exit with status 139;

Workerman[app.php] start in DEBUG mode
------------------------------------------------ WORKERMAN -------------------------------------------------
Workerman version:4.0.20          PHP version:7.3.31
------------------------------------------------- WORKERS --------------------------------------------------
proto   user            worker                     listen                     processes    status
tcp     root            rpc_server                 jsonRpc2://0.0.0.0:5454    2             [OK]
tcp     root            order_callback_consumer    none                       2             [OK]
tcp     root            order_push_consumer        none                       2             [OK]
tcp     root            log_consumer               none                       2             [OK]
------------------------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.
^CWorkerman[app.php] stopping ...
worker[rpc_server:24] exit with status 11
Workerman[app.php] has been stopped
[PHP Modules]
amqp
bcmath
Core
ctype
curl
date
dom
event
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
SimpleXML
sockets
sodium
SPL
sqlite3
standard
tokenizer
uuid
xml
xmlreader
xmlwriter
Zend OPcache
zlib
2482 2 0
2个回答

walkor 打赏

exit wtih status 11,exit with status 139 是php发生了coredump
一般是触发了php或php某个扩展的bug导致

  • chaz6chez 2021-10-23

    gdb调试了一下,说是workerman的一个信号和另一个信号分割错误了,不知道是哪个拓展,头疼

  • chaz6chez 2021-10-23
    [New LWP 90]
    Core was generated by `WorkerMan: worker'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  0x000055cb5ec38ba4 in ?? ()
  • chaz6chez 2021-10-23

    大概知道这是一个算数异常,但不知道怎么样去解决和排查

chaz6chez

大概排查了一下

在代码中慎用对class属性unset的操作

// 慎用
unset($this->_client);

// 可以使用
unset($this->_client[$key]);
  • six 2021-10-27

    $this->_client是不是扩展相关的对象?如果是的话估计和那个扩展有关系。

  • chaz6chez 2021-10-27

    是pdo

年代过于久远,无法发表回答
×
🔝