New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.4.0使用Swoole\Event::add监听inotify异常 #2673
Comments
请在程序末尾添加 |
查了一下文档,PHP7.3版本是否不需要加wait了? |
|
<?php
$fd = inotify_init();
$watch_descriptor = inotify_add_watch($fd, __FILE__, IN_ATTRIB);
swoole_event_add($fd, function($fd) {
$info = inotify_read($fd);
$queue_len = inotify_queue_len($fd);
var_dump($info, $queue_len);
}, null, SWOOLE_EVENT_READ); 写了一个最简单的程序,无法重现你的问题。 |
我在Swoole\Http\Server->start()之前,添加了Event::wait(),仍然报错,最后一块信息如下: ==19434== Conditional jump or move depends on uninitialised value(s) 我的安装脚本: |
我inotify监听的事件是:IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVE | IN_ISDIR |
无法重现你的问题,请提供一个可以重现的 demo 程序,提供复现的步骤。 |
简化代码: $server = new Swoole\Http\Server('0.0.0.0', 8080);
$server->set([
'dispatch_mode' => 1,
'daemonize' => false,
'package_max_length' => 1024 * 1024 * 10,
'open_cpu_affinity' => true,
'open_tcp_nodelay' => true,
'enable_reuse_port' => true,
'reload_async' => true,
'tcp_fastopen' => true,
'enable_coroutine' => true,
'max_coroutine' => 10000,
'max_wait_time' => 60,
]);
$server->on('start', function () {
$fd = inotify_init();
inotify_add_watch($fd, '/root/swoole/a.txt', IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVE | IN_ISDIR);
Swoole\Event::add($fd, function ($inotify) {
$event = inotify_read($inotify);
print_r($event);
});
});
$server->on('request', function ($req, $res) {
$res->end('');
});
Swoole\Event::wait();
$server->start(); 内核版本: swoole版本: Directive => Local Value => Master Value 安装脚本: |
您好,重新编译v4.4.0后,仍然崩溃,是否需要提供更多信息? 切换到master分支已经可以了,刚刚是指定的tag,感谢 |
v4.4.0使用Swoole\Event::add监听inotify,文件变动时服务器segment fault,v4.3.5正常
The text was updated successfully, but these errors were encountered: