Please answer these questions before submitting your issue. Thanks!
HTTP/1.1 200 OKj�
php --ri swoole)?swoole
Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.4.7
Built => Sep 25 2019 14:32:39
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
spinlock => enabled
rwlock => enabled
http2 => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
PHP 7.3.9 (cli) (built: Sep 3 2019 06:40:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/8.3.0/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-8.3.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 8.3.0' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-cloog-backend --enable-languages=c,c++,objc,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 8.3.0 (Alpine 8.3.0)
Additions:
die()) causes the next request to not have those random bytesIf it is compiled from source, are you make clean before upgrading?
How can I reproduce this problem?
No, the extension is installed via pecl. About the reproduction ... to be honest, I have no clue. We have one other swoole project that is not suffering from that problem. I'll figure something out and get back to you
run your application in the following way:
USE_ZEND_ALLOC=0 valgrind --log-file=/tmp/valgrind.log php xxx.php
and show your log here
maybe we can trace some memory errors
@twose this can be reproduced here:
https://github.com/nick-zh/swoole-debug
It is a small hello world project using Slim 4 and the https://github.com/chubbyphp/chubbyphp-swoole-request-handler to transform the requests.
I am not familiar with valgrind, as soon as i change the startup to use valgrind:
https://github.com/nick-zh/swoole-debug/blob/master/docker/php/files/startup.sh#L5
(so uncomment L5 and comment L6)
The random bytes disappear (but maybe this is normal, i don't know)
Let me know if you need more information
Thanks @nick-zh! I will then wait with the log file. This is surely more helpful :)
The problem may be triggered by explicitly setting a reason phrase on the swool response in the response emitter. If I remove the custom reason I just get a correct reason without any random bytes: https://github.com/chubbyphp/chubbyphp-swoole-request-handler/blob/master/src/SwooleResponseEmitter.php#L16
Edit: Doing the following also prevents random bytes:
$swooleResponse->status($response->getStatusCode(), $response->getReasonPhrase() . "\x00");
@nick-zh
Although the random bytes disappeared, it doesn't mean the memory error didn't happen
So I still need to check your log for more information
A stupid mistake
Fixed in master
Thank you! :)
@twose awesome, thank you very much!
@twose would be cool if you could do a bugfix release with that fix
@dominikzogg It's Golden Week in China. Most team members are taking a break and won't be available until Oct 8th. Once back from the break, they will schedule a new release for the 4.4 series.
Swoole 4.4.8 was released early today.
Most helpful comment
Swoole 4.4.8 was released early today.