Could you provide a script to reproduce this issue?
I understand that the issue occurs randomly, but I have to have something to work on.
Unfortunately, there is no possibility to provide the script, because for this is need to provide partial access to a commercial application =)
At the weekend I think can to find time for a small demo application with the same stack and similar behavior.
if ((stream->writepos - stream->readpos) > 0 &&
stream->fclose_stdiocast != PHP_STREAM_FCLOSE_FOPENCOOKIE &&
(flags & PHP_STREAM_CAST_INTERNAL) == 0
/* the data we have buffered will be lost to the third party library that
* will be accessing the stream. Emit a warning so that the end-user will
* know that they should try something else */
php_error_docref(NULL, E_WARNING, ZEND_LONG_FMT " bytes of buffered data lost during stream conversion!", (zend_long)(stream->writepos - stream->readpos));
I don't know how to handle this case, since the _php_stream_cast function returnsSUCCESSdespite of the error condition.
The code is called when Event constructor tries to obtain numeric file descriptor from a PHP stream resource. The warning should disappear, if you pass a numeric file descriptor, or a socket resource instead of a stream
@deadbeat Could you test if the warning occurs with the latest changes?
I have problem with installing for php 7.3.3 at alpine (docker), locally for php-7.2.18 at debian 8 is OK. Installing with pecl is OK for 7.3
Step 6/12 : RUN set -xe && cd /var/www/pecl-event/ && phpize && ./configure --with-event-core --with-event-extra --enable-event-debug && make && make install && echo "extension=event.so" > /usr/local/etc/php/conf.d/event.ini && pecl install raphf && docker-php-ext-enable raphf && pecl install pq && echo "extension=pq.so" > /usr/local/etc/php/conf.d/pq.ini && pecl install dbase-7.0.0beta1 && echo "extension=dbase.so" > /usr/local/etc/php/conf.d/dbase.ini && rm -rf /tmp/* /var/cache/apk/* ---> Running in 0ae6ff0b7d7d
+ cd /var/www/pecl-event/
+ phpize Configuring for: PHP Api Version: 20180731 Zend Module Api No: 20180731 Zend Extension Api No: 320180731
+ ./configure --with-event-core --with-event-extra --enable-event-debug ... configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. ... checking whether Event debugging support enabled... yes checking whether to enable sockets support in Event... yes checking PHP version... configure: error: unknown source ERROR: Service 'backend' failed to build: The command '/bin/sh -c set -xe && cd /var/www/pecl-event/ && phpize && ./configure --with-event-core --with-event-extra --enable-event-debug && make && make install && echo "extension=event.so" > /usr/local/etc/php/conf.d/event.ini && pecl install raphf && docker-php-ext-enable raphf && pecl install pq && echo "extension=pq.so" > /usr/local/etc/php/conf.d/pq.ini && pecl install dbase-7.0.0beta1 && echo "extension=dbase.so" > /usr/local/etc/php/conf.d/dbase.ini && rm -rf /tmp/* /var/cache/apk/*' returned a non-zero code: 1
Ruslan Osmanovrepo owner
Looks like /var/www/pecl-event/doesn't contain php7 directory.
Sorry, it was my mistake at the previous steps with COPY ./pecl-event/* instead of COPY ./pecl-event, the first option don't keep the directory structure. After installing I get the following error PHP Warning: PHP Startup: Unable to load dynamic library 'event.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/event.so (Error loading shared library libevent_openssl-2.0.so.5: No such file or directory I don’t know why it is happened(( I have installed libraries libevent-dev, libressl-dev, openssl-dev and decided to check with command pkg-config --libs libevent_openssland it turned out that I have a more recent version - /usr/lib/libevent_openssl-2.1.so.6
For version 7.3 is failed to install, I tried stretch and alpine, for version 7.2 is OK and no error of stream conversion.
Ruslan Osmanovrepo owner
@deadbeat Well, then I’ll rather publish a new PECL release. I think the changes are safe enough.