swoole-foundation / yii2-swoole-extension

running yii2 app on swoole
MIT License
41 stars 5 forks source link

Coredump problems with yii2 and FreeBSD 12 #2

Closed tiagocomti closed 4 years ago

tiagocomti commented 4 years ago

Hello friends, I'm testing Swoole with FreeBSD 12 and yii2 php. However, there is always a coredump in any request.

bootstrap.php

<?php
$http = new swoole_http_server("127.0.0.1", 9501);

$http->on("start", function ($server) {
    echo "Swoole http server is started at http://127.0.0.1:9501\n";
});

$http->on("request", function ($request, $response) {
    $response->header("Content-Type", "text/plain");
    $response->end("Hello World\n");
});

$http->start();

config/server.php

<?php
return 
[
    'host' => '127.0.0.1', 
    'port' => 9503,
    'mode' => SWOOLE_PROCESS, 
    'sockType' => SWOOLE_SOCK_TCP, 
    'app' => require __DIR__ . '/web.php', // your original web.php 
    'options' => [ // options for swoole server
        'pid_file' => __DIR__ . '/../runtime/swoole.pid',
        'log_level'=> 0,
        'log_file' => '/tmp/swoole_http_server.log',
        'worker_num' => 2,
        'max_request' => 10000,
        'dispatch_mode' => 2,
        'daemonize' => true,
        'task_worker_num' => 2,
    ]
];

return on i execute sockstat -4l

USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
root php 47137 3 tcp4 127.0.0.1:9501 :

When executing this command coredump appears

root@free:~ # curl -kvss 'http://127.0.0.1:9501'

  • Trying 127.0.0.1:9501...
  • TCP_NODELAY set
  • Connected to 127.0.0.1 (127.0.0.1) port 9501 (#0)

    GET / HTTP/1.1 Host: 127.0.0.1:9501 User-Agent: curl/7.65.1 Accept: /

  • Recv failure: Connection reset by peer
  • Closing connection 0

logs:

Jan 31 18:34:36 free kernel: pid 47137 (php), uid 0: exited on signal 11 (core dumped)

PS:

php -v

PHP 7.3.13 (cli) (built: Jan 2 2020 01:30:34) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.13, Copyright (c) 1998-2018 Zend Technologies

FreeBSD version (uname -a)

FreeBSD free.php.7

12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC i386

swoole version:

php73-pecl-swoole-4.4.15 Asynchronous & concurrent & distributed networking framework

Can someone help me?

xialeistudio commented 4 years ago

Your message has been received, give me some days to process this problem. Thanks

---Original--- From: "FogoQueima"<notifications@github.com> Date: Mon, Feb 3, 2020 20:10 PM To: "swoole-foundation/yii2-swoole-extension"<yii2-swoole-extension@noreply.github.com>; Cc: "Subscribed"<subscribed@noreply.github.com>; Subject: [swoole-foundation/yii2-swoole-extension] Coredump problems with yii2 and FreeBSD 12 (#2)

Hello friends, I'm testing Swoole with FreeBSD 12 and yii2 php. However, there is always a coredump in any request.

bootstrap.php `<?php $http = new swoole_http_server("127.0.0.1", 9501);

$http->on("start", function ($server) { echo "Swoole http server is started at http://127.0.0.1:9501\n"; });

$http->on("request", function ($request, $response) { $response->header("Content-Type", "text/plain"); $response->end("Hello World\n"); });

$http->start();`

config/server.php <?php return [ 'host' => '127.0.0.1', 'port' => 9503, 'mode' => SWOOLE_PROCESS, 'sockType' => SWOOLE_SOCK_TCP, 'app' => require DIR . '/web.php', // your original web.php 'options' => [ // options for swoole server 'pid_file' => DIR . '/../runtime/swoole.pid', 'log_level'=> 0, 'log_file' => '/tmp/swoole_http_server.log', 'worker_num' => 2, 'max_request' => 10000, 'dispatch_mode' => 2, 'daemonize' => true, 'task_worker_num' => 2, ] ];

return on i execute sockstat -4l

USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS root php 47137 3 tcp4 127.0.0.1:9501 :

When executing this command coredump appears

root@free:~ # curl -kvss 'http://127.0.0.1:9501'

Trying 127.0.0.1:9501...

TCP_NODELAY set

Connected to 127.0.0.1 (127.0.0.1) port 9501 (#0)

GET / HTTP/1.1 Host: 127.0.0.1:9501 User-Agent: curl/7.65.1 Accept: /

Recv failure: Connection reset by peer

Closing connection 0

logs:

Jan 31 18:34:36 free kernel: pid 47137 (php), uid 0: exited on signal 11 (core dumped)

PS:

php -v

PHP 7.3.13 (cli) (built: Jan 2 2020 01:30:34) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.13, Copyright (c) 1998-2018 Zend Technologies

FreeBSD version (uname -a) FreeBSD free.php.7

12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC i386

swoole version:

php73-pecl-swoole-4.4.15 Asynchronous & concurrent & distributed networking framework

Can someone help me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

xialeistudio commented 4 years ago

You seem to be using the latest version of swoole, you can submit a issues to swoole project