324 Star 1.6K Fork 337

GVPswoole / swoole-src

 / 详情

1.9.9 swoole 版本log_file文件名(长度为32时),文件名乱码

Done
Opened this issue  
2017-05-04 11:15

1.9.9 swoole 版本log_file文件名乱码 文件名长度为32并且配置了task_worker_num时必现。

strace -f -e open php 1.php

open("/tmp/log/logfile123456789012.log\360\260\"\274\336\177", O_RDWR|O_CREAT|O_APPEND, 0666) = 5

1.php 内容

<?php

$serv = new Swoole\Http\Server("127.0.0.1", 9508);
$setting = [
                'log_file' => '/tmp/log/logfile123456789012.log',
                'task_worker_num'=>0,
        ];
$serv -> set($setting);

$serv->on('Request', function($request, $response) {
        $response->cookie("User", "Swoole");
        $response->header("X-Server", "Swoole");
        $response->end("<h1>Hello Swoole!</h1>");
});
if (isset($setting['task_worker_num'])) {
        $serv->on('Task', function(){});
        $serv->on('Finish', function(){});
}
$serv->start();
[root@CentOS67-120-201 ~]# ll /tmp/log
total 0
-rw-r--r-- 1 root root 0 May  3 21:05 logfile123456789012.log??"???
-rw-r--r-- 1 root root 0 May  3 21:03 logfile123456789012.log??????
-rw-r--r-- 1 root root 0 May  3 20:57 logfile123456789012.log??"?1?
-rw-r--r-- 1 root root 0 May  3 20:54 logfile12345.log

Comments (3)

stone created 任务

是否启用了jemalloc等额外的编译参数。

@韩天峰 恩启用了 --enable-async-redis --enable-jemalloc

启用jemalloc时存在问题,请关闭jemalloc

韩天峰 closed 任务

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(2)
C
1
https://gitee.com/swoole/swoole.git
git@gitee.com:swoole/swoole.git
swoole
swoole
swoole-src

Search

挂件 关闭按钮