Swoole-src: Make warning and test fails swoole 2.1.0

Created on 9 Feb 2018  路  1Comment  路  Source: swoole/swoole-src

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.

Compile swoole 2.1.0 ubuntu 16.04.3 (docker container) php 7.1.13

  1. What did you expect to see?
  2. Make without warning:
  3. Mate test without fails and stuck

  4. What did you see instead?
    Make has some warning:

/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include -DHAVE_CONFIG_H -Wall -pthread -g -O2 -c /tmp/swoole-2.1.0/swoole_http_v2_client_coro.c  -fPIC -DPIC -o .libs/swoole_http_v2_client_coro.o
/tmp/swoole-2.1.0/swoole_http_v2_client_coro.c: In function 'http2_client_onReceive':
/tmp/swoole-2.1.0/swoole_http_v2_client_coro.c:469:13: warning: 'error_code' may be used uninitialized in this function [-Wmaybe-uninitialized]
             zend_update_property_long(swoole_http2_response_class_entry_ptr, zresponse, ZEND_STRL("errCode"), error_code TSRMLS_CC);
             ^
/tmp/swoole-2.1.0/swoole_http_v2_client_coro.c: In function 'http2_client_onClose':
/tmp/swoole-2.1.0/swoole_http_v2_client_coro.c:768:9: warning: 'retval' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int ret = coro_resume(context, result, &retval);
         ^
/bin/bash /tmp/swoole-2.1.0/libtool --mode=compile cc  -I. -I/tmp/swoole-2.1.0 -DPHP_ATOM_INC -I/tmp/swoole-2.1.0/include -I/tmp/swoole-2.1.0/main -I/tmp/swoole-2.1.0 -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /tmp/swoole-2.1.0/swoole_websocket_server.c -o swoole_websocket_server.lo 
========
lude/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /tmp/swoole-2.1.0/src/protocol/SSL.c -o src/protocol/SSL.lo 
libtool: compile:  cc -I. -I/tmp/swoole-2.1.0 -DPHP_ATOM_INC -I/tmp/swoole-2.1.0/include -I/tmp/swoole-2.1.0/main -I/tmp/swoole-2.1.0 -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include -DHAVE_CONFIG_H -Wall -pthread -g -O2 -c /tmp/swoole-2.1.0/src/protocol/SSL.c  -fPIC -DPIC -o src/protocol/.libs/SSL.o
/tmp/swoole-2.1.0/src/protocol/SSL.c:145:13: warning: 'swSSL_lock_callback' defined but not used [-Wunused-function]
 static void swSSL_lock_callback(int mode, int type, char *file, int line)
             ^
/tmp/swoole-2.1.0/src/protocol/SSL.c:158:13: warning: 'swSSL_id_callback' defined but not used [-Wunused-function]
 static void swSSL_id_callback(CRYPTO_THREADID * id)
             ^
/bin/bash /tmp/swoole-2.1.0/libtool --mode=compile cc  -I. -I/tmp/swoole-2.1.0 -DPHP_ATOM_INC -I/tmp/swoole-2.1.0/include -I/tmp/swoole-2.1.0/main -I/tmp/swoole-2.1.0 -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /tmp/swoole-2.1.0/src/protocol/Http.c -o src/protocol/Http.lo 
===================================
/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include -DHAVE_CONFIG_H -Wall -pthread -g -O2 -c /tmp/swoole-2.1.0/swoole_redis.c  -fPIC -DPIC -o .libs/swoole_redis.o
/bin/bash /tmp/swoole-2.1.0/libtool --mode=compile cc  -I. -I/tmp/swoole-2.1.0 -DPHP_ATOM_INC -I/tmp/swoole-2.1.0/include -I/tmp/swoole-2.1.0/main -I/tmp/swoole-2.1.0 -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /tmp/swoole-2.1.0/swoole_redis_coro.c -o swoole_redis_coro.lo 
libtool: compile:  cc -I. -I/tmp/swoole-2.1.0 -DPHP_ATOM_INC -I/tmp/swoole-2.1.0/include -I/tmp/swoole-2.1.0/main -I/tmp/swoole-2.1.0 -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include -DHAVE_CONFIG_H -Wall -pthread -g -O2 -c /tmp/swoole-2.1.0/swoole_redis_coro.c  -fPIC -DPIC -o .libs/swoole_redis_coro.o
In file included from /usr/include/php/20160303/Zend/zend.h:39:0,
                 from /usr/include/php/20160303/main/php.h:36,
                 from /tmp/swoole-2.1.0/php_swoole.h:22,
                 from /tmp/swoole-2.1.0/swoole_redis_coro.c:17:
/tmp/swoole-2.1.0/swoole_redis_coro.c: In function 'swoole_redis_coro_resume':
/usr/include/php/20160303/Zend/zend_variables.h:110:33: warning: 'redis_result' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
                                 ^
/tmp/swoole-2.1.0/swoole_redis_coro.c:3924:11: note: 'redis_result' was declared here
     zval *redis_result = result->value;
           ^
/bin/bash /tmp/swoole-2.1.0/libtool --mode=compile cc  -I. -I/tmp/swoole-2.1.0 -DPHP_ATOM_INC -I/tmp/swoole-2.1.0/include -I/tmp/swoole-2.1.0/main -I/tmp/swoole-2.1.0 -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/tmp/swoole-2.1.0 -I/tmp/swoole-2.1.0/include  -DHAVE_CONFIG_H  -Wall -pthread -g -O2   -c /tmp/swoole-2.1.0/swoole_redis_server.c -o swoole_redis_server.lo 

some fails and stuck on last test:

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : /usr/bin/php7.1 
PHP_SAPI    : cli
PHP_VERSION : 7.1.13-1+ubuntu16.04.1+deb.sury.org+1
ZEND_VERSION: 3.1.0
PHP_OS      : Linux - Linux oi-app 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64
INI actual  : /tmp/swoole-2.1.0/tmp-php.ini
More .INIs  :   
---------------------------------------------------------------------
PHP         : /usr/bin/phpdbg7.1 
PHP_SAPI    : phpdbg
PHP_VERSION : 7.1.13-1+ubuntu16.04.1+deb.sury.org+1
ZEND_VERSION: 3.1.0
PHP_OS      : Linux - Linux oi-app 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64
INI actual  : /tmp/swoole-2.1.0/tmp-php.ini
More .INIs  : 
---------------------------------------------------------------------
CWD         : /tmp/swoole-2.1.0
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2018-02-09 13:39:17
=====================================================================
PASS swoole_async: linux native aio readfile & writefile [tests/swoole_async/aio1.phpt] 
PASS swoole_async: linux native aio read [tests/swoole_async/aio2.phpt] 
PASS swoole_async: linux native aio write [tests/swoole_async/aio3.phpt] 
PASS swoole_async: parallel_read_copy_10m_file [tests/swoole_async/parallel_read_copy_10m_file_with_1m_chunk.phpt] 
PASS swoole_async: parallel_read_copy_10m_file [tests/swoole_async/parallel_read_copy_10m_file_with_512k_chunk.phpt] 
PASS swoole_async: swoole_async_read [tests/swoole_async/readfile.phpt] 
PASS swoole_async: recursive write file [tests/swoole_async/recursive_write.phpt] 
PASS swoole_async: sequence copy 10m file [tests/swoole_async/serial_read_copy_10m_file.phpt] 
PASS swoole_async: swoole_async_dns_lookup [tests/swoole_async/swoole_async_dns_lookup.phpt] 
PASS swoole_async: swoole_async_read [tests/swoole_async/swoole_async_read.phpt] 
PASS swoole_async: swoole_async_set [tests/swoole_async/swoole_async_set.phpt] 
FAIL swoole_async: swoole_async_write [tests/swoole_async/swoole_async_write.phpt] 
PASS swoole_async: swoole_async_read [tests/swoole_async/writefile.phpt] 
PASS swoole_atomic: add/sub/get/cmpset [tests/swoole_atomic/atomic.phpt] 
PASS swoole_atomic: wakeup & wait [tests/swoole_atomic/wait.phpt] 
PASS swoole_buffer: read and write swoole_buffer [tests/swoole_buffer/buffer_append.phpt] 
PASS swoole_buffer: read and write swoole_buffer [tests/swoole_buffer/buffer_clear.phpt] 
PASS swoole_buffer: read and write swoole_buffer [tests/swoole_buffer/buffer_expand.phpt] 
PASS swoole_buffer: read and write swoole_buffer [tests/swoole_buffer/buffer_read_write.phpt] 
PASS swoole_buffer: read and write swoole_buffer [tests/swoole_buffer/buffer_recycle.phpt] 
PASS swoole_buffer: read and write swoole_buffer [tests/swoole_buffer/buffer_substr.phpt] 
PASS swoole_buffer: default contruct buffer [tests/swoole_buffer/construct_buffer.phpt] 
PASS swoole_channel: push & pop & stats [tests/swoole_channel/channel.phpt] 
FAIL swoole_client: big_package_memory_leak [tests/swoole_client_async/big_package_memory_leak.phpt] 
FAIL swoole_client: onBufferFull & onBufferEmpty [tests/swoole_client_async/buffer_full.php.phpt] 
PASS swoole_client: connect refuse [tests/swoole_client_async/connect_refuse.phpt] 
PASS swoole_client: connect_host_not_found [tests/swoole_client_async/connect_timeout.phpt] 
PASS swoole_client: connect twice [tests/swoole_client_async/connect_twice.phpt] 
PASS swoole_client: eof protocol [async] [tests/swoole_client_async/eof.phpt] 
FAIL swoole_client: getSocket debug [tests/swoole_client_async/getSocket_bug.phpt] 
PASS swoole_client: getsockpeername [tests/swoole_client_async/getpeername.phpt] 
PASS swoole_client: swoole_client getsockname [tests/swoole_client_async/getsockname.phpt] 
PASS swoole_client: length protocol [async] [tests/swoole_client_async/length_protocol.phpt] 
FAIL swoole_client: async sendfile [tests/swoole_client_async/sendfile.phpt] 
TEST 35/267 [tests/swoole_client_async/sleep_wake.phpt]

  1. What version of Swoole are you using (php --ri swoole)?
Version => 2.1.0
Author => tianfeng.han[email: [email protected]]
epoll => enabled
eventfd => enabled
timerfd => enabled
signalfd => enabled
cpu affinity => enabled
spinlock => enabled
rwlock => enabled
async redis client => enabled
async http/websocket client => enabled
openssl => enabled
http2 => enabled
Linux Native AIO => enabled
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled

Directive => Local Value => Master Value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_namespace => On => On
swoole.use_shortname => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
  1. What is your machine environment used (including version of kernel & php & gcc) ?
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.6' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6)
  1. If you are using ssl, what is your openssl version?
apt-cache policy openssl
openssl:
  Installed: 1.0.2g-1ubuntu4.10
  Candidate: 1.0.2g-1ubuntu4.10
  Version table:
 *** 1.0.2g-1ubuntu4.10 100
        100 /var/lib/dpkg/status
fixed

Most helpful comment

Thanks for your feedback, the tests/swoole_client_async/sleep_wake.phpt may be a problem, I'm reviewing

>All comments

Thanks for your feedback, the tests/swoole_client_async/sleep_wake.phpt may be a problem, I'm reviewing

Was this page helpful?
0 / 5 - 0 ratings